Vector35 / binaryninja-api

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

Hang when navigating around a Windows x86 binary #3220

Closed alexrp closed 2 years ago

alexrp commented 2 years ago

Caught what appears to be a hang:

``` [0x0] binaryninjacore + 0x40b42e [0x1] binaryninjacore!BNShowReportCollection + 0xca3d [0x2] binaryninjacore!BNShowReportCollection + 0x195c3 [0x3] binaryninjacore!BNShowReportCollection + 0x15249 [0x4] binaryninjacore!BNShowReportCollection + 0x19478 [0x5] binaryninjacore!BNShowReportCollection + 0x146ca [0x6] binaryninjacore!BNShowReportCollection + 0x18f57 [0x7] binaryninjacore!BNShowReportCollection + 0x11741 [0x8] binaryninjacore!BNShowReportCollection + 0x18fd3 [0x9] binaryninjacore!BNShowReportCollection + 0x146ca [0xa] binaryninjacore!BNShowReportCollection + 0x18f57 [0xb] binaryninjacore!BNShowReportCollection + 0x115f4 [0xc] binaryninjacore!BNShowReportCollection + 0x18fd3 [0xd] binaryninjacore!BNShowReportCollection + 0x146ca [0xe] binaryninjacore!BNShowReportCollection + 0x18f57 [0xf] binaryninjacore!BNShowReportCollection + 0x11741 [0x10] binaryninjacore!BNShowReportCollection + 0x18fd3 [0x11] binaryninjacore!BNShowReportCollection + 0x146ca [0x12] binaryninjacore!BNShowReportCollection + 0x18f57 [0x13] binaryninjacore!BNShowReportCollection + 0x1aca5 [0x14] binaryninjacore!BNCreateLinearViewMediumLevelILSSAForm + 0x17c4a [0x15] binaryninjacore!BNSetLicense + 0x3211e [0x16] binaryninjacore!BNGetLinearViewCursorLines + 0x32 [0x17] binaryninjaui!CrossReferenceWidget::wheelEvent + 0x13f933 [0x18] binaryninjaui!LinearView::cacheNextLines + 0x46 [0x19] binaryninjaui!LinearView::updateCache + 0x58 [0x1a] binaryninjaui!LinearView::refreshLines + 0xfa [0x1b] binaryninjaui!LinearView::navigateToLine + 0x30a [0x1c] binaryninjaui!LinearView::navigate + 0x72 [0x1d] binaryninjaui!FeatureMap::scrollTo + 0x1bd [0x1e] binaryninjaui!FeatureMap::mouseMoveEvent + 0x44 [0x1f] Qt6Widgets!QWidget::event + 0x126 [0x20] Qt6Widgets!QApplicationPrivate::notify_helper + 0x10d [0x21] Qt6Widgets!QApplication::notify + 0x735 [0x22] Qt6Core!QCoreApplication::notifyInternal2 + 0xc4 [0x23] Qt6Widgets!QApplicationPrivate::sendMouseEvent + 0x3ef [0x24] Qt6Widgets!QWidgetPrivate::shouldDiscardSyncRequest + 0x3e36 [0x25] Qt6Widgets!QWidgetPrivate::shouldDiscardSyncRequest + 0x16c5 [0x26] Qt6Widgets!QApplicationPrivate::notify_helper + 0x10d [0x27] Qt6Widgets!QApplication::notify + 0x187f [0x28] Qt6Core!QCoreApplication::notifyInternal2 + 0xc4 [0x29] Qt6Gui!QGuiApplicationPrivate::processMouseEvent + 0x78f [0x2a] Qt6Gui!QWindowSystemInterface::sendWindowSystemEvents + 0xe8 [0x2b] Qt6Core!QEventDispatcherWin32::processEvents + 0x90 [0x2c] Qt6Gui!QWindowsGuiEventDispatcher::processEvents + 0x19 [0x2d] Qt6Core!QEventLoop::exec + 0x19e [0x2e] Qt6Core!QCoreApplication::exec + 0x15c [0x2f] binaryninja + 0x46883 [0x30] binaryninja + 0x246410 [0x31] KERNEL32!BaseThreadInitThunk + 0x1d [0x32] ntdll!RtlUserThreadStart + 0x28 ```

Originally posted by @alexrp in https://github.com/Vector35/binaryninja-api/issues/3171#issuecomment-1165028833

alexrp commented 2 years ago

@psifertex (responding to https://github.com/Vector35/binaryninja-api/issues/3171#issuecomment-1165561194)

Any chance you enabled graph layout for a very large function that was disabled by default due to the heuristic limits?

Not in this case. I was just navigating around at random through the feature map while in linear view - I almost never use the graph view.

alexrp commented 2 years ago

The binary in question: https://drive.google.com/file/d/1LDkZ151RWOrenkVRf6b61oGlfn1bEVfo

psifertex commented 2 years ago

Is this navigating around in psuedo-c by chance?

alexrp commented 2 years ago

Yes, Pseudo C was the only IL form viewed in that session.

psifertex commented 2 years ago

We believe this to be fixed in builds >=3540. Can you please confirm?

alexrp commented 2 years ago

I am still able to reproduce it.

FWIW, every time it's happened, it's been while I was navigating around randomly using the feature map while reanalysis was happening (due to upgrading BN).

psifertex commented 2 years ago

You shouldn't be able to run 3540 yet which is still going through CI afaik. Can you please double check that you've got the appropriate version?

psifertex commented 2 years ago

But it should be live any second now, I see the upload going now!

alexrp commented 2 years ago

Ah, I assumed it was already uploaded and didn't check the version. Will give it another go.

psifertex commented 2 years ago

Yeah, we usually comment with the build as soon as we see it's completed but it takes a bit to go through the upload portion of the CI and hit the CDN. You can see the current version you're on in the title bar and the bottom of the new tab page.

plafosse commented 2 years ago

Fixed in 3.1.3540

alexrp commented 2 years ago

I can confirm I can't reproduce the hang anymore.