我有一个使用 cairo、poppler 和 gtk+ 的程序 (gummi)。每次我用 alt-tab 切换焦点时(但当我使用其他方式改变焦点时不会这么多),任务管理器告诉我它获得了 10-20 个 GDI 对象。GDIView 告诉我这些主要是位图和 DC,尽管这些仅占“GDI Total”的大部分;“All GDI”的数量是“GDI Total”的 3-4 倍。
我如何确定这是否是 gummi 中的错误(我认为这不太可能,因为我认为 gummi 在重新聚焦/重绘方面没有任何作用)、cairo、poppler 或 gtk?我如何去寻找错误在哪里,以便我可以提交错误报告?(或者,如果这是 gtk/cairo/poppler 的已知错误,有人可以指出错误报告吗?)
正如在其他线程( Win32Exception: Operation completed successfully )中提到的,windows 将进程限制为 10,000 个句柄,并且我有 gummi 段错误,大概是从达到这个限制。此类事件的 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 的 cairo 和 gtk+,来自 http://www.gtk.org/download/win32.php 的 32 位下载,http : //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 下的源代码构建的,我认为与这些库无关图形。