Vector35 / snippets

plugin for storing and using snippets of useful Binja script
MIT License
22 stars 9 forks source link

Crash when running snippets with errors from snippet editor #7

Open yrp604 opened 4 years ago

yrp604 commented 4 years ago

2144-dev Personal, Windows 10 python 3.8

So apologies in advance, this involves multiple bits of broken python, but I promise I hit this through general use then minimized. Im not just going around putting broken code in things to create bug reports :\

Repro: 1) Open a binaryview, open the snippet editor 2) Create a snippet with a syntax error 3) Run it from the snippet editor itself: image 4) Close the snippet editor and go to the python console 5) Enter any python code that will error, I used for _ in xxx again 6) Binja should immediately crash with a memory safety issue. It's usually a fast fail, but I've also seen a read access violation. It's always worked in one shot.

0:000> kn
 # Child-SP          RetAddr           Call Site
00 000000cd`c55fc120 00007ff8`1d4a695a ucrtbase!abort+0x4e
01 000000cd`c55fc150 00007fff`dd5f2170 VCRUNTIME140!_purecall+0x1a [d:\agent\_work\8\s\src\vctools\crt\vcruntime\src\misc\purevirt.cpp @ 29] 
02 000000cd`c55fc180 00007fff`dd641dc9 Qt5Core!QAbstractEventDispatcher::filterNativeEvent+0x80
03 000000cd`c55fc1e0 00007ff8`0a2653e9 Qt5Core!QEventDispatcherWin32::processEvents+0x589
04 000000cd`c55ff340 00007fff`dd5f384b qwindows!qt_plugin_query_metadata+0x1ea9
05 000000cd`c55ff370 00007fff`dd5f687e Qt5Core!QEventLoop::exec+0x1eb
06 000000cd`c55ff3f0 00007ff6`1d5275e9 Qt5Core!QCoreApplication::exec+0x15e
07 000000cd`c55ff460 00007ff6`1d5af397 binaryninja+0x175e9
08 000000cd`c55ffc10 00007ff6`1d5ae672 binaryninja+0x9f397
09 000000cd`c55ffca0 00007ff8`26d17bd4 binaryninja+0x9e672
0a 000000cd`c55ffce0 00007ff8`2884ce51 KERNEL32!BaseThreadInitThunk+0x14
0b 000000cd`c55ffd10 00000000`00000000 ntdll!RtlUserThreadStart+0x21
psifertex commented 4 years ago

I can repro it, but only on windows interestingly enough. Thanks for the repro.

psifertex commented 4 years ago

Reminder to myself: double check in ASAN linux build.

yrp604 commented 4 years ago

fyi theres also x64 asan in preview builds of vs2019 now

psifertex commented 3 years ago

Fixed through my favorite advanced development technique of "wait a while".