wxpython incompability in Arch Linux

Bug #1747677 reported by ildus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Maciej Suminski

Bug Description

Application: kicad
Version: (2018-02-06 revision e0f7958db)-master, release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.29.0
Platform: Linux 4.14.15-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.66.0
    Curl: 7.58.0
    Compiler: GCC 7.2.1 with C++ ABI 1011

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

If i open 'Browse footprints' in Symbol Properties, then the application freezes. Same happens if I open 'Assign footprint'.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Do you use Github plugin? Perhaps you are waiting for KiCad to download footprints from the Internet.

Revision history for this message
ildus (k-dus) wrote :

No, i downloaded footprints earlier and I've been able to select the footprint for symbol. But that's it.

Revision history for this message
ildus (k-dus) wrote :

https://umarta.com/scr/pjjrpiwcqaicdbslynkg.png looks like this. So I opened footprints, it show up in field, but the window is freezed.

Revision history for this message
ildus (k-dus) wrote :

(gdb) bt 30
#0 0x00007f928308797b in poll () at /usr/lib/libc.so.6
#1 0x00007f92819d9ff3 in () at /usr/lib/libglib-2.0.so.0
#2 0x00007f92819da3b2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3 0x00007f9282a8adf3 in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0
#4 0x00007f92866ee866 in wxGUIEventLoop::DoRun() () at /usr/lib/libwx_gtk2u_core-3.0.so.0
#5 0x00007f9285e5d784 in wxEventLoopBase::Run() () at /usr/lib/libwx_baseu-3.0.so.0
#6 0x00007f92749ea922 in () at /usr/bin/_eeschema.kiface
#7 0x00007f92746a497b in () at /usr/bin/_eeschema.kiface
#8 0x00007f92748c6ae8 in () at /usr/bin/_eeschema.kiface
#9 0x00007f9285fa7d4e in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#10 0x00007f9285fa7e54 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /usr/lib/libwx_baseu-3.0.so.0
#11 0x00007f9285fa822d in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#12 0x00007f9274a137d1 in () at /usr/bin/_eeschema.kiface
#13 0x00007f9285fa8013 in wxEvtHandler::DoTryChain(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#14 0x00007f9285fa8316 in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#15 0x00007f92747d3b7d in () at /usr/bin/_eeschema.kiface
#16 0x00007f927479e5d7 in () at /usr/bin/_eeschema.kiface
#17 0x00007f92749f9eab in () at /usr/bin/_eeschema.kiface
#18 0x00007f9285fa7d4e in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#19 0x00007f9285fa7e54 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /usr/lib/libwx_baseu-3.0.so.0
#20 0x00007f9285fa822d in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#21 0x00007f9285fa82b4 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#22 0x00007f9285fa8316 in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#23 0x00007f928693a8fd in wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/libwx_gtk2u_core-3.0.so.0
#24 0x00007f9285fa8067 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#25 0x00007f9286711f92 in wxWindow::GTKDoInsertTextFromIM(char const*) () at /usr/lib/libwx_gtk2u_core-3.0.so.0
#26 0x00007f9282465c5d in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#27 0x00007f9282479b50 in () at /usr/lib/libgobject-2.0.so.0
#28 0x00007f9282482806 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#29 0x00007f928248371c in g_signal_emit_by_name () at /usr/lib/libgobject-2.0.so.0
#30 0x00007f9282465c5d in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Probably there are more threads, could you try executing "info threads"? If any of them is stuck in eeschema then you can make it active with "thread n" and then get the backtrace. I appreciate your help.

Revision history for this message
ildus (k-dus) wrote :
Download full text (5.0 KiB)

(gdb) info threads
  Id Target Id Frame
* 1 Thread 0x7f03d19509c0 (LWP 7204) "kicad" 0x00007f03cd00097b in poll () from /usr/lib/libc.so.6
  2 Thread 0x7f03c237a700 (LWP 7219) "gmain" 0x00007f03cd00097b in poll () from /usr/lib/libc.so.6
  3 Thread 0x7f03bb5a3700 (LWP 7221) "threaded-ml" 0x00007f03cd00097b in poll () from /usr/lib/libc.so.6
  4 Thread 0x7f0393f3d700 (LWP 7223) "kicad" futex_wait (val=24, addr=0x56428c7c4f54) at /build/gcc/src/gcc/libgomp/config/linux/x86/futex.h:44
  5 Thread 0x7f039373c700 (LWP 7224) "kicad" futex_wait (val=24, addr=0x56428c7c4f54) at /build/gcc/src/gcc/libgomp/config/linux/x86/futex.h:44
  6 Thread 0x7f0392f3b700 (LWP 7225) "kicad" futex_wait (val=24, addr=0x56428c7c4f54) at /build/gcc/src/gcc/libgomp/config/linux/x86/futex.h:44
(gdb) thread 2
[Switching to thread 2 (Thread 0x7f03c237a700 (LWP 7219))]
#0 0x00007f03cd00097b in poll () from /usr/lib/libc.so.6
(gdb) bt 10
#0 0x00007f03cd00097b in poll () at /usr/lib/libc.so.6
#1 0x00007f03cb952ff3 in () at /usr/lib/libglib-2.0.so.0
#2 0x00007f03cb95310e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3 0x00007f03cb953162 in () at /usr/lib/libglib-2.0.so.0
#4 0x00007f03cb97b26a in () at /usr/lib/libglib-2.0.so.0
#5 0x00007f03cd2d308c in start_thread () at /usr/lib/libpthread.so.0
#6 0x00007f03cd00ae7f in clone () at /usr/lib/libc.so.6
(gdb) thread 3
[Switching to thread 3 (Thread 0x7f03bb5a3700 (LWP 7221))]
#0 0x00007f03cd00097b in poll () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007f03cd00097b in poll () at /usr/lib/libc.so.6
#1 0x00007f03c0e73773 in () at /usr/lib/libpulse.so.0
#2 0x00007f03c0e64bd0 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
#3 0x00007f03c0e65271 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
#4 0x00007f03c0e65301 in pa_mainloop_run () at /usr/lib/libpulse.so.0
#5 0x00007f03c0e736ae in () at /usr/lib/libpulse.so.0
#6 0x00007f03c0c1281c in () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#7 0x00007f03cd2d308c in start_thread () at /usr/lib/libpthread.so.0
#8 0x00007f03cd00ae7f in clone () at /usr/lib/libc.so.6
(gdb) thread 4
[Switching to thread 4 (Thread 0x7f0393f3d700 (LWP 7223))]
#0 futex_wait (val=24, addr=0x56428c7c4f54) at /build/gcc/src/gcc/libgomp/config/linux/x86/futex.h:44
44 /build/gcc/src/gcc/libgomp/config/linux/x86/futex.h: No such file or directory.
(gdb) bt
#0 0x00007f03cd719f0e in futex_wait (val=24, addr=0x56428c7c4f54) at /build/gcc/src/gcc/libgomp/config/linux/x86/futex.h:44
#1 0x00007f03cd719f0e in do_wait (val=24, addr=0x56428c7c4f54) at /build/gcc/src/gcc/libgomp/config/linux/wait.h:67
#2 0x00007f03cd719f0e in gomp_barrier_wait_end (bar=0x56428c7c4f50, state=24) at /build/gcc/src/gcc/libgomp/config/linux/bar.c:48
#3 0x00007f03cd7178c8 in gomp_simple_barrier_wait (bar=<optimized out>) at /build/gcc/src/gcc/libgomp/config/posix/simple-bar.h:60
#4 0x00007f03cd7178c8 in gomp_thread_start (xdata=<optimized out>) at /build/gcc/src/gcc/libgomp/team.c:124
#5 0x00007f03cd2d308c in start_thread () at /usr/lib/libpthread.so.0
#6 0x00007f03cd00ae7f in clone () at /usr/lib/libc.so.6
(gdb) thread 5
[Switching to thread 5 (Thread 0x7f039373c700 (LWP 722...

Read more...

Revision history for this message
ildus (k-dus) wrote :

Ok, I made a debug build and now it shows me Assert error.

ASSERT INFO:
./src/common/object.cpp(251): assert "classTable->Get(m_className) == NULL" failed in Register(): Class "wxCommandEvent" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?

BACKTRACE:
[1] wxClassInfo::Register()
[2] _dl_catch_error
[3] _dl_catch_error
[4] dlopen
[5] _PyImport_GetDynLoadFunc
[6] _PyImport_LoadDynamicModule
[7] PyImport_ImportModuleLevel
[8] PyObject_Call
[9] PyEval_CallObjectWithKeywords
[10] PyEval_EvalFrameEx
[11] PyEval_EvalCodeEx
[12] PyEval_EvalCode
[13] PyImport_ExecCodeModuleEx
[14] PyImport_ImportModuleLevel
[15] PyObject_Call
[16] PyEval_CallObjectWithKeywords
[17] PyEval_EvalFrameEx
[18] PyEval_EvalCodeEx
[19] PyEval_EvalCode
[20] PyImport_ExecCodeModuleEx
[21] PyImport_ImportModuleLevel
[22] PyObject_Call
[23] PyObject_CallFunction
[24] PyImport_Import
[25] PyImport_ImportModule
[26] PyCObject_Import
[27] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[28] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[29] wxEvtHandler::TryHereOnly(wxEvent&)
[30] wxEvtHandler::ProcessEventLocally(wxEvent&)
[31] wxEvtHandler::ProcessEvent(wxEvent&)
[32] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[33] g_closure_invoke
[34] g_signal_emit_valist
[35] g_signal_emit
[36] g_closure_invoke
[37] g_signal_emit_valist
[38] g_signal_emit
[39] g_closure_invoke
[40] g_signal_emit_valist
[41] g_signal_emit
[42] gtk_propagate_event
[43] gtk_main_do_event
[44] g_main_context_dispatch
[45] g_main_loop_run
[46] gtk_main
[47] wxGUIEventLoop::DoRun()
[48] wxEventLoopBase::Run()
[49] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[50] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[51] wxEvtHandler::TryHereOnly(wxEvent&)
[52] wxEvtHandler::DoTryChain(wxEvent&)
[53] wxEvtHandler::ProcessEvent(wxEvent&)
[54] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[55] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[56] wxEvtHandler::TryHereOnly(wxEvent&)
[57] wxEvtHandler::ProcessEventLocally(wxEvent&)
[58] wxEvtHandler::ProcessEvent(wxEvent&)
[59] wxScrollHelperEvtHandler::ProcessEvent(wxEvent&)
[60] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[61] wxWindow::GTKDoInsertTextFromIM(char const*)
[62] g_closure_invoke
[63] g_signal_emit_valist
[64] g_signal_emit_by_name
[65] g_closure_invoke
[66] g_signal_emit_valist
[67] g_signal_emit_by_name
[68] g_closure_invoke
[69] g_signal_emit_valist
[70] g_signal_emit
[71] gtk_window_propagate_key_event
[72] g_closure_invoke
[73] g_signal_emit_valist
[74] g_signal_emit
[75] gtk_propagate_event
[76] gtk_main_do_event
[77] g_main_context_dispatch
[78] g_main_loop_run
[79] gtk_main
[80] wxGUIEventLoop::DoRun()
[81] wxEventLoopBase::Run()
[82] wxAppConsoleBase::MainLoop()
[83] wxEntry(int&, wchar_t**)
[84] __libc_start_main
[85] _start

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

Given that there is python stuff in this stack trance, this looks suspiciously like the pcbnew arch linux bug where wxpython was built with gtk3 instead of gtk2.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1747677] Re: Symbol properties freezes

lol, given that I didn't get in this morning until 1AM, it looks like
I'm the one in a trance or possible a trace? :)

On 2/6/2018 11:15 AM, Wayne Stambaugh wrote:
> Given that there is python stuff in this stack trance, this looks
                                               ^^trace^^

> suspiciously like the pcbnew arch linux bug where wxpython was built
> with gtk3 instead of gtk2.
>

Revision history for this message
ildus (k-dus) wrote : Re: Symbol properties freezes

Yeah, I checked, pcbnew doesn't work too.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

I have checked too and I confirm it is caused by the newest wxpython package in AUR. Downgrading resolved the problem. I will try to see if we can fix it somehow.

Revision history for this message
ildus (k-dus) wrote :

Thank you! Then I'll just downgrade too until it will be fixed.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Alternatively you can switch to wxpython-gtk2.

Revision history for this message
ildus (k-dus) wrote :

Yes, thanks. I noticed that this problem has been discussed in https://aur.archlinux.org/packages/kicad-git/ too. One user suggested -DKICAD_SCRIPTING_WXPYTHON=OFF which will disable wxpython. Does it mean that kicad will work partially and some features will be disabled? If it's scripting language like VBA in Excel maybe I don't need it at all.

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

Is there any way to check this Python stuff at startup? We seem to be running into it a lot....

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

ildus, mostly likely you can disable Python scripting. It allows you to develop scripts to automate certain operations, like VBA in Excel.

Jeff, Python scripting is a cmake build option, so generally we can test it with #ifdef. The problem we are facing now is KiCad might be build against wxWidgets/gtk2 and wxPython/gtk3. Then when you launch KiCad, it will load wxgtk2 shared libraries and later, once wxPython is initialized - wxgtk3, leading to symbol conflicts. I could not yet find a way to determine if there is a conflict at build or run time.

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

I never had Kicad working when built with wxWidget-gtk3.
Especially the wxDC graphic engine is not compatible.
I also had some other issues with the GUI.

To answer the question about -DKICAD_SCRIPTING_WXPYTHON=OFF, the lost feature is the python console inside pcbnew.

footprint wizards work, and python actions work as long they do not use a wxPython GUI widget.

Revision history for this message
ildus (k-dus) wrote :

At the end I just installed wxpython-gtk2 and all good.

But it will be problem on release of Kicad version 5 on Arch Linux (and maybe others), since it could not be linked to system's wxpython.

ildus (k-dus)
summary: - Symbol properties freezes
+ wxpython incompability in Arch Linux
Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1747677] Re: Symbol properties freezes

The problem is that in order to use wxPython to determine how it was
built, you have to run it to be able to access the wxWidgets
wxPlatformInfo object so obviously that's not going to work. I would
prefer that this is discovered at build config and not even allow KiCad
to build. Why wait until after you've packaged KiCad to find out there
is an issue when you can discover it during build config? It's always
been known that using wxPython built against a different version of
wxWidgets used to build KiCad is risky. You could probably run a python
script from within cmake to determine which version of gtk+ that
wxPython was built against. For wxWidgets itself, you would have to
compile a short program and dump the GTK+ version to the console and
test it against the wxPython version. CMake has helper macros for doing
this.

On 2/7/2018 5:22 AM, Jeff Young wrote:
> Is there any way to check this Python stuff at startup? We seem to be
> running into it a lot....
>

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

Since this is an issue with the arch wxPython package, I'm going to mark this bug as invalid since it is nothing kicad can do to resolve the issue.

Changed in kicad:
status: New → Invalid
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 948f28ebcc68f131f1f7f9aa76bd4d652212f379
https://git.launchpad.net/kicad/patch/?id=948f28ebcc68f131f1f7f9aa76bd4d652212f379

Changed in kicad:
status: Invalid → Fix Committed
assignee: nobody → Maciej Suminski (orsonmmz)
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