
Hi everyone,
I've been trying to get Inkscape to compile against the new version of GTK on OS X, with the "quartz" option enabled (i.e. without X11). The good news is that it compiles and that MacPorts provides a way to work with both native and X11 versions of GTK quite easily (which means one does not have to remove and recompile everything one way or another every time). The bad new is that, though Inkscape starts without X11 and that the GUI is shown, it crashes with this error message:
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
Emergency save activated! Emergency save completed. Inkscape will close now. If you can reproduce this crash, please file a bug at www.inkscape.org with a detailed description of the steps leading to the crash, so we can fix it.
(inkscape:9060): GLib-WARNING **: g_main_loop_run(): called recursively from within a source's check() or prepare() member, iteration not possible.
Any idea from where than may be coming from? It doe not occur with the X11 version so that's probably related to GTK/Cairo/Pango/Poppler being freed from X11. However, the GUI shows and the messages don't seem directly display-related. Is that a GTK bug in your opinion?
Backtrace below: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000020 0x90a594c0 in objc_msgSend () (gdb) bt #0 0x90a594c0 in objc_msgSend () #1 0x19b19130 in ?? () #2 0x9082dd0e in __CFRunLoopDoObservers () #3 0x9082cdb0 in CFRunLoopRunSpecific () #4 0x9082ca6e in CFRunLoopRunInMode () #5 0x92def878 in RunCurrentEventLoopInMode () #6 0x92deeeb9 in ReceiveNextEventCommon () #7 0x92deedd9 in BlockUntilNextEventMatchingListInMode () #8 0x93295485 in _DPSNextEvent () #9 0x93295076 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #10 0x00daadb6 in gdk_event_prepare () #11 0x02177de4 in g_main_context_prepare () #12 0x021784a6 in g_main_context_iterate () #13 0x02178bbd in g_main_loop_run () #14 0x01ca8a87 in gtk_main () #15 0x0184d888 in Gtk::Main::run () #16 0x00003ff1 in sp_main_gui () #17 0x00167234 in Inkscape::NSApplication::Application::run () #18 0x00002ef7 in main ()
JiHO --- http://jo.irisson.free.fr/

On Fri, 2007-11-30 at 01:56 +0100, jiho wrote:
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
I'd suggest putting a break point here, and then doing the backtrace.
gdb> break sp_document_get_resource_list
<gdb will break>
gdb> bt gdb> continue
--Ted

On 2007-November-30 , at 07:06 , Ted Gould wrote:
On Fri, 2007-11-30 at 01:56 +0100, jiho wrote:
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
I'd suggest putting a break point here, and then doing the backtrace.
gdb> break sp_document_get_resource_list
<gdb will break>
gdb> bt gdb> continue
Done. Here it is the complete gdb log (gdb) break sp_document_get_resource_list Breakpoint 1 at 0x6498 (gdb) r Starting program: /Users/jiho/Software/inkscape/trunk_devel/Build/bin/ inkscape Reading symbols for shared libraries .++.... +.............................................................++++.+++ ++++++............++..+++++++++++.++.....++++++++ done Reading symbols for shared libraries . done Reading symbols for shared libraries . done
Breakpoint 1, 0x00006498 in sp_document_get_resource_list () (gdb) bt #0 0x00006498 in sp_document_get_resource_list () #1 0x001098c9 in Inkscape::LayerManager::_rebuild () #2 0x0010a3eb in Inkscape::LayerManager::_setDocument () #3 0x0010a88d in Inkscape::LayerManager::LayerManager () #4 0x000dd489 in SPDesktop::init () #5 0x00271272 in sp_desktop_widget_new () #6 0x0000bbb0 in sp_file_new () #7 0x0000c913 in sp_file_new_default () #8 0x0000400d in sp_main_gui () #9 0x00167234 in Inkscape::NSApplication::Application::run () #10 0x00002ef7 in main () (gdb) c Continuing.
Breakpoint 1, 0x00006498 in sp_document_get_resource_list () (gdb) bt #0 0x00006498 in sp_document_get_resource_list () #1 0x002a5cec in gr_vector_list () #2 0x002a6d1b in gr_change_widget () #3 0x002a7ed8 in sp_gradient_toolbox_new () #4 0x002a0965 in setup_aux_toolbox () #5 0x0029f156 in toolbox_set_desktop () #6 0x00271428 in sp_desktop_widget_new () #7 0x0000bbb0 in sp_file_new () #8 0x0000c913 in sp_file_new_default () #9 0x0000400d in sp_main_gui () #10 0x00167234 in Inkscape::NSApplication::Application::run () #11 0x00002ef7 in main () (gdb) c Continuing. Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done
Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x0000003c 0x93360ce6 in _handleWindowNeedsDisplay () (gdb) bt #0 0x93360ce6 in _handleWindowNeedsDisplay () #1 0x9082dd0e in __CFRunLoopDoObservers () #2 0x9082cdb0 in CFRunLoopRunSpecific () #3 0x9082ca6e in CFRunLoopRunInMode () #4 0x92def878 in RunCurrentEventLoopInMode () #5 0x92deeeb9 in ReceiveNextEventCommon () #6 0x92deedd9 in BlockUntilNextEventMatchingListInMode () #7 0x93295485 in _DPSNextEvent () #8 0x93295076 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #9 0x00daadb6 in gdk_event_prepare () #10 0x02177de4 in g_main_context_prepare () #11 0x021784a6 in g_main_context_iterate () #12 0x02178bbd in g_main_loop_run () #13 0x01ca8a87 in gtk_main () #14 0x0184d888 in Gtk::Main::run () #15 0x00003ff1 in sp_main_gui () #16 0x00167234 in Inkscape::NSApplication::Application::run () #17 0x00002ef7 in main () (gdb)
But that's not very informative maybe.Should I recompile Inkscape with -g, would it be better?
BTW Inkview runs fine.
JiHO --- http://jo.irisson.free.fr/

Ah, this is a bug in Inkscape::LayerManager::_rebuild(). Everything after the call to _clear() should be skipped if _document is NULL.
Feel free commit a fix along those lines, I may not get to it soon.
-mental

On 2007-November-30 , at 20:40 , J.B.C.Engelen@...1578... wrote:
Mental:
Ah, this is a bug in Inkscape::LayerManager::_rebuild(). Everything after the call to _clear() should be skipped if _document is NULL.
Feel free commit a fix along those lines, I may not get to it soon.
Done.
Thanks a lot. Unfortunately this got rid of the first messages[1] but Inkscape still crashes with the message: $ ./inkscape
Emergency save activated! Emergency save completed. Inkscape will close now. If you can reproduce this crash, please file a bug at www.inkscape.org with a detailed description of the steps leading to the crash, so we can fix it.
(inkscape:385): GLib-WARNING **: g_main_loop_run(): called recursively from within a source's check() or prepare() member, iteration not possible.
Gdb log with a break points where I thought they could be useful:
(gdb) b _handleWindowNeedsDisplay Function "_handleWindowNeedsDisplay" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (_handleWindowNeedsDisplay) pending. (gdb) r Starting program: /Users/jiho/Software/inkscape/trunk_devel/Build/bin/ inkscape Reading symbols for shared libraries .++.... +.............................................................++++.+++ ++++++............++..+++++++++++.++.....++++++++ done Breakpoint 1 at 0x93360cc4 Pending breakpoint 1 - "_handleWindowNeedsDisplay" resolved Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done
Breakpoint 1, 0x93360cc4 in _handleWindowNeedsDisplay ()
At this point the main window has appeared but is empty (just
grey without even icons)
(gdb) bt #0 0x93360cc4 in _handleWindowNeedsDisplay () #1 0x9082dd0e in __CFRunLoopDoObservers () #2 0x9082cdb0 in CFRunLoopRunSpecific () #3 0x9082ca6e in CFRunLoopRunInMode () #4 0x92def878 in RunCurrentEventLoopInMode () #5 0x92deeeb9 in ReceiveNextEventCommon () #6 0x92deedd9 in BlockUntilNextEventMatchingListInMode () #7 0x93295485 in _DPSNextEvent () #8 0x93295076 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #9 0x00dbfdb6 in gdk_event_prepare () #10 0x0217ade4 in g_main_context_prepare () #11 0x0217b4a6 in g_main_context_iterate () #12 0x0217bbbd in g_main_loop_run () #13 0x01ca8a87 in gtk_main () #14 0x0184d888 in Gtk::Main::run () #15 0x00004771 in sp_main_gui () #16 0x001679bc in Inkscape::NSApplication::Application::run () #17 0x00003677 in main () (gdb) s Single stepping until exit from function _handleWindowNeedsDisplay, which has no line number information. 0x9082dd0e in __CFRunLoopDoObservers ()
At this point icons appeared. However this point cannot always
be reached. Most of the time, stepping from there reaches the EXC_BAD_ACCESS failure below directly.
(gdb) s Single stepping until exit from function __CFRunLoopDoObservers, which has no line number information.
Breakpoint 1, 0x93360cc4 in _handleWindowNeedsDisplay () (gdb) s Single stepping until exit from function _handleWindowNeedsDisplay, which has no line number information.
Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x0000003c 0x93360ce6 in _handleWindowNeedsDisplay ()
Is there something else I can do? _handleWindowNeedsDisplay is not Inkscape nor GTK specific, all OS X programs use this apparently (so it must be gtk-quartz related but not gtk in itself). However I guess there must be a way of tracking down what causes it to fail more properly.
Thanks in advance for your help.
[1] previous error message:
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
Emergency save activated! Emergency save completed. Inkscape will close now. If you can reproduce this crash, please file a bug at www.inkscape.org with a detailed description of the steps leading to the crash, so we can fix it.
(inkscape:9060): GLib-WARNING **: g_main_loop_run(): called recursively from within a source's check() or prepare() member, iteration not possible.
JiHO --- http://jo.irisson.free.fr/

jiho,
Have you posted this to the GTK+ list? I don't know of anything that we can do here for this one. Now that Novell is looking at shipping Mono and GTK# for OSX I'm hoping it'll be getting even more attention.
Also, if it does become a GTK+ bug could you link it into our bug tracker so if someone else tries they'd find it. Thanks.
--Ted
On Sat, 2007-12-01 at 12:40 +0100, jiho wrote:
On 2007-November-30 , at 20:40 , J.B.C.Engelen@...1578... wrote:
Mental:
Ah, this is a bug in Inkscape::LayerManager::_rebuild(). Everything after the call to _clear() should be skipped if _document is NULL.
Feel free commit a fix along those lines, I may not get to it soon.
Done.
Thanks a lot. Unfortunately this got rid of the first messages[1] but Inkscape still crashes with the message: $ ./inkscape
Emergency save activated! Emergency save completed. Inkscape will close now. If you can reproduce this crash, please file a bug at www.inkscape.org with a detailed description of the steps leading to the crash, so we can fix it.
(inkscape:385): GLib-WARNING **: g_main_loop_run(): called recursively from within a source's check() or prepare() member, iteration not possible.
Gdb log with a break points where I thought they could be useful:
(gdb) b _handleWindowNeedsDisplay Function "_handleWindowNeedsDisplay" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (_handleWindowNeedsDisplay) pending. (gdb) r Starting program: /Users/jiho/Software/inkscape/trunk_devel/Build/bin/ inkscape Reading symbols for shared libraries .++.... +.............................................................++++.+++ ++++++............++..+++++++++++.++.....++++++++ done Breakpoint 1 at 0x93360cc4 Pending breakpoint 1 - "_handleWindowNeedsDisplay" resolved Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done
Breakpoint 1, 0x93360cc4 in _handleWindowNeedsDisplay ()
At this point the main window has appeared but is empty (just
grey without even icons)
(gdb) bt #0 0x93360cc4 in _handleWindowNeedsDisplay () #1 0x9082dd0e in __CFRunLoopDoObservers () #2 0x9082cdb0 in CFRunLoopRunSpecific () #3 0x9082ca6e in CFRunLoopRunInMode () #4 0x92def878 in RunCurrentEventLoopInMode () #5 0x92deeeb9 in ReceiveNextEventCommon () #6 0x92deedd9 in BlockUntilNextEventMatchingListInMode () #7 0x93295485 in _DPSNextEvent () #8 0x93295076 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #9 0x00dbfdb6 in gdk_event_prepare () #10 0x0217ade4 in g_main_context_prepare () #11 0x0217b4a6 in g_main_context_iterate () #12 0x0217bbbd in g_main_loop_run () #13 0x01ca8a87 in gtk_main () #14 0x0184d888 in Gtk::Main::run () #15 0x00004771 in sp_main_gui () #16 0x001679bc in Inkscape::NSApplication::Application::run () #17 0x00003677 in main () (gdb) s Single stepping until exit from function _handleWindowNeedsDisplay, which has no line number information. 0x9082dd0e in __CFRunLoopDoObservers ()
At this point icons appeared. However this point cannot always
be reached. Most of the time, stepping from there reaches the EXC_BAD_ACCESS failure below directly.
(gdb) s Single stepping until exit from function __CFRunLoopDoObservers, which has no line number information.
Breakpoint 1, 0x93360cc4 in _handleWindowNeedsDisplay () (gdb) s Single stepping until exit from function _handleWindowNeedsDisplay, which has no line number information.
Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x0000003c 0x93360ce6 in _handleWindowNeedsDisplay ()
Is there something else I can do? _handleWindowNeedsDisplay is not Inkscape nor GTK specific, all OS X programs use this apparently (so it must be gtk-quartz related but not gtk in itself). However I guess there must be a way of tracking down what causes it to fail more properly.
Thanks in advance for your help.
[1] previous error message:
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
** (inkscape:9060): CRITICAL **: const GSList* sp_document_get_resource_list(SPDocument*, const gchar*): assertion `document != NULL' failed
Emergency save activated! Emergency save completed. Inkscape will close now. If you can reproduce this crash, please file a bug at www.inkscape.org with a detailed description of the steps leading to the crash, so we can fix it.
(inkscape:9060): GLib-WARNING **: g_main_loop_run(): called recursively from within a source's check() or prepare() member, iteration not possible.
JiHO
participants (4)
-
unknown@example.com
-
jiho
-
MenTaLguY
-
Ted Gould