[wxPython] wxPython debug builds on Linux

I didn't manage to successfully make a debug version of wxPython on
Linux.

I've built a debugging version of wxGTK with:

./configure --with-libpng --with-libjpeg --with-libtiff --with-opengl --with-regex --with-zlib --enable-debug --prefix=/usr/local/wxgtkd

Then, I just put /usr/local/wxgtkd/bin in the path and built wxPython.

Alas, trying to run any wxPython app results in a segault. It appears to
be related to the wxApp object.

Here's the backtrace:

#0 0x00000000 in ?? ()
#1 0x404c81f5 in wxapp_pending_callback () at ./src/gtk/app.cpp:176
#2 0x4082e4fa in g_timeout_add () from /usr/lib/libglib-1.2.so.0
#3 0x4082d4d8 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#4 0x4082dae3 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#5 0x4082db95 in g_main_iteration () from /usr/lib/libglib-1.2.so.0
#6 0x40751a4a in gtk_main_iteration () from /usr/lib/libgtk-1.2.so.0
#7 0x404c8128 in wxApp::Yield (this=0x84e5bb0, onlyIfNeeded=false) at
./src/gtk/app.cpp:125
#8 0x405dc2df in wxYield () at ./src/common/utilscmn.cpp:1343
#9 0x401f53ec in _wrap_wxYield (self=0x0, args=0x80fce84, kwargs=0x0)
at src/gtk/misc.cpp:569
#10 0x080c453a in PyCFunction_Call ()
#11 0x080a6c90 in PyObject_Call ()
#12 0x08079109 in PyEval_EvalCode ()
#13 0x08076024 in _PyExc_Fini ()
...

Environment: Debian woody, wxGTK 2.3.2, wxPython 2.3.2.1.

The wxGTK demos run fine in debug mode.

It doesn't seem to make a difference if I build wxPython with "python
setup.py build --debug" instead.

I've now successfully rebuilt wxGTK and wxPython in release mode, but I
really need a debug version of these.

How do I build a debugging version of wxPython on Linux?

TIA,

Gerhard

···

--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

I didn't manage to successfully make a debug version of wxPython on
Linux.

I've built a debugging version of wxGTK with:

./configure --with-libpng --with-libjpeg --with-libtiff --with-opengl --with
-regex --with-zlib --enable-debug --prefix=/usr/local/wxgtkd

Then, I just put /usr/local/wxgtkd/bin in the path and built wxPython.

Alas, trying to run any wxPython app results in a segault. It appears to
be related to the wxApp object.

Here's the backtrace:

The backtrace looks like a __WXDEBUG__ mismatch. Please verify that the
compile command lines used when building wxPython included -D__WXDEBUG__ (if
not then the wrong version of wx-config is executed.) Also, ensure that the
correct wxGTK shared lib is being loaded by wxPython, (use ldd wxc.so)

BTW, the debug and release version of wxGTK can coexist in the same
location. wx-config is just a symlink to the build-specific wx-config. You
just need to switch the link when you want to change your build.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

* Robin Dunn <robin@alldunn.com> [2002-05-02 12:19 -0700]:

> I didn't manage to successfully make a debug version of wxPython on
> Linux.
>
> I've built a debugging version of wxGTK with:
>
>
./configure --with-libpng --with-libjpeg --with-libtiff --with-opengl --with
-regex --with-zlib --enable-debug --prefix=/usr/local/wxgtkd
>
> Then, I just put /usr/local/wxgtkd/bin in the path and built wxPython.
>
> Alas, trying to run any wxPython app results in a segault. It appears to
> be related to the wxApp object.
>
> Here's the backtrace:

The backtrace looks like a __WXDEBUG__ mismatch. Please verify that the
compile command lines used when building wxPython included -D__WXDEBUG__ (if
not then the wrong version of wx-config is executed.)

It builds with __WXDEBUG__

Also, ensure that the correct wxGTK shared lib is being loaded by
wxPython, (use ldd wxc.so)

Should be ok:

gerhard@lilith:~/src/wxPython-2.3.2.1_debug/demo$ ldd
../build/lib.linux-i686-2.2/wxPython/wxc.so
        libwx_gtkd-2.3.so => /usr/local/wxgtk/lib/libwx_gtkd-2.3.so (0x401a1000)

BTW, the debug and release version of wxGTK can coexist in the same
location. wx-config is just a symlink to the build-specific wx-config. You
just need to switch the link when you want to change your build.

Thanks, I installed them at the same location now.

I also rebuilt the wxGTK in debug mode and wxPython, but I still get the
same traceback :frowning:

Gerhard

···

--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

It builds with __WXDEBUG__

gerhard@lilith:~/src/wxPython-2.3.2.1_debug/demo$ ldd
../build/lib.linux-i686-2.2/wxPython/wxc.so
        libwx_gtkd-2.3.so => /usr/local/wxgtk/lib/libwx_gtkd-2.3.so

(0x401a1000)

I also rebuilt the wxGTK in debug mode and wxPython, but I still get the
same traceback :frowning:

OKay, one more thing I shoul dhave mentioned before. If you are using
Python 2.2 then it's distutils will put -DNDEBUG on the compile command
line, which will turn off __WXDEBUG__. There's a patch for setup.py that I
sent to the list a week or so ago.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

* Robin Dunn <robin@alldunn.com> [2002-05-02 15:07 -0700]:

>
> It builds with __WXDEBUG__

> gerhard@lilith:~/src/wxPython-2.3.2.1_debug/demo$ ldd
> ../build/lib.linux-i686-2.2/wxPython/wxc.so
> libwx_gtkd-2.3.so => /usr/local/wxgtk/lib/libwx_gtkd-2.3.so
(0x401a1000)

> I also rebuilt the wxGTK in debug mode and wxPython, but I still get the
> same traceback :frowning:

OKay, one more thing I shoul dhave mentioned before. If you are using
Python 2.2 then it's distutils will put -DNDEBUG on the compile command
line, which will turn off __WXDEBUG__. There's a patch for setup.py that I
sent to the list a week or so ago.

Thanks, that did it :slight_smile:

I get several failed asserts in wxGTK within the wxPython demo, though.
Should I bug the wxWindows folks with these? You probably have seen
this much too often yourself, I suppose.

Gerhard

···

--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

I get several failed asserts in wxGTK within the wxPython demo, though.
Should I bug the wxWindows folks with these? You probably have seen
this much too often yourself, I suppose.

Which asserts? I'm not seeing any in wxGTK right now?

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

* Robin Dunn <robin@alldunn.com> [2002-05-03 13:08 -0700]:

>
> I get several failed asserts in wxGTK within the wxPython demo, though.
> Should I bug the wxWindows folks with these? You probably have seen
> this much too often yourself, I suppose.

Which asserts? I'm not seeing any in wxGTK right now?

In the demo, when I click on "wxCrustWithFilling", I get "Assert failed
in file src/gtk/app.cpp at line 95: wxYield called recursively"

Same for "ErrorDialogs", "wxRightTextControl" and probably some other
demos as well.

I can crash Python when I click "TablePrint", then "Preview print of a
wide table", then try to close the Print Preview window that pops up,
before it actually displays the preview:

#0 0x00000000 in ?? ()
#1 0x405ae627 in wxPreviewCanvas::OnPaint (this=0x8533170) at ./src/common/prntbase.cpp:209
#2 0x40557c08 in wxEvtHandler::SearchEventTable (this=0x8533170, table=@0x406a6768, event=@0xbfffd6ac)
    at ./src/common/event.cpp:884
#3 0x405578fc in wxEvtHandler::ProcessEvent (this=0x8533170, event=@0xbfffd6ac) at ./src/common/event.cpp:800
#4 0x4051e6f5 in gtk_window_draw_callback (widget=0x8568278, rect=0xbfffdc74, win=0x8533170)
    at ./src/gtk/window.cpp:979
#5 0x4075b03f in gtk_marshal_NONE__POINTER () from /usr/lib/libgtk-1.2.so.0
#6 0x4078ab6c in gtk_signal_remove_emission_hook () from /usr/lib/libgtk-1.2.so.0
#7 0x40789fd5 in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0
#8 0x407880b3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
...

This crash happens in my debug and release builds of wxPython/wxGTK.

I also get tons of failed gtk asserts in the release build, like:

Gdk-CRITICAL **: file gdkgc.c: line 713 (gdk_gc_set_clip_region):
assertion `gc != NULL' failed.
Gtk-CRITICAL **: file gtkstyle.c: line 2307 (gtk_default_draw_flat_box):
assertion `window != NULL' failed.

Gerhard

···

--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))