wxAssertFailure: invalid bitmap

simonb@himalia:~/local/wxPython-src-2.6.3.3/wxPython/demo$ ./demo.py

(python:5473): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed

(python:5473): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed

(python:5473): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed
Traceback (most recent call last):
  File "/home/users/simonb/lib/python2.4/site-packages/wx/_misc.py", line 1286, in Notify
    self.notify()
  File "/home/users/simonb/lib/python2.4/site-packages/wx/_core.py", line 13637, in Notify
    self.result = self.callable(*self.args, **self.kwargs)
  File "/mnt/hda9/simonb/local/wxPython-src-2.6.3.3/wxPython/demo/Main.py", line 1711, in ShowMain
    frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
  File "/mnt/hda9/simonb/local/wxPython-src-2.6.3.3/wxPython/demo/Main.py", line 1125, in __init__
    self.tbicon = DemoTaskBarIcon(self)
  File "/mnt/hda9/simonb/local/wxPython-src-2.6.3.3/wxPython/demo/Main.py", line 1033, in __init__
    self.SetIcon(icon, "wxPython Demo")
  File "/home/users/simonb/lib/python2.4/site-packages/wx/_windows.py", line 2234, in SetIcon
    return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ../src/gtk/bitmap.cpp(1246): invalid bitmap

bummer.

Simon.

···

--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 2 6249 6940
http://arrowtheory.com

Simon Burton wrote:

  File "/mnt/hda9/simonb/local/wxPython-src-2.6.3.3/wxPython/demo/Main.py", line 1033, in __init__
    self.SetIcon(icon, "wxPython Demo")
  File "/home/users/simonb/lib/python2.4/site-packages/wx/_windows.py", line 2234, in SetIcon
    return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ../src/gtk/bitmap.cpp(1246): invalid bitmap

Hmm... all the icons used for the task bar icon in the demo come from the images.py module, so normally there should be nothing that could cause them to be invalid. Unless there is some problem with the image handler code. Did you notice any compile problems with the wx PNG image handler or the PNG lib?

···

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

I tried compiling wx with --with-libjpeg=builtin \
--with-libpng=builtin \
--with-libtiff=builtin \
--with-zlib=builtin \

No difference.
No errors in build log (attached).

Simon.

build2.log.gz (12.5 KB)

···

On Fri, 21 Jul 2006 17:59:55 +1000 Simon Burton <simon@arrowtheory.com> wrote:

  File "/home/users/simonb/lib/python2.4/site-packages/wx/_windows.py", line 2234, in SetIcon
    return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ../src/gtk/bitmap.cpp(1246): invalid bitmap

--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 2 6249 6940
http://arrowtheory.com

I ran a gdb session. No idea if any of this is useful:

[many of these...]
Breakpoint 1, wxBitmap::GetWidth (this=0xbfffafb0) at ../src/gtk/bitmap.cpp:1246
1246 wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
(gdb)
Continuing.

Breakpoint 1, wxBitmap::GetWidth (this=0xbfffafb0) at ../src/gtk/bitmap.cpp:1246
1246 wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
(gdb)
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt full
#0 0x00000000 in ?? ()
No symbol table info available.
#1 0xb7639d0d in wxEvtHandler::SetClientObject (this=0x849c138, data=0x8491cd8) at event.h:2379
No locals.
#2 0xb7b43b56 in wxEvtHandler__setOORInfo (self=0x849c138, _self=0xb7d2b82c, incref=true) at src/gtk/_core_wrap.cpp:2756
No locals.
#3 0xb7b6504d in _wrap_EvtHandler__setOORInfo (args=0xb7d300ec, kwargs=0xb64bea44) at src/gtk/_core_wrap.cpp:15794
  __tstate = (PyThreadState *) 0x814e1b0
  resultobj = (PyObject *) 0x0
  arg1 = (wxEvtHandler *) 0x849c138
  arg2 = (PyObject *) 0xb7d2b82c
  arg3 = true
  obj0 = (PyObject *) 0xb7d2b82c
  obj1 = (PyObject *) 0xb7d2b82c
  obj2 = (PyObject *) 0x0
  kwnames = {0xb7bbf183 "self", 0xb7bc16b0 "_self", 0xb7bc16b6 "incref", 0x0}
#4 0x0805cc8e in PyObject_Call (func=0xb749b0e8, arg=0xb7d300ec, kw=0xb64bea44) at Objects/abstract.c:1795
  result = (PyObject *) 0xb64bea44
  call = 0

Simon.

···

On Tue, 25 Jul 2006 16:03:31 +1000 Simon Burton <simon@arrowtheory.com> wrote:

On Fri, 21 Jul 2006 17:59:55 +1000 > Simon Burton <simon@arrowtheory.com> wrote:

> File "/home/users/simonb/lib/python2.4/site-packages/wx/_windows.py", line 2234, in SetIcon
> return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
> wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ../src/gtk/bitmap.cpp(1246): invalid bitmap
>

--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 2 6249 6940
http://arrowtheory.com

Simon Burton wrote:

···

On Tue, 25 Jul 2006 16:03:31 +1000 > Simon Burton <simon@arrowtheory.com> wrote:

On Fri, 21 Jul 2006 17:59:55 +1000 >> Simon Burton <simon@arrowtheory.com> wrote:

  File "/home/users/simonb/lib/python2.4/site-packages/wx/_windows.py", line 2234, in SetIcon
    return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in ../src/gtk/bitmap.cpp(1246): invalid bitmap

I ran a gdb session. No idea if any of this is useful:

[many of these...]
Breakpoint 1, wxBitmap::GetWidth (this=0xbfffafb0) at ../src/gtk/bitmap.cpp:1246
1246 wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
(gdb) Continuing.

Breakpoint 1, wxBitmap::GetWidth (this=0xbfffafb0) at ../src/gtk/bitmap.cpp:1246
1246 wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
(gdb) Continuing.

Sorry, it's not really helpful. We need to figure out where/why the bitmap is flagged as invalid. By the time it gets to this line it is already invalid (the Ok method returns false.) If you can trace through the loading of the image and converting it to a wxBitmap then that at least help identify the problem.

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