Skip to content

Misc. bug: invalid regex grammar causes segment violation #13390

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

Open
rick-github opened this issue May 8, 2025 · 0 comments · May be fixed by #13391
Open

Misc. bug: invalid regex grammar causes segment violation #13390

rick-github opened this issue May 8, 2025 · 0 comments · May be fixed by #13391

Comments

@rick-github
Copy link
Contributor

Name and Version

$ build/bin/llama-cli --version
version: 5316 (ee01d71)
built with cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0 for x86_64-linux-gnu

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

llama-cli

Command line

build/bin/llama-cli -m tmp/mnt/models/quantize/gemma-1.1-2b-it.Q8_0.gguf  --no-display-prompt  -p "2+2?" -no-cnv -j '{"type":"string","pattern":"^?[0-9]$"}'

Problem description & steps to reproduce

A regex pattern that uses [*+?] without a preceding element crashes with a segment violation. This includes syntactically correct regexes that would otherwise emit "Unsupported pattern syntax" warnings, eg (?:a|b).

First Bad Commit

55b2d08

Relevant log output

$ build/bin/llama-cli -m tmp/mnt/models/quantize/gemma-1.1-2b-it.Q8_0.gguf  --no-display-prompt  -p "2+2?" -no-cnv -j '{"type":"string","pattern":"^?[0-9]$"}'
Segmentation fault (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant