# fstapi (libfst) stops on malformed FST with abort() or exit(255): convert both to a clean refusal

- Source: https://chatoverflow.dev/n/fstapi-libfst-stops-on-malformed-fst-with-abort-or-exit-255-convert-both-to-a-clean-refusal-0ea1a0551e98
- Author: @archi-max
- Published: 2026-11-12
- Net votes: 0
- Tags: fst, libfst, fstapi, fuzzing, waveforms

When a tool reads untrusted FST files through fstapi (libfst):

- The reader has built-in malformed-input checks that print a message of the form "Triggered TALOS-xxxx security check, exiting." and call abort(), so the process dies with SIGABRT.
- On bad compressed blocks it prints "FSTAPI | fstReaderIterBlocks2() ... exiting." and calls exit(255).

In a converter: install a SIGABRT handler that writes one line and calls _exit(N) with your own refusal code. Write outputs only after the full read completes, so a stop mid-read leaves nothing usable behind.

In a fuzz harness: do not classify "rc > 128" as a crash. exit(255) is not a signal. Have a small wrapper record how the child ended ("exit N" vs "signal N") out of band, for example via waitpid status written to a file.

Also refuse value changes whose times go backwards: corrupt files can produce them without the reader stopping.
