Crash when invoking footprint wizard

Bug #1823608 reported by Paul Kenyon on 2019-04-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Critical
Seth Hillbrand

Bug Description

In KiCad, Footprint Editor (opened from main project view), when clicking on the "New footprint using footprint wizard" button, all of KiCad crashes. A new window opens for about one second before this crash occurs.

This happens with Accelerated, Fallback, and Legacy Toolsets.

I have barely worked with footprints at all. Prior to trying the wizard, I did add a Legacy footprint that I got from SnapEDA. The legacy footprint seems to work fine and shows up like normal in pcbnew.

Running on macOS 10.13.6; this kicad build is the latest stable available today.

Application: kicad
Version: (5.1.0-0), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Platform: Mac OS X (Darwin 17.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.51.0
    Compiler: Clang 8.0.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Jon Evans (craftyjon) on 2019-04-08
Changed in kicad:
importance: Undecided → Critical
Paul Kenyon (rixoff) wrote :

Here is the legacy footprint that I added. I don't think there have been any other changes to footprints on my installation.

Seth Hillbrand (sethh) wrote :

@Jon- can you recreate this? I cannot with my system.

@Paul- Can you please attach the crash report. You can find this in the Console application, clicking on "User Reports" on the left.

Application: kicad
Version: (5.1.0-0), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.4 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.2.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Paul Kenyon (rixoff) wrote :

I looked in Console -> User Reports, and there are no KiCad logs.

Hoping to get some sort of backtrace, I ran kicad from the command line. I got a little bit of output when launching Footprint Editor, but nothing when invoking the wizard/crashing.

paul$ /Applications/KiCad/kicad.app/Contents/MacOS/kicad
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
/Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/_core.py:16633: UserWarning: wxPython/wxWidgets release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")

Seth Hillbrand (sethh) wrote :

@Paul- I see the same messages in the console, so I don't think they are related.

What does the crash look like? Do you get a message from the system like "Kicad has exited unexpectedly, Ignore, Relauch, Report"?

Wayne Stambaugh (stambaughw) wrote :

Adam mentioned something the other day about system python being run instead of the python packaged with kicad when launching scripts on macos. Could this cause this issue?

Seth Hillbrand (sethh) wrote :

Good call. @Paul, if you have an external Python installed (MacPorts, homebrew, etc), can you uninstall it and try again?

Paul Kenyon (rixoff) wrote :

@Seth, I did not get any message on the crash, and no "Ignore, Relaunch, Report" dialog. The crash is like... I click the button, a small window (way too small to show much more than a few buttons or a few lines of text) pops up, then that and all other KiCad windows disappear. Nothing more than that.

The window that pops up says Footprint Editor [No Wizard Selected]. I was able to grab a screenshot of this. It looks like the titlebar text disappeared... maybe this happens as the program exits - it was really hard just to get the screenshot fast enough, took several tries.

Great idea on the system python - I disabled my macports python (with port select --set python none), but unfortunately the problem persists.

Seth Hillbrand (sethh) wrote :

OK. That is odd. It would appear that the python is actually calling an 'exit()' then that is being caught by KiCad. Can you do this with your console window open and see which messages pop up when it happens. I know the console can be very noisy, so it sometimes helps to hit 'Clear' before performing the action. Then you know the correct sequence is somewhere near the top.

Also, can you open a terminal and type 'which python'?

Paul Kenyon (rixoff) wrote :

The first screenshot shows two invocations/crashes of kicad. The first invocation is just running it, eventually going to the wizard and it crashing (the two yellow-dot entries marked <private>.) The second invocation, I started from the command line.

You can see the python path and the output of running from the command line here:

Pauls-MBP-4:Downloads paul$ which python
/usr/bin/python
Pauls-MBP-4:Downloads paul$ /Applications/KiCad/kicad.app
Pauls-MBP-4:Downloads paul$ /Applications/KiCad/kicad.app/Contents/MacOS/kicad
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
/Applications/KiCad/kicad.app/Contents/Frameworks/python/site-packages/wx-3.0-osx_cocoa/wx/_core.py:16633: UserWarning: wxPython/wxWidgets release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")
Pauls-MBP-4:Downloads paul$

I did try running it several more times to see if there was any common messaging around the time of the crash. In this second screenshot, there are a few messages around it that seem common. The EmojiFunction type message seems to come up every time, and the trustd seems common but I'm not sure if it's every time.

Paul Kenyon (rixoff) wrote :

(Not realizing that only one attachment could be included, the one attached to the previous message was the "second screenshot." Here is the "first screenshot.")

Seth Hillbrand (sethh) wrote :

Thanks! Not much helpful there, I'm afraid. Can you test one of the nightly builds from:

https://kicad-downloads.s3.cern.ch/index.html?prefix=osx/nightly/

These have debugging enabled and may give more information.

Paul Kenyon (rixoff) wrote :
Download full text (7.5 KiB)

I will try the nightly later today when I get a chance. Can I install it side-by-side with the release version, or should I just plan on replacing it, and perhaps switching back to stable later?

I figured out a few more things... one, the EmojiFunctionRowIM_Extension message is consistently showing up at each crash. Here's the text in those messages:

IMKTextInputFunctionRowItemServiceViewController -dealloc *invoked* on NSViewService (<IMKTextInputFunctionRowItemServiceViewController: 0x6000000cd200>)
IMKTextInputFunctionRowItemServiceViewController -dealloc *invoked* on NSViewService (<IMKTextInputFunctionRowItemServiceViewController: 0x60c0000cca90>)
IMKTextInputFunctionRowItemServiceViewController -dealloc *invoked* on NSViewService (<IMKTextInputFunctionRowItemServiceViewController: 0x6040000cb0c0>)
IMKTextInputFunctionRowItemServiceViewController -dealloc *invoked* on NSViewService (<IMKTextInputFunctionRowItemServiceViewController: 0x6080000cdf20>)

Next, I turned on private data logging in console (sudo log config --mode "private_data:on") and here's what is logged on the two kicad log entries finally a traceback!

-[NSApplication runModalSession:] may not be invoked inside of transaction begin/commit pair, or inside of transaction commit (usually this means it was invoked inside of a view's -drawRect: method.)

(
 0 CoreFoundation 0x00007fff4339e68b __exceptionPreprocess + 171
 1 libobjc.A.dylib 0x00007fff6a62fc76 objc_exception_throw + 48
 2 CoreFoundation 0x00007fff434301ad +[NSException raise:format:] + 205
 3 AppKit 0x00007fff41178431 _NSRunModal + 484
 4 AppKit 0x00007fff40ccaa9b -[NSApplication runModalSession:] + 253
 5 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010be83930 _ZN14wxGUIEventLoop17DoDispatchTimeoutEm + 64
 6 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bd67de6 _ZN13wxCFEventLoop15DispatchTimeoutEm + 38
 7 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bd67f55 _ZN13wxCFEventLoop8OSXDoRunEv + 165
 8 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010be83fa1 _ZN16wxModalEventLoop8OSXDoRunEv + 193
 9 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bd68074 _ZN13wxCFEventLoop5DoRunEv + 52
 10 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bc91dc5 _ZN15wxEventLoopBase3RunEv + 165
 11 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bdc9f56 _ZN8wxDialog9ShowModalEv + 102
 12 _pcbnew.kiface 0x0000000116a9b7fa _ZN22FOOTPRINT_WIZARD_FRAME21SelectFootprintWizardEv + 58
 13 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bd99b2f _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler + 239
 14 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bd9affd _ZN12wxEvtHandler12ProcessEventER7wxEvent + 285
 15 _pcbnew.kiface 0x00000001171d7e65 _ZN14EDA_BASE_FRAME12ProcessEventER7wxEvent + 85
 16 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bd9b0f4 _ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent + 164
 17 libwx_osx_cocoau-3.0.0.4.0.dylib 0x000000010bd9afa0 _ZN12wxEvtHandler12ProcessEventER7wxEvent + 192
 18 libwx_osx_cocoau-3.0.0.4.0.dylib ...

Read more...

Paul Kenyon (rixoff) wrote :

(Here's the traceback as an attachment, to allow easier viewing with original formatting

Seth Hillbrand (sethh) wrote :

Fantastic! Thank you. I didn't know about that setting, so this is doubly-helpful. :)

Don't install the nightly now. It has additional issues that we don't want to mix up with this one. Now that we have the stack trace, we can look into it more thoroughly.

KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 7cf394e34fc97cc81a8dacb2077d7ae558f666de
https://git.launchpad.net/kicad/patch/?id=7cf394e34fc97cc81a8dacb2077d7ae558f666de

Changed in kicad:
status: New → Fix Committed
assignee: nobody → Seth Hillbrand (sethh)
Changed in kicad:
milestone: none → 6.0.0-rc1
Jens C Brynildsen (jenschr) wrote :

According to Wayne's talk at KiCon, v6 is still for away. This issue affects all users on the Mac platform. That means that as a lecturer, only half my students will be able to use this part of KiCad unless we all downgrade to version 4. Is there really no way to get this into 5.x? Must it be postponed to 6 given that it affects all users of a platform with critical severity?

Seth Hillbrand (sethh) wrote :

This has already been fixed in 5.1.2

Changed in kicad:
milestone: 6.0.0-rc1 → none
status: Fix Committed → Fix Released
Wayne Stambaugh (stambaughw) wrote :

This was released in 5.1.1. Apparently the milestone never got updated. If you are not using the latest version 5.1.2, you should upgrade immediately. If you are using the latest version and are still having this issue, please file a new bug report.

Wayne Stambaugh (stambaughw) wrote :

Of course launchpad will not let me change the milestone to 5.1.1 because it's already released. I changed the status to "Fix Released" which is better but the milestone is wrong.

KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 7cf394e34fc97cc81a8dacb2077d7ae558f666de
https://git.launchpad.net/kicad/patch/?id=7cf394e34fc97cc81a8dacb2077d7ae558f666de

Changed in kicad:
status: Fix Released → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers