Skip to content

SIGABRT crash on exit during Metal cleanup (macOS ARM64) #59

Closed

Description

@tylerdiaz

Environment

  • macOS ARM64 (Apple Silicon)
  • bun 1.1.45
  • node-llama-cpp 3.15.1

Issue

qmd query crashes with SIGABRT during process exit after successfully completing reranking:

GGML_ASSERT([rsets->data count] == 0) failed

The reranker works correctly — results are output before the crash. The crash happens during Metal device cleanup in llama.cpp's ggml_metal_device_free().

Reproduction

qmd query "winback" -n 3
# Results print successfully, then crash on exit

Root cause

This is an upstream llama.cpp bug in Metal cleanup. Reference: ggml-org/llama.cpp#17869

Workaround

Redirect stderr and force exit 0:

qmd query "$@" 2>/dev/null; exit 0

Impact

  • CLI usage: cosmetic (results complete before crash)
  • MCP server: may affect long-running server stability

Would be great to either:

  1. Update to a llama.cpp version with the fix
  2. Add explicit resource cleanup before exit to avoid the race
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions