jongough / ocpn_draw_pi

OpenCPN general drawing plug in
7 stars 17 forks source link

Crash when changing UI language #554

Open bcn2 opened 3 weeks ago

bcn2 commented 3 weeks ago

With OCPN 5.9.1 and Draw 1.8.50, crash when changing UI language

reproduced under macOS 14.5 and W11

The macOS dump:

Details

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000794 Exception Codes: 0x0000000000000001, 0x0000000000000794 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [29713] VM Region Info: 0x794 is not in any region. Bytes before following region: 4311562348 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 100fd4000-101858000 [ 8720K] r-x/r-x SM=COW /Applications/OpenCPN.app/Contents/MacOS/OpenCPN Kernel Triage: VM - (arg = 0x0) Fault was interrupted VM - (arg = 0x0) Fault was interrupted Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libocpn_draw_pi.dylib 0x1621f0228 ODicons::initialize_images() + 32 1 libocpn_draw_pi.dylib 0x1621adad4 ocpn_draw_pi::Init() + 1100 2 OpenCPN 0x1014ae590 PluginLoader::UpdatePlugIns() + 844 3 OpenCPN 0x1011ab764 ApplyLocale() + 816 4 OpenCPN 0x1011a1118 MyFrame::DoOptionsDialog() + 3544 5 OpenCPN 0x10119d598 MyFrame::DoSettings() + 48 6 libwx_baseu-3.2.0.2.3.dylib 0x102a0577c wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 376 7 libwx_baseu-3.2.0.2.3.dylib 0x102a0646c wxEvtHandler::ProcessEvent(wxEvent&) + 260 8 libwx_baseu-3.2.0.2.3.dylib 0x102a0659c wxEvtHandler::ProcessEventLocally(wxEvent&) + 212 9 libwx_baseu-3.2.0.2.3.dylib 0x102a063a0 wxEvtHandler::ProcessEvent(wxEvent&) + 56 10 libwx_baseu-3.2.0.2.3.dylib 0x102a06188 wxEvtHandler::ProcessPendingEvents() + 240 11 libwx_baseu-3.2.0.2.3.dylib 0x102932c18 wxAppConsoleBase::ProcessPendingEvents() + 116 12 libwx_baseu-3.2.0.2.3.dylib 0x1029eaed0 wxCFEventLoop::OSXCommonModeObserverCallBack(__CFRunLoopObserver*, int, void*) + 84 13 CoreFoundation 0x19051d87c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 14 CoreFoundation 0x19051d768 __CFRunLoopDoObservers + 536 15 CoreFoundation 0x19051cd94 __CFRunLoopRun + 776 16 CoreFoundation 0x19051c434 CFRunLoopRunSpecific + 608 17 HIToolbox 0x19acc019c RunCurrentEventLoopInMode + 292 18 HIToolbox 0x19acbfe2c ReceiveNextEventCommon + 220 19 HIToolbox 0x19acbfd30 _BlockUntilNextEventMatchingListInModeWithFilter + 76 20 AppKit 0x193d7bd68 _DPSNextEvent + 660 21 AppKit 0x194571808 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 700 22 AppKit 0x193d6f09c -[NSApplication run] + 476 23 libwx_osx_cocoau_core-3.2.0.2.3.dylib 0x103406758 wxGUIEventLoop::OSXDoRun() + 140 24 libwx_baseu-3.2.0.2.3.dylib 0x1029eb54c wxCFEventLoop::DoRun() + 40 25 libwx_baseu-3.2.0.2.3.dylib 0x102959b70 wxEventLoopBase::Run() + 120 26 libwx_baseu-3.2.0.2.3.dylib 0x1029324bc wxAppConsoleBase::MainLoop() + 120 27 libwx_baseu-3.2.0.2.3.dylib 0x102984d34 wxEntry(int&, wchar_t**) + 104 28 OpenCPN 0x101175d88 main + 24 29 dyld 0x1900b60e0 start + 2360

jongough commented 3 weeks ago

Try disabling OD, switch language, then reenable OD.

Which languages are you changing from and to? Can you run this on a debug environment and provide a back trace to show where the error is?

I may not be able to investigate for a while as cruising.

jongough commented 3 weeks ago

I have recreated the issue on Ubuntu and it happens when an Init is done after the language change. As a workaround disable OD before doing the language change then re-enable it. It 'May" require a restart of OCPN before enabling OD.

When I tried it I did not get any change in the language files in OCPN, OD or Squiddio. Not sure what the cause or that is, maybe my install or maybe the language files are missing or OCPN is not initialising the language correctly.

bcn2 commented 3 weeks ago

Alternating between English, Spanish, German. With OD disabled, no issue. The macOS backtrace you find above under "details". Happy sailing!