Kicad crashes if close/quit while in a PnS drag

Bug #1584489 reported by xzcvczx
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Unassigned

Bug Description

If you are doing Push and Shove (drag) and then close the pcbnew window without finishing the tool then kicad will crash. No data loss

Application: kicad
Version: (2016-05-17 BZR 6813)-product, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.43.0 SecureTransport zlib/1.2.5
Platform: Mac OS X (Darwin 15.5.0 x86_64), 64 bit, Little endian, wxMac
- Build Info -
wxWidgets: 3.0.2 (UTF-8,STL containers,compatible with 2.8)
Boost: 1.60.0
Curl: 7.43.0
KiCad - Compiler: Clang 7.3.0 with C++ ABI 1002
        Settings: USE_WX_GRAPHICS_CONTEXT=ON
                  USE_WX_OVERLAY=ON
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  USE_FP_LIB_TABLE=HARD_CODED_ON
                  BUILD_GITHUB_PLUGIN=ON

Tags: pns

Related branches

Revision history for this message
xzcvczx (xzcvczx) wrote :
Download full text (61.5 KiB)

Process: kicad [40872]
Path: /Applications/kicad.app/Contents/MacOS/kicad
Identifier: org.kicad-pcb.kicad
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: kicad [40872]
User ID: 501

Date/Time: 2016-05-23 04:19:47.579 +1200
OS Version: Mac OS X 10.11.5 (15F34)
Report Version: 11
Anonymous UUID: A586B54A-F6A9-FE60-2086-E52EFAA492F8

Sleep/Wake UUID: C3AD8D1C-A4E6-446D-B666-D9D8582C7A94

Time Awake Since Boot: 300000 seconds
Time Since Wake: 22000 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
Performing @selector(_close:) from sender _NSThemeCloseWidget 0x7fe41e918740

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 _pcbnew.kiface 0x0000000112e13419 PNS_ROUTER::eraseView() + 89
1 _pcbnew.kiface 0x0000000112e14769 PNS_ROUTER::StopRouting() + 217
2 _pcbnew.kiface 0x0000000112e3a2ef ROUTER_TOOL::performDragging() + 1503
3 _pcbnew.kiface 0x0000000112e3976b ROUTER_TOOL::mainLoop(PNS_ROUTER_MODE) + 1099
4 _pcbnew.kiface 0x0000000112e35f4c ROUTER_TOOL::RouteSingleTrace(TOOL_EVENT const&) + 220
5 _pcbnew.kiface 0x0000000112ef5916 COROUTINE<int, TOOL_EVENT const&>::callerStub(long) + 38

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff9af50efa kevent_qos + 10
1 libdispatch.dylib 0x00007fff987a6165 _dispatch_mgr_invoke + 216
2 libdispatch.dylib 0x00007fff987a5dcd _dispatch_mgr_thread + 52

Thread 2:
0 libsystem_kernel.dylib 0x00007fff9af505e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff9bf27578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff9bf25341 start_wqthread + 13

Thread 3:
0 libsystem_kernel.dylib 0x00007fff9af505e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff9bf27578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff9bf25341 start_wqthread + 13

Thread 4:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff9af49f72 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff9af493b3 mach_msg + 55
2 com.apple.CoreFoundation 0x00007fff9a48a1c4 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fff9a48968c __CFRunLoopRun + 1356
4 com.apple.CoreFoundation 0x00007fff9a488ed8 CFRunLoopRunSpecific + 296
5 com.apple.AppKit 0x00007fff8ce91d95 _NSEventThread + 149
6 libsystem_pthread.dylib 0x00007fff9bf2799d _pthread_body + 131
7 libsystem_pthread.dylib 0x00007fff9bf2791a _pthread_start + 168
8 libsystem_pthread.dylib 0x00007fff9bf25351 thread_start + 13

Thread 5:
0 libsystem_kernel.dylib 0x00007fff9af505e2 __workq_kernreturn + 10...

xzcvczx (xzcvczx)
tags: added: pns
Changed in kicad:
status: New → Confirmed
Revision history for this message
Michael Steinberg (decimad) wrote :

Attached is a fix. Considering the overall lifetime management I grade this fix as one that pushes off technical debt.

Revision history for this message
Nick Østergaard (nickoe) wrote :

I can confirm that this patch fixes the segfault, tested on 4.0.3 and 7005 on linux.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1584489] Re: Kicad crashes if close/quit while in a PnS drag

@Nick, does 4.0.2 segfault without this patch?

On 8/4/2016 3:43 PM, Nick Østergaard wrote:
> I can confirm that this patch fixes the segfault, tested on 4.0.3 and
> 7005 on linux.
>

Revision history for this message
Nick Østergaard (nickoe) wrote :

Yes, also 4.0.2 segfaults without, but I only applied the patch to the current 4.0.3 and product.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I'll apply the patch to the stable 4 branch and tag 4.0.3 yet again. At
this rate we may never release 4.0.3. I guess it's good that Michael is
finding all of these context switching bugs. Thanks Michael!

On 8/4/2016 3:57 PM, Nick Østergaard wrote:
> Yes, also 4.0.2 segfaults without, but I only applied the patch to the
> current 4.0.3 and product.
>

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Patch committed in the product branch version r7008. Thanks.

On 8/4/2016 2:13 PM, Michael Steinberg wrote:
> Attached is a fix. Considering the overall lifetime management I grade
> this fix as one that pushes off technical debt.
>
> ** Patch added: "fix-dangling-board-reference-crash.patch"
> https://bugs.launchpad.net/kicad/+bug/1584489/+attachment/4714198/+files/fix-dangling-board-reference-crash.patch
>

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.