GerbView resizing window causes crash

Bug #1590381 reported by David Pearce
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Medium
Unassigned

Bug Description

Ubuntu 16.04 64 bit, KiCad 4.1.0-alpha

For the last few days daily releases I have found that resizing the GerbView window with the mouse causes an immediate crash, closing GerbView
Going to fullscreen works.
No layers are loaded

Application: gerbview
Version: 4.1.0-alpha+201606071201+6887~45~ubuntu16.04.1-product, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-22-generic x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.58.0
Curl: 7.47.0
KiCad - Compiler: GCC 5.3.1 with C++ ABI 1009
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  USE_FP_LIB_TABLE=HARD_CODED_ON
                  BUILD_GITHUB_PLUGIN=ON

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :
Download full text (4.9 KiB)

I have to resize it back and forth a few times to trigger this, it's not immediate - but resizing gerbview can indeed cause a crash. Backtrace attached.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6769130 in typeinfo for wxLog () from /usr/lib/libwx_baseu-3.0.so.0
(gdb) bt
#0 0x00007ffff6769130 in typeinfo for wxLog () from /usr/lib/libwx_baseu-3.0.so.0
#1 0x00007ffff6e1da19 in wxBoxSizer::RecalcSizes() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#2 0x00007ffff6e1b6bf in wxSizer::Layout() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#3 0x00007ffff6e1b555 in wxSizerItem::SetDimension(wxPoint const&, wxSize const&) () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#4 0x00007ffff6e1da19 in wxBoxSizer::RecalcSizes() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#5 0x00007ffff6e1b6bf in wxSizer::Layout() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#6 0x00007ffff6e1b555 in wxSizerItem::SetDimension(wxPoint const&, wxSize const&) () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#7 0x00007ffff6e1da19 in wxBoxSizer::RecalcSizes() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#8 0x00007ffff6e1b6bf in wxSizer::Layout() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#9 0x00007ffff6e5d6dc in wxWindowBase::Layout() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#10 0x00007ffff79617de in wxAuiManager::DoFrameLayout() () from /usr/lib/libwx_gtk2u_aui-3.0.so.0
#11 0x00007ffff7963788 in wxAuiManager::OnSize(wxSizeEvent&) () from /usr/lib/libwx_gtk2u_aui-3.0.so.0
#12 0x00007ffff634a43e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib/libwx_baseu-3.0.so.0
#13 0x00007ffff64d0a77 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#14 0x00007ffff64d0b6b in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/libwx_baseu-3.0.so.0
#15 0x00007ffff64d0f28 in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#16 0x00007ffff64d0fb3 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#17 0x00007ffff64d1015 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#18 0x00007ffff64d0d77 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#19 0x00007ffff6c645cf in ?? () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#20 0x00007ffff2d3dfa5 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#21 0x00007ffff2d4ffb2 in ?? () from /usr/lib/libgobject-2.0.so.0
#22 0x00007ffff2d58c1c in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#23 0x00007ffff2d58fff in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#24 0x00007ffff34832e5 in gtk_widget_size_allocate () from /usr/lib/libgtk-x11-2.0.so.0
#25 0x00007ffff32b87db in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#26 0x00007ffff2d3deff in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#27 0x00007ffff2d4f98b in ?? () from /usr/lib/libgobject-2.0.so.0
#28 0x00007ffff2d58c1c in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#29 0x00007ffff2d58fff in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#30 0x00007ffff34832e5 in gtk_widget_size_allocate (...

Read more...

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Application: gerbview
Version: (2016-06-08 BZR 6904, Git b78fe5d)-product, debug build
Libraries: wxWidgets 3.0.2
           libcurl/7.49.1 OpenSSL/1.0.2h zlib/1.2.8 libidn/1.32 libssh2/1.7.0
Platform: Linux 4.5.4-1-ARCH x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.61.0
Curl: 7.49.1
KiCad - Compiler: Clang 3.8.0 with C++ ABI 1002
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=OFF
                  KICAD_SCRIPTING_MODULES=OFF
                  KICAD_SCRIPTING_WXPYTHON=OFF
                  USE_FP_LIB_TABLE=HARD_CODED_ON
                  BUILD_GITHUB_PLUGIN=ON

Changed in kicad:
status: New → Confirmed
importance: Undecided → High
tags: added: gerbview segfault
Changed in kicad:
importance: High → Medium
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

This appears to be either a linux or window manager dependent issue. I cannot get gerbview to crash on 32 or 64 bit builds on windows.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

I cannot reproduce the crash on Kubuntu 14.04 LTS.
Unfortunately, the back trace does not show anything in Kicad code, so fixing this crash is very difficult.

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :
Download full text (9.8 KiB)

Got a different sort of failure on a different build, maybe the additional information will be useful.

Couldn't get the assert message as I can't get it to do this a second time, but it's probably pretty easy to find in the wx sources based on the backtrace.

The crash occurs after a bunch of error messages like this in the terminal:

(gerbview:23508): Gdk-CRITICAL **: IA__gdk_drawable_get_size: assertion 'GDK_IS_DRAWABLE (drawable)' failed

(gerbview:23508): Gdk-CRITICAL **: _gdk_pixmap_new: assertion '(width != 0) && (height != 0)' failed

It doesn't happen with any of the other applications.

Perhaps a bisect through some of the recent gerbview-affecting commits would help?

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff39fbdc9 in raise () from /usr/lib/libpthread.so.0
(gdb) bt
#0 0x00007ffff39fbdc9 in raise () from /usr/lib/libpthread.so.0
#1 0x00007ffff6351bc5 in ?? () from /usr/lib/libwx_baseu-3.0.so.0
#2 0x00007ffff634c27a in wxOnAssert(char const*, int, char const*, char const*, char const*) () from /usr/lib/libwx_baseu-3.0.so.0
#3 0x00007ffff6e1df4a in wxBoxSizer::RecalcSizes() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#4 0x00007ffff6e1b6bf in wxSizer::Layout() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#5 0x00007ffff6e5d6dc in wxWindowBase::Layout() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#6 0x00007ffff79617de in wxAuiManager::DoFrameLayout() () from /usr/lib/libwx_gtk2u_aui-3.0.so.0
#7 0x00007ffff7963788 in wxAuiManager::OnSize(wxSizeEvent&) () from /usr/lib/libwx_gtk2u_aui-3.0.so.0
#8 0x00007ffff634a43e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib/libwx_baseu-3.0.so.0
#9 0x00007ffff64d0a77 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#10 0x00007ffff64d0b6b in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/libwx_baseu-3.0.so.0
#11 0x00007ffff64d0f28 in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#12 0x00007ffff64d0fb3 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#13 0x00007ffff64d1015 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#14 0x00007ffff64d0d77 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#15 0x00007ffff6c645cf in ?? () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#16 0x00007ffff2b0feff in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#17 0x00007ffff2b21fb2 in ?? () from /usr/lib/libgobject-2.0.so.0
#18 0x00007ffff2b2ac1c in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#19 0x00007ffff2b2afff in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#20 0x00007ffff32552e5 in gtk_widget_size_allocate () from /usr/lib/libgtk-x11-2.0.so.0
#21 0x00007ffff308a7db in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#22 0x00007ffff2b0feff in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#23 0x00007ffff2b2198b in ?? () from /usr/lib/libgobject-2.0.so.0
#24 0x00007ffff2b2ac1c in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#25 0x00007ffff2b2afff in g_signal_emit () fr...

Read more...

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

(I should add that the above wxAssert immediately precedes the original segfault if you click through it)

Revision history for this message
jean-pierre charras (jp-charras) wrote :

I do not have any assert message, and no gdk message on Kubuntu.

But your last backtrace is very different, you do not have a crash (i.e. a SIGSEGV): you have a SIGTRAP generated by the wxAssert dialog.

What is the message shown by the assert?

(the backtrace does not show any kicad code: all code is inside the wxWidgets and gtk/gdk libs)

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Yes, I said all those things. The second backtrace is indeed a SIGTRAP, with a different call stack. If I click Continue on the message, it continues and then immediately produces the same SIGSEGV backtrace as before.

I don't have the message, again. I only managed to get the assert to happen once, and didn't take the message down. I can't trigger it again to see. Go check the wx source for an assert message in that area. It was similar to the gtk debug messages being printed in the terminal, something about invalid size.

I realize the traces are different, but the assert probably is a valid warning about problems in that area that may be what are causing the segfault later, so it's probably worth poking around at a bit.

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Managed to trip the assertion again. Actually it's a bit weird, it seems to have missing information:

./include/wx/vector.h(404): assert "idx < m_size" failed in at ().

I'm preparing a debug build of wx now to see if I get more information with wx debug symbols available.

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :
Download full text (10.9 KiB)

Debug build backtrace is a bit more informative.

(gerbview:5566): Gdk-CRITICAL **: IA__gdk_drawable_get_size: assertion 'GDK_IS_DRAWABLE (drawable)' failed
./include/wx/vector.h(404): assert "idx < m_size" failed in at().

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff3a29dc9 in raise () from /usr/lib/libpthread.so.0
(gdb) bt
#0 0x00007ffff3a29dc9 in raise () from /usr/lib/libpthread.so.0
#1 0x00007ffff6372dda in wxTrap () at ./src/common/appbase.cpp:1047
#2 0x00007ffff6379ba5 in wxDefaultAssertHandler (file=..., line=line@entry=404, func=..., cond=..., msg=...) at ./src/common/appbase.cpp:1074
#3 0x00007ffff63745ba in wxOnAssert (file=file@entry=0x7ffff6f10bc1 "./include/wx/vector.h", line=line@entry=404, func=func@entry=0x7ffff6f38c51 <wxVector<int>::at(unsigned long)::__FUNCTION__> "at",
    cond=cond@entry=0x7ffff6f2948d "idx < m_size", msg=msg@entry=0x0) at ./src/common/appbase.cpp:1166
#4 0x00007ffff6e32d12 in wxVector<int>::at (this=<synthetic pointer>, this=<synthetic pointer>, idx=1) at ./include/wx/vector.h:404
#5 wxVector<int>::operator[] (idx=1, this=<synthetic pointer>) at ./include/wx/vector.h:409
#6 wxBoxSizer::RecalcSizes (this=0x216ca60) at ./src/common/sizer.cpp:2341
#7 0x00007ffff6e3043f in wxSizer::Layout (this=0x216ca60) at ./src/common/sizer.cpp:980
#8 0x00007ffff6e7235c in wxSizer::SetDimension (size=..., pos=..., this=<optimized out>) at ./include/wx/sizer.h:678
#9 wxSizer::SetDimension (height=315, width=<optimized out>, y=0, x=0, this=<optimized out>) at ./include/wx/sizer.h:685
#10 wxWindowBase::Layout (this=<optimized out>) at ./src/common/wincmn.cpp:2509
#11 0x00007ffff79624fe in wxAuiManager::DoFrameLayout (this=this@entry=0x1c01bc8) at ./src/aui/framemanager.cpp:2709
#12 0x00007ffff79644d8 in wxAuiManager::OnSize (this=0x1c01bc8, event=...) at ./src/aui/framemanager.cpp:3957
#13 0x00007ffff637279e in wxAppConsoleBase::CallEventHandler (this=0x71dc60, handler=0x1c01bc8, functor=..., event=...) at ./src/common/appbase.cpp:623
#14 0x00007ffff64f5b85 in wxEvtHandler::ProcessEventIfMatchesId (entry=..., handler=<optimized out>, event=...) at ./src/common/event.cpp:1392
#15 0x00007ffff64f5c7b in wxEventHashTable::HandleEvent (this=<optimized out>, event=..., self=self@entry=0x1c01bc8) at ./src/common/event.cpp:998
#16 0x00007ffff64f602b in wxEvtHandler::TryHereOnly (this=0x1c01bc8, event=...) at ./src/common/event.cpp:1589
#17 0x00007ffff64f60b3 in wxEvtHandler::TryBeforeAndHere (event=..., this=0x1c01bc8) at ./include/wx/event.h:3671
#18 wxEvtHandler::ProcessEventLocally (this=0x1c01bc8, event=...) at ./src/common/event.cpp:1522
#19 0x00007ffff64f6115 in wxEvtHandler::ProcessEvent (this=0x1c01bc8, event=...) at ./src/common/event.cpp:1495
#20 0x00007ffff64f5e87 in wxEvtHandler::SafelyProcessEvent (this=<optimized out>, event=...) at ./src/common/event.cpp:1613
#21 0x00007ffff6e7040c in wxWindowBase::HandleWindowEvent (this=this@entry=0x1c01760, event=...) at ./src/common/wincmn.cpp:1525
#22 0x00007ffff6c7bf0f in size_allocate (alloc=<optimized out>, win=0x1c01760) at ./src/gtk/toplevel.cpp:283
#23 0x00007ffff2b3deff in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#24 0x00007f...

Revision history for this message
David Pearce (halzia) wrote :

I can no longer reproduce this bug.
version:
Application: gerbview
Version: 4.1.0-alpha+201607120317+6975~46~ubuntu14.04.1-product, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Platform: Linux 3.13.0-91-generic x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.54.0
Curl: 7.35.0
KiCad - Compiler: GCC 4.8.4 with C++ ABI 1002
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  USE_FP_LIB_TABLE=HARD_CODED_ON
                  BUILD_GITHUB_PLUGIN=ON

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.