← Back to team overview

kicad-developers team mailing list archive

Re: hard crash with pcbnew

 

> On May 6, 2015, at 12:55 PM, Andy Peters <devel@xxxxxxxxx> wrote:
> 
> Using Adam’s nightly OS X builds, most recently BZR 5645, pcbnew is repeatedly crashing. It happens on both my 10.9 machine and my 10.10 machine. In OpenGL mode, it seems to get confused about menus, or something. It happens if I right-click to do something. I am not exactly sure what conditions cause it. Attached is the relevant part of the bug report:
> 
> 
> Crashed Thread:        0  Dispatch queue: com.apple.main-thread
> 
> Exception Type:        EXC_CRASH (SIGABRT)
> Exception Codes:       0x0000000000000000, 0x0000000000000000
> 
> Application Specific Information:
> *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Menu to be set as submenu is already a submenu of some menu.'
> abort() called
> terminating with uncaught exception of type NSException

OK, I have come up with a sequence that will kill pcbnew dead every time. It happens with my builds, it happens with the nightlies.

In the openGL canvas, select a footprint. Either left-click on it so it is highlighted, or right-click on it to bring up the context menu. Either select something from the context menu, or click the canvas to clear the selection, doesn’t matter. Then right-click on any footprint or element in the design.

Bang — pcbnew will crash with the “Menu to be set as submenu is already a submenu of some menu.” 

The dispatch queue for the thread that crashes is here:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        0x00007fff918e5866 __pthread_kill + 10
1   libsystem_pthread.dylib       0x00007fff8baca35c pthread_kill + 92
2   libsystem_c.dylib             0x00007fff88eb6b1a abort + 125
3   libc++abi.dylib               0x00007fff92228f31 abort_message + 257
4   libc++abi.dylib               0x00007fff9224e952 default_terminate_handler() + 264
5   libobjc.A.dylib               0x00007fff9200c30d _objc_terminate() + 103
6   libc++abi.dylib               0x00007fff9224c1d1 std::__terminate(void (*)()) + 8
7   libc++abi.dylib               0x00007fff9224bc5b __cxa_throw + 124
8   libobjc.A.dylib               0x00007fff9200bfa1 objc_exception_throw + 343
9   com.apple.CoreFoundation      0x00007fff8f6b7038 +[NSException raise:format:arguments:] + 104
10  com.apple.Foundation          0x00007fff8ef25361 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
11  com.apple.AppKit              0x00007fff95f17912 -[NSMenuItem setSubmenu:] + 203
12  libwx_osx_cocoau_core-3.0.0.dylib 0x000000010d608d5a wxMenuCocoaImpl::InsertOrAppend(wxMenuItem*, unsigned long) + 202
13  libwx_osx_cocoau_core-3.0.0.dylib 0x000000010d560f6a wxMenu::DoInsertOrAppend(wxMenuItem*, unsigned long) + 122
14  libwx_osx_cocoau_core-3.0.0.dylib 0x000000010d5615c9 wxMenu::DoAppend(wxMenuItem*) + 41
15  _pcbnew.kiface                0x00000001137a8f17 CONTEXT_MENU::Add(CONTEXT_MENU*, wxString const&, bool) + 423
16  _pcbnew.kiface                0x00000001131f48b4 CONDITIONAL_MENU::Generate(SELECTION&) + 212
17  _pcbnew.kiface                0x00000001131ea6db SELECTION_TOOL::Main(TOOL_EVENT const&) + 571
18  _pcbnew.kiface                0x000000011379ec46 COROUTINE<int, TOOL_EVENT const&>::callerStub(long) + 38
19  _pcbnew.kiface                0x00000001138da537 make_fcontext + 55

so basically what I think is happening is that the previous context menu hasn’t been “released.” This is where my application-programming fu is very thin.

-a

Follow ups

References