2012-04-27 61 views
0

我有一個使用cairo,poppler和gtk +的程序(gummi)。每次我用alt-tab切換焦點時(但是當我使用其他方式改變焦點時並不那麼多),任務管理器告訴我它獲得了10-20個GDI對象。 GDIView告訴我這些大多是位圖和DC,儘管這些僅佔「GDI Total」的大部分; 「所有GDI」的數量是「GDI Total」數量的3-4倍。GDI對象泄漏在cairo重新對焦或gtk在Windows上?

如何確定這是否是gummi中的一個bug(我認爲這不太可能,因爲我認爲gummi沒有做任何關於重新聚焦/重繪的任何操作),cairo,poppler或gtk?我該如何去查找錯誤的位置,以便我可以提交錯誤報告? (或者,如果這是gtk/cairo/poppler的已知錯誤,是否有人可以指向我的錯誤報告?)

正如其他線程(Win32Exception: Operation completed successfully)所述,Windows將進程限制爲10,000個句柄,已經有gummi segfault,可能達到這個極限。從這樣的事件gdb回溯被複制下面。

(gummi.exe:14008): Gdk-WARNING **: gdkgc-win32.c:830: SaveDC failed: The operation completed successfully. 

(gummi.exe:14008): Gdk-WARNING **: gdkgc-win32.c:970: RestoreDC failed: The operation completed successfully. 
pnc=: T 
Program received signal SIGSEGV, Segmentation fault. 
0x68de05bd in cairo_image_surface_get_data() 
    from d:\opt\gtk\bin\libcairo-2.dll 
(gdb) bt 
#0 0x68de05bd in cairo_image_surface_get_data() 
    from d:\opt\gtk\bin\libcairo-2.dll 
#1 0x6c38d268 in _gdk_pixmap_new() 
    from d:\opt\gtk\bin\libgdk-win32-2.0-0.dll 
#2 0x62d453a5 in draw_extension() 
    from d:\opt\gtk\lib\gtk-2.0\2.10.0\engines\libwimp.dll 
#3 0x0155fdb6 in gtk_notebook_draw_tab() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#4 0x015601d7 in gtk_notebook_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#5 0x0153b916 in _gtk_marshal_BOOLEAN__BOXED() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#6 0x63a451f9 in g_closure_invoke() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#7 0x63a54512 in signal_emit_unlocked_R() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#8 0x63a5b614 in g_signal_emit_valist() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#9 0x63a5b962 in g_signal_emit() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#10 0x0165b557 in gtk_widget_event_internal() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#11 0x014b6b0d in gtk_container_propagate_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#12 0x014b6b48 in gtk_container_expose_child() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#13 0x0147c026 in gtk_box_forall() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#14 0x014b5436 in gtk_container_forall() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#15 0x014b5611 in gtk_container_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#16 0x0153b916 in _gtk_marshal_BOOLEAN__BOXED() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#17 0x63a451f9 in g_closure_invoke() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#18 0x63a54512 in signal_emit_unlocked_R() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#19 0x63a5b614 in g_signal_emit_valist() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#20 0x63a5b962 in g_signal_emit() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#21 0x0165b557 in gtk_widget_event_internal() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#22 0x014b6b0d in gtk_container_propagate_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#23 0x014b6b48 in gtk_container_expose_child() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#24 0x0156a555 in gtk_paned_forall() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#25 0x014b5436 in gtk_container_forall() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#26 0x014b5611 in gtk_container_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#27 0x0156a894 in gtk_paned_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#28 0x0153b916 in _gtk_marshal_BOOLEAN__BOXED() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#29 0x63a451f9 in g_closure_invoke() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#30 0x63a54512 in signal_emit_unlocked_R() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#31 0x63a5b614 in g_signal_emit_valist() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#32 0x63a5b962 in g_signal_emit() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#33 0x0165b557 in gtk_widget_event_internal() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#34 0x014b6b0d in gtk_container_propagate_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#35 0x014b6b48 in gtk_container_expose_child() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#36 0x0147c026 in gtk_box_forall() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#37 0x014b5436 in gtk_container_forall() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#38 0x014b5611 in gtk_container_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#39 0x0153b916 in _gtk_marshal_BOOLEAN__BOXED() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#40 0x63a451f9 in g_closure_invoke() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#41 0x63a54512 in signal_emit_unlocked_R() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#42 0x63a5b614 in g_signal_emit_valist() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#43 0x63a5b962 in g_signal_emit() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#44 0x0165b557 in gtk_widget_event_internal() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#45 0x014b6b0d in gtk_container_propagate_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#46 0x014b6b48 in gtk_container_expose_child() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#47 0x014b5436 in gtk_container_forall() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#48 0x014b5611 in gtk_container_expose() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#49 0x0153b916 in _gtk_marshal_BOOLEAN__BOXED() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#50 0x63a452c2 in g_closure_invoke() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#51 0x63a54512 in signal_emit_unlocked_R() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#52 0x63a5b614 in g_signal_emit_valist() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#53 0x63a5b962 in g_signal_emit() 
    from d:\opt\gtk\bin\libgobject-2.0-0.dll 
#54 0x0165b557 in gtk_widget_event_internal() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#55 0x0153a22f in gtk_main_do_event() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#56 0x6c3641dd in _gdk_window_process_updates_recurse() 
    from d:\opt\gtk\bin\libgdk-win32-2.0-0.dll 
#57 0x6c35f6b6 in gdk_window_process_updates_internal() 
    from d:\opt\gtk\bin\libgdk-win32-2.0-0.dll 
#58 0x6c361497 in gdk_window_process_all_updates() 
    from d:\opt\gtk\bin\libgdk-win32-2.0-0.dll 
#59 0x6c361507 in gdk_window_update_idle() 
    from d:\opt\gtk\bin\libgdk-win32-2.0-0.dll 
#60 0x6c34137c in gdk_threads_dispatch() 
    from d:\opt\gtk\bin\libgdk-win32-2.0-0.dll 
#61 0x685eb167 in g_main_context_dispatch() 
    from d:\opt\gtk\bin\libglib-2.0-0.dll 
#62 0x685eb90d in g_main_context_iterate.clone.5() 
    from d:\opt\gtk\bin\libglib-2.0-0.dll 
#63 0x685ebd9d in g_main_loop_run() 
    from d:\opt\gtk\bin\libglib-2.0-0.dll 
#64 0x01539038 in gtk_main() 
    from d:\opt\gtk\bin\libgtk-win32-2.0-0.dll 
#65 0x0040950e in gui_main (builder=0x33f5090) at gui/gui-main.c:281 
#66 0x00428378 in main (argc=1, argv=0x3f56c8) at main.c:157 
(gdb) 

我使用的是從GTK + -bundle_2.24.10-20120208_win32從32位下載開羅和GTK +在http://www.gtk.org/download/win32.phphttp://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip。這個項目也使用了gtksourceview-2.10.0,libpng-1.5.10,openjpeg-1.5.0,poppler-0.18.4和其他一些庫,〜都是從MinGW下的源代碼構建而成的,我認爲這些都不相關圖形。

回答

0

這種問題不會被GTK團隊忽視,這可能是一個gummi的bug。檢查該程序的expose-event信號處理程序,並確保它不分配任何東西而不釋放它們。

GDI泄漏確實很棘手(在MFC中有問題,而且問題在於應用程序)。

更新: 似乎我錯了,它是GTK bug 671538。 你也可以在this thread找到一些建議。

+0

我在Windows 7上,錯誤報告顯示這個錯誤在Windows 7上沒有發生,但是當我今天晚些時候有機會的時候我會檢查gtk測試程序。 – 2012-04-27 14:28:26

+0

我不確定這是否是同一個錯誤; gtk-demo在使用alt-tab重新聚焦時會泄漏GDI對象,但只能達到320左右(一旦count達到320,它似乎不再泄漏它們)。 – 2012-04-28 19:15:50