-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory bug in grammar parser #7194
Conversation
This important change was accidentally removed in 94d0940. Credit for discovering (and most importantly, reporting) this issue goes to Eclypsium Security Researcher Richard Johnson. Bug fix sent upstream in ggerganov/llama.cpp#7194
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Observations:
-
common/common.cpp : gpt_params_parse_ex() now throws an invalid parameter right at the point of of argument
-
common/grammar-parser.cpp : grammar_parser() now throws for when string unexpectedly end while searching for closing characters
"
or]
(as well as after-
within square brackets) -
examples/llava/llava-cli.cpp : process_prompt() will now exit(1) when llama_sampling_init() fails to initialize
-
examples/main/main.cpp : main() will now exit(1) when llama_sampling_init() fails to initialize
CI test failed, but unsure on cause of error. Subprocess aborted? Might be a CI fluke?
18 - test-grammar-integration (Subprocess aborted)
24 - test-json-schema-to-grammar (Subprocess aborted)
The llama.cpp grammar parser had a bug where forgetting to add a closing quotation mark to strings would cause parsing to crash. Anyone running a server on a public endpoint is advised to upgrade. To reproduce this bug ./llamafile -m foo.gguf -p bar --grammar 'root::="' Credit for discovering and reporting this issue goes to Eclypsium Security Researcher Richard Johnson <Richard.johnson@eclypsium.com>.
…on (#1637) * Backported . (any chat) from llama.cpp * unfinished {count,optionalmax) * implemented slice function in std:vector * fixed mistake done while reading * ported ggerganov/llama.cpp#7194 * multiple fixes, var copy * Rewrite LlamaGrammar internals in python style * bugfix --------- Co-authored-by: Andrei <abetlen@gmail.com>
…on (#1637) * Backported . (any chat) from llama.cpp * unfinished {count,optionalmax) * implemented slice function in std:vector * fixed mistake done while reading * ported ggerganov/llama.cpp#7194 * multiple fixes, var copy * Rewrite LlamaGrammar internals in python style * bugfix --------- Co-authored-by: Andrei <abetlen@gmail.com>
…on (#1637) * Backported . (any chat) from llama.cpp * unfinished {count,optionalmax) * implemented slice function in std:vector * fixed mistake done while reading * ported ggerganov/llama.cpp#7194 * multiple fixes, var copy * Rewrite LlamaGrammar internals in python style * bugfix --------- Co-authored-by: Andrei <abetlen@gmail.com>
…on (#1637) * Backported . (any chat) from llama.cpp * unfinished {count,optionalmax) * implemented slice function in std:vector * fixed mistake done while reading * ported ggerganov/llama.cpp#7194 * multiple fixes, var copy * Rewrite LlamaGrammar internals in python style * bugfix --------- Co-authored-by: Andrei <abetlen@gmail.com>
…on (#1637) * Backported . (any chat) from llama.cpp * unfinished {count,optionalmax) * implemented slice function in std:vector * fixed mistake done while reading * ported ggerganov/llama.cpp#7194 * multiple fixes, var copy * Rewrite LlamaGrammar internals in python style * bugfix --------- Co-authored-by: Andrei <abetlen@gmail.com>
…on (#1637) * Backported . (any chat) from llama.cpp * unfinished {count,optionalmax) * implemented slice function in std:vector * fixed mistake done while reading * ported ggerganov/llama.cpp#7194 * multiple fixes, var copy * Rewrite LlamaGrammar internals in python style * bugfix --------- Co-authored-by: Andrei <abetlen@gmail.com>
The llama.cpp grammar parser had a bug where forgetting to add a closing quotation mark to strings would cause parsing to crash. Anyone running a server on a public endpoint is advised to upgrade. To reproduce this bug
Credit for discovering and reporting this issue goes to Eclypsium Security Researcher Richard Johnson Richard.johnson@eclypsium.com.