PCBNew crash on move hotkey while clicking

Bug #1834111 reported by Dan Green
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Jeff Young

Bug Description

Here's how I can reproduce this on OSX. It does it on every project I tried, for example try the flat_hierarchy demo board.

1. Click on any text item to select it. (If it's a footprint value or reference, then the blue line to the center of the footprint will be visible).

2. Click on it again as if you were about to drag it to move it, but do not move the mouse. Just click on it and keep holding the mouse button down. Make sure you click off-center.

3. While still holding the mouse button down and making sure you didn't move the mouse, press the 'm' key (Move hotkey). If you accidentally move the mouse, the cursor position will jump to the text item center (or vice-versa) and the bug won't appear.

4. The text item will jump to the cursor (or vice-versa?) and immediately after that PCBNew will crash. In the latest nightly, it will pop up the following dialog box, and then crash or quit no matter if you click "Cancel", "No", or "Yes"

```
/vagrant/build/kicad/src/kicad/common/tool/tool_manager.cpp(513): assert "!st->pendingWait" failed in ScheduleWait().
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
```

Application: kicad
Version: (5.1.2-1)-1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.6.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.69.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

Also happens in today's nightly: kicad-nightly-20190624-121715-8a22963e9-10_14.dmg

Application: Pcbnew
Version: (5.1.0-1094-g8a22963e9), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.6.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    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

Tags: hotkeys pcbnew
tags: added: hotkeys pcbnew
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Confirmed in both 5.1.2 and master.

Changed in kicad:
importance: Undecided → Critical
milestone: none → 5.1.3
status: New → Triaged
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :
Revision history for this message
Seth Hillbrand (sethh) wrote :

Unfortunately, this doesn't affect Linux.

If you click "Cancel" does the program crash or continue?

Application: Pcbnew
Version: (5.1.0-1120-g1cc05f19b), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 8.3.0 with C++ ABI 1013

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

Revision history for this message
Seth Hillbrand (sethh) wrote :

Wait, I just found where you mentioned it crashes no matter. Please disregard the last question.

Revision history for this message
Seth Hillbrand (sethh) wrote :

@Michael-

Can you attach the crash log from when you press "Cancel"?

Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

The program crashes when clicking cancel. Crash report attached.

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

I cannot duplicate this on windows either so it appears that it's a macos only bug. Would one of our macos devs please take a look at this. It's the last blocker bug for the 5.1.3 release.

Application: Pcbnew
Version: (5.1.0-1151-g71aafb6eb), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.1 OpenSSL/1.1.1c (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.1
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.70.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.65.1
    Compiler: GCC 9.1.0 with C++ ABI 1013

Build settings:
    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

Revision history for this message
Jeff Young (jeyjey) wrote :

Our re-entrancy protection is based on the m_dragging flag, but if you haven't moved yet then the flag won't be set.

We've solved similar issues in 6.0 eeschema by pre-loading the event queue with a refreshPreview event, so I applied that here.

Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: Triaged → In Progress
Jeff Young (jeyjey)
Changed in kicad:
status: In Progress → 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.