Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
903 stars 204 forks source link

Multiple (105) segfaults from processing a large number of binaries from Debian #3031

Closed moyix closed 2 years ago

moyix commented 2 years ago

Version and Platform (required):

Bug Description:

Recently I used Binary Ninja to collect IL and Pseudo-C for ~5 million functions across 80K binaries from Debian. This exposed a number of segfaults. I'm reporting them in bulk here because unfortunately I don't have time to go through and try to figure out which ones are unique.

Note that although the binaries have DWARF info, I didn't try to use the DWARF plugin with them; this is a clean install of BN.

Steps To Reproduce:

  1. Grab the binaries here: https://moyix.net/~moyix/bn_crash_bins.tar.gz (NB: they're around 6GB unzipped, sorry about that!)
  2. Get the attached repro script (bnsingle.py.gz), which attempts to get the various ILs for a specified function in a binary
  3. To repro an individual crash, use one of the commands in the attached bnrepro.txt

Expected Behavior:

Binary Ninja should not segfault ;)

psifertex commented 2 years ago

Thanks! I'm converting that list into a checklist so we can mark them off here as we believe they're resolved so you can test and confirm. I'm going through them again after a few recent optimization and bug fixes to see what's left. I suspect that a few of the lager ones are likely OOMs and am curious how they do with the new memory improvements.

FWIW, my repro step was to simply add an extra print at the end and if I saw that print assume there was no crash. Let me know if you forsee any problems with that

psifertex commented 2 years ago

I mentioned it elsewhere but for anyone else tracking it, that only one left unchecked is likely an invalid function anyway? The offset aligns with a mangled string name it looks like.

psifertex commented 2 years ago

Not sure if you've had a chance to re-run this with recent dev builds, curious if you've been able to reproduce what we're seeing as all these being resolved.