rustformers / llm

[Unmaintained, see README] An ecosystem of Rust libraries for working with large language models
https://docs.rs/llm/latest/llm/
Apache License 2.0
6.07k stars 355 forks source link

SIGTRAP triggered on MacOS #422

Open jafioti opened 1 year ago

jafioti commented 1 year ago

I'm trying to summarize some text, and I keep getting the following crash error message when I run inference:

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x0000000427955d04

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [27651]

Notably this only happens after the program has been running a while, doing other things. When the same inference is ran right at the beginning of main() it works fine. I initially thought. it was running out of memory, but I can't see any spike in memory usage occuring.

It's also not a panic, but a crash, meaning the macos "quit unexpectedly" message pops up and no panic backtrace is available.

Has this happened to anyone else?

jafioti commented 1 year ago

Quick update, we are using pdfium_render in our project, and this crash only happens when trying to run inference after we run pdfium to extract images from pdfs.

jafioti commented 1 year ago

More specifically, if you run this line before llm inference, it will crash:

let pdfium = Pdfium::new(Pdfium::bind_to_library(
        Pdfium::pdfium_platform_library_name_at_path("/path/to/pdfium/"),
    )?);