wxpython,wx-3.0-gtk2的奇怪问题。 C ++断言" IsOk()"失败

时间:2017-09-15 07:12:38

标签: python wxpython wxwidgets assertions gtk2

我使用的是TaskCoach-1.4.3,它是用Python2.7和wxpython-3.0-gtk2编写的。没有对原始代码进行任何更改,我使用它超过2年,但有一天它停止了奇怪的错误。

Gtk-Message: (for origin information, set GTK_DEBUG): failed to retrieve property `gtk-primary-button-warps-slider' of type `gboolean' from rc file value "((GString*) 0x5d546b17a0)" of type `gboolean'
Traceback (most recent call last):
  File "/home/user/bin/taskcoach/taskcoachlib/gui/artprovider.py", line 62, in CreateBitmap
    return self._CreateBitmap(artId, artClient, size)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/artprovider.py", line 69, in _CreateBitmap
    bitmap = icons.catalog[catalogKey].getBitmap()
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/lib/embeddedimage.py", line 48, in GetBitmap
    return wx.BitmapFromImage(self.GetImage())
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_gdi.py", line 884, in BitmapFromImage
    val = _gdi_.new_BitmapFromImage(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "image.IsOk()" failed at /var/tmp/portage/x11-libs/wxGTK-3.0.2.0-r2/work/wxPython-src-3.0.2.0/src/gtk/bitmap.cpp(626) in wxBitmap(): invalid image
persons_icon
Traceback (most recent call last):
  File "/home/user/bin/tasker", line 72, in <module>
    start()
  File "/home/user/bin/tasker", line 63, in start
    app = application.Application(options, args)
  File "/home/user/bin/taskcoach/taskcoachlib/patterns/singleton.py", line 29, in __call__
    class_.instance = super(Singleton, class_).__call__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/application/application.py", line 117, in __init__
    self.init(**kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/application/application.py", line 226, in init
    self.settings, splash=splash)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/mainwindow.py", line 68, in __init__
    self._create_window_components()  # Not private for test purposes
  File "/home/user/bin/taskcoach/taskcoachlib/gui/mainwindow.py", line 140, in _create_window_components
    viewer.addViewers(self.viewer, self.taskFile, self.settings)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/factory.py", line 45, in __init__
    self.__add_all_viewers()
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/factory.py", line 49, in __add_all_viewers
    self.__add_viewers(task.TaskViewer)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/factory.py", line 66, in __add_viewers
    **self._viewer_kwargs(viewer_class))
  File "/home/user/bin/taskcoach/taskcoachlib/patterns/metaclass.py", line 39, in __call__
    instance = super(NumberedInstances, cls).__call__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/task.py", line 877, in __init__
    super(TaskViewer, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/mixin.py", line 383, in __init__
    super(SortableViewerForTasksMixin, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/mixin.py", line 323, in __init__
    super(ManualOrderingMixin, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/mixin.py", line 208, in __init__
    super(SortableViewerMixin, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/base.py", line 703, in __init__
    super(ViewerWithColumns, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/task.py", line 136, in __init__
    super(BaseTaskTreeViewer, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/task.py", line 77, in __init__
    super(BaseTaskViewer, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/mixin.py", line 85, in __init__
    super(FilterableViewerMixin, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/base.py", line 583, in __init__
    super(TreeViewer, self).__init__(*args, **kwargs)
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/base.py", line 63, in __init__
    self.widget = self.createWidget()
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/task.py", line 912, in createWidget
    imageList = self.createImageList()  # Has side-effects
  File "/home/user/bin/taskcoach/taskcoachlib/gui/viewer/base.py", line 191, in createImageList
    imageList.Add(wx.ArtProvider_GetBitmap(image, wx.ART_MENU, size))
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_gdi.py", line 6735, in Add
    return _gdi_.ImageList_Add(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "IsOk()" failed at /var/tmp/portage/x11-libs/wxGTK-3.0.2.0-r2/work/wxPython-src-3.0.2.0/src/gtk/bitmap.cpp(923) in GetWidth(): invalid bitmap

它还显示GUI错误消息:

IDAT: chunk data is too large
07:11:19: Couldn't load a PNG image - file is corrupted or not enough memory.
07:11:19: Unknown image data format.

我尝试重新编译wxwidgets和wxpython(我使用gentoo),从主目录中删除任何数据,然后从官方网站taskcoach.org再次下载。什么都没有帮助。请帮助它开始工作。

1 个答案:

答案 0 :(得分:0)

我找到了原因。 https://sourceforge.net/p/libpng/bugs/270/?limit=25

我将libpng降级为1.6.29并解决了问题。他们也修复了git版本,但仍然没有发布新版本。

  

libpng-1.6.32尝试计算pngrutil.c中的IDAT块的最大合理大小:png_check_chunk_length(),但它似乎假设数据是由zlib或其他“合理”压缩器生成的,它输出数据最小的开销。但是,PNG标准(据我所知)并不包括任何此类要求,事实上,https://www.w3.org/TR/PNG/第15.2.3(k)节规定,符合条件的解码器必须“假设[]不超过完整的图像数据由单个压缩数据流表示,该数据流存储在一定数量的IDAT块中。“

     

在git分支libpng16中修复,请测试。它为IDAT设置了更大的限制,允许每行使用一个deflate缓冲区。此外,它使用PNG_USER_CHUNK_MALLOC_MAX用户限制,因此用户可以在需要时设置更大的限制。