2017-09-15 174 views
0

我使用TaskCoach-1.4.3,它是用Python2.7和wxpython-3.0-gtk2編寫的。沒有對原始代碼進行更改,並且使用了兩年多,但有一天它停止了奇怪的錯誤。wxpython,wx-3.0-gtk2的奇怪問題。 C++ assertion「IsOk()」失敗

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。沒什麼幫助。請幫助它工作。

+0

這是PNG圖像可以嗎?它可以與其他應用程序讀取? – Ripi2

+0

@Ural,你升級了png庫嗎?你升級了系統嗎? GTK +?有一張票閱讀不正常的PNG,但我相信它很久以前就修復了。 – Igor

+0

我無法找到它請求的png圖片。我假設它與應用程序一起提供,並且必須沒事,因爲應用程序的版本是相同的,我再次下載它。 @igor,是的,我通常更新系統,並且可能會收到一些更新,但通常更新是爲了修復錯誤,而不是添加它們。我試圖重新編譯'emerge -av gtk + pygtk libpng wxGTK wxpython',它仍然失敗... – Ural

回答

0

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

我將libpng降級到1.6.29,問題已修復。他們也修復了git版本,但還沒有發佈新版本。已經通過zlib的或一些其它「合理的」壓縮機產生png_check_chunk_length(),但它似乎假定數據:

的libpng-32年6月1日的嘗試,以計算在一個pngrutil.c IDAT組塊中的最大合理大小以最小的開銷輸出數據。然而,PNG標準沒有(據我所知)包括任何這樣的要求,並且實際上,第15.2.3(k)節指出,一致性解碼器必須「假設[]不超過整個圖像數據是由存儲在一些IDAT塊中的單個壓縮數據流表示「。

固定在git分支libpng16中,請測試。它爲IDAT設置了一個更大的限制,允許每行放氣緩衝區。此外,它使用PNG_USER_CHUNK_MALLOC_MAX用戶限制,因此用戶可以在需要時設置更大的限制。