Re: [gtk-osx-devel] Gdk::Pixbuf::create(Gdk::Window, int, int, int, int) on Mac LION



On 07/09/2012 11:20 PM, John Ralls wrote:
On Jul 10, 2012, at 2:46 AM, Jim Charlton wrote:

I am porting some gtkmm-3.0 code from Linux (Ubuntu) to Mac OS X (LION) on an x86_64 machine.

I have struggled to get gtkmm-3.0 and all of its dependencies installed but have managed to do so with jhbuild.

One last problem remains.  At one point in my code, I copy the image in a Gdk::Window associated with a DrawingArea object to a Pixbuf. I later use cairo to redraw this to restore the image.

The Linux code uses Gdk::Pixbuf::create() to copy the contents of the Gdk::Window to a Pixbuf.  That code segfaults with a bad_alloc error on the MAC.  Is there another way to do that?  Is there a way to copy the image in the Gdk::Window to a Cairo quartz surface?
I'm not familiar enough with pixbufs to help with a workaround, but I'd appreciate a bug report in bugzilla with a good stacktrace. If you didn't already, please rebuild with debugging symbols for at least cairo, gtkmm, gtk+, and gtk-pixbuf. Better still if you can debug into the segfault a bit  and find out where the bad pointer is coming from.

Regards,
John Ralls

I am actually running OSX (Lion 10.7) as a virtual machine on a Linux host.  As such, it run a bit slowly.  It may take me a while to rebuild the libraries with debugging.  But I will give it a try.  Here is the actual console message and the back trace from gdb (only my program was compiled with debugging).

(myprog:480): glibmm-CRITICAL **: Glib::Interface::Interface(const Glib::Interface_Class&): assertion `gobject_ != 0' failed

(myprog:480): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

(myprog:480): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(myprog:480): glibmm-ERROR **:
unhandled exception (type std::exception) in signal handler:
what: std::bad_alloc


Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000000101a64a34 in g_logv ()
(gdb) bt
#0  0x0000000101a64a34 in g_logv ()
#1  0x0000000101a64c8d in g_log ()
#2  0x000000010130737b in (anonymous namespace)::glibmm_unexpected_exception ()
#3  0x0000000101307709 in Glib::exception_handlers_invoke ()
#4  0x00000001003327d3 in Gtk::Widget_Class::motion_notify_event_callback ()
#5  0x0000000100d94fec in _gtk_marshal_BOOLEAN__BOXEDv ()
#6  0x00000001019a2e5a in g_type_class_meta_marshalv ()
#7  0x00000001019a2878 in _g_closure_invoke_va ()
#8  0x00000001019c7263 in g_signal_emit_valist ()
#9  0x00000001019c8c84 in g_signal_emit ()
#10 0x0000000100f9b044 in gtk_widget_event_internal ()
#11 0x0000000100f9a474 in gtk_widget_event ()
#12 0x0000000100d94743 in propagate_event_up ()
#13 0x0000000100d94b5d in propagate_event ()
#14 0x0000000100d94c7b in gtk_propagate_event ()
#15 0x0000000100d93205 in gtk_main_do_event ()
#16 0x000000010144b003 in _gdk_event_emit ()
#17 0x000000010147a9d8 in gdk_event_dispatch ()
#18 0x0000000101a586e0 in g_main_dispatch ()
#19 0x0000000101a59584 in g_main_context_dispatch ()
#20 0x0000000101a597e7 in g_main_context_iterate ()
#21 0x0000000101a59d84 in g_main_loop_run ()
#22 0x0000000100d9250b in gtk_main ()
#23 0x00000001002001fb in Gtk::Main::run_impl ()
#24 0x000000010020035c in Gtk::Main::run ()
#25 0x000000010001e480 in main (argc=1, argv=0x7fff5fbff100) at main.cc:489
(gdb)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]