imodel-native icon indicating copy to clipboard operation
imodel-native copied to clipboard

Sentry crash report: EXCEPTION_ACCESS_VIOLATION_WRITE

Open sentry[bot] opened this issue 1 year ago • 3 comments

Sentry Issue: IMODELJSNODEADDON-130

EXCEPTION_ACCESS_VIOLATION_WRITE / 0x24: Fatal Error: EXCEPTION_ACCESS_VIOLATION_WRITE / 0x24
  ?, in RtlpWaitOnCriticalSection
  ?, in RtlpEnterCriticalSectionContended
  ?, in RtlEnterCriticalSection
  File "node_api.cc", line 1383, in napi_call_threadsafe_function
    return reinterpret_cast<v8impl::ThreadSafeFunction*>(func)->Push(data,
  ?
...
(53 additional frame(s) were not displayed)

sentry[bot] avatar May 21 '24 04:05 sentry[bot]

Sentry is still reporting crashes, reopened the issue.

grigasp avatar Sep 09 '24 04:09 grigasp

Call stack in this crash event shows that NativeECPresentationManager destructor is being called without first calling the Terminate method. In addition, based on what happens further, it seems there are open iModels as well.

This suggests that on the TS side the application creates a PresentationManager and doesn't call dispose on it before exiting the process. In cases then the manager is retrieved through Presentation entry point, this could as well happen due to IModelHost.shutdown() not being called on process exit.

I couldn't find a way to reproduce this in itwin-studio-visualizer app. @iTwin/itwin-studio-dev, any ideas how I could get into this situation?

grigasp avatar Sep 11 '24 06:09 grigasp

PresentationManager and doesn't call dispose on it before exiting the process. In cases then the manager is retrieved through Presentation entry point

you are correct, we only call Presentation.initialize

IModelHost.shutdown() not being called on process exit

You can try killing the process abruptly (e.g. via task manager?), though it might be a bit tricky to find the correct one

ImVeryLost avatar Sep 11 '24 07:09 ImVeryLost