Good day

I'm hitting quite a puzzler here with a project I'm working on. It's 
meant to be a simple controllable X-based player for video and html 
sources. The html sources are to be put in a mozilla widget that 
overlays on top of the video. The video is played by getting mplayer to 
play within a gtk widget. There are 2 mplayer "widgets" and one embedded 
mozilla widget. Most of the former information is just background...

The problem comes in when launching the application from the command 
line. At the point of calling gtk_fixed_put(), referencing a fixed 
container and the embedded mozilla widget, the application segfaults and 
dies. A trace with valgrind shows the following:

==32212== Invalid read of size 4
==32212==    at 0x479C090: (within /usr/lib/firefox/libgtkembedmoz.so)
==32212==    by 0x479A84A: (within /usr/lib/firefox/libgtkembedmoz.so)
==32212==    by 0x46AAC08: g_cclosure_marshal_VOID__VOID (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x469BF88: (within /usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x469D771: g_closure_invoke (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x46AE7B9: (within /usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x46AF846: g_signal_emit_valist (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x46AFA08: g_signal_emit (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x42BCADC: gtk_widget_realize (in 
/usr/lib/libgtk-x11-2.0.so.0.1200.0)
==32212==    by 0x42BCDC8: gtk_widget_map (in 
/usr/lib/libgtk-x11-2.0.so.0.1200.0)
==32212==    by 0x40FC234: (within /usr/lib/libgtk-x11-2.0.so.0.1200.0)
==32212==    by 0x4148E87: (within /usr/lib/libgtk-x11-2.0.so.0.1200.0)
==32212==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32212==
==32212== Process terminating with default action of signal 11 (SIGSEGV)
==32212==  Access not within mapped region at address 0x0
==32212==    at 0x479C090: (within /usr/lib/firefox/libgtkembedmoz.so)
==32212==    by 0x479A84A: (within /usr/lib/firefox/libgtkembedmoz.so)
==32212==    by 0x46AAC08: g_cclosure_marshal_VOID__VOID (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x469BF88: (within /usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x469D771: g_closure_invoke (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x46AE7B9: (within /usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x46AF846: g_signal_emit_valist (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x46AFA08: g_signal_emit (in 
/usr/lib/libgobject-2.0.so.0.1400.1)
==32212==    by 0x42BCADC: gtk_widget_realize (in 
/usr/lib/libgtk-x11-2.0.so.0.1200.0)
==32212==    by 0x42BCDC8: gtk_widget_map (in 
/usr/lib/libgtk-x11-2.0.so.0.1200.0)
==32212==    by 0x40FC234: (within /usr/lib/libgtk-x11-2.0.so.0.1200.0)
==32212==    by 0x4148E87: (within /usr/lib/libgtk-x11-2.0.so.0.1200.0)


The code leading up to this (I've stripped out the stuff to do with the 
mplayer embedded widgets) is:

    this->mozWidget = gtk_moz_embed_new();
    cout << "Container: " << this->fixedContainer << "; mozWidget: " << 
this->mozWidget << endl;
    cout << "moz parent: " << 
gtk_widget_get_parent(GTK_WIDGET(this->mozWidget));
    gtk_widget_show(this->mozWidget);
    gtk_widget_set_size_request(this->mozWidget, 0, 0);
    gtk_fixed_put(GTK_FIXED(this->fixedContainer), this->mozWidget, 
(gint)0, (gint)0);

where this->fixedContainer is a reference to a Gtk fixed container 
belonging to the MainWin class.

Like I say, the crash out happens at the gtk_fixed_out line -- but 
here's the real weirdness: if I launch the application from withing 
eclipse (using Ctrl-F11, which is just a normal run, no debugger or 
anything), the application runs without a problem. Checking the process 
table, there's no funniness in how the application is being run: it's 
simply being run as 
/home/daf/code/onedigital/gtkmmplayer/Debug/gtkmmplayer (no extra 
arguments or anything)

I have to admit that this has me quite stumped. If I remove the 
gtk_fixed_put call, then the app starts correctly, but I never get to 
see my mozilla widget, even if I call that gtk_fixed_put at a later 
stage. I would appreciate any insight into this.

System specifications are:
Disitribution: Ubuntu 7.10
g++/gcc version: 4.1.3
firefox version:  2.0.0.10+2nobinonly-0ubuntu1.7.10.1
eclipse version: 3.2

Please let me know if there's any other information I can furnish.

-d
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to