Skip to content

Malformed grammar crashes the server #3878

@dkogut1996

Description

@dkogut1996

Sending malformed grammar crashes the server example.

For instance, sending

curl --location 'localhost:8080/completion' \
--header 'Content-Type: application/json' \
--data '{
    "grammar": "Root ::= [^\n]+ \"\n#\""
}'

to the server (built using make server and run via ./server -m <model>) will crash the server with the following exception:
libc++abi: terminating due to uncaught exception of type std::out_of_range: map::at: key not found. The r in root was capitalized, which is the source of the bad grammar.

Tested on an M1 Max Mac using commit 238657d.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions