Skip to content

Process crash due to white spaces in grammar file. #4376

Closed
@darxkies

Description

@darxkies

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior

Use grammar files containing white spaces.

Current Behavior

When using a grammar file and the rules contain ' ' or \n then main and server crash with the following error:

GGML_ASSERT: llama.cpp:7776: !grammar->stacks.empty()
ptrace: Operation not permitted.
No stack.
The program is not being run.

Environment and Context

CPU: i9-12900H
OS: Arch

Steps to Reproduce

make clean; make LLAMA_CUBLAS=1 LLAMA_SERVER_VERBOSE=1 -j 20 main; ./main -b 4096 -c 4096 -m models/dolphin-2.2.1-mistral-7b.Q8_0.gguf -f prompts/react.txt --grammar-file grammars/json_arr.gbnf

b1613 was the latest tag that used to work properly. Afterwards it keeps crashing.

It is not related to the model. It failed with several 7b/13b models.

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