Skip to content

[BUG]headroom-ai crashes the Python process with SIGILL / Illegal instruction when running real compression through the Python library API. #1723

Description

@lastpepole

Description

headroom-ai==0.28.0 crashes the Python process with SIGILL / Illegal instruction when running real compression through the Python library API.

This is not a Python exception, not an import error, and not an OOM. The process is terminated by signal 4 (SIGILL). When Headroom is called in-process from a long-running server, the whole service exits.

We reproduced this inside a Docker container. Importing headroom works, but calling compression causes a native crash.

To Reproduce

Steps to reproduce the behavior:

  1. Install Headroom:
pip install "headroom-ai==0.28.0"
  1. Verify import works:
python3 -c "import headroom; print(headroom.__version__)"

Expected output:

0.28.0
  1. Run compression with a tool role message:
python3 -u -c "
import headroom

text = 'This is a test context. ' * 200

print('before compress', flush=True)

result = headroom.compress(
    messages=[
        {
            'role': 'tool',
            'content': text,
        }
    ],
    compression_ratio=0.7,
)

print('after compress', flush=True)
print(result)
"
  1. See process crash with Illegal instruction.

Expected Behavior

Headroom should not terminate the Python process with SIGILL.
Expected behavior should be one of:
compression succeeds;
Headroom detects unsupported CPU features and raises a Python exception;
Headroom falls back to a CPU-compatible implementation;
Headroom documents required CPU instruction sets and wheel compatibility requirements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions