[gst-devel] weird glib behaviour

Ronald Bultje rbultje at ronald.bitfreak.net
Fri Nov 30 00:37:01 CET 2001


Hi all,

I'm completely confused.... Have been trying to get the v4l stuff to
work for some time now, still getting the same errors.

Here's a run of gstreamer-launch in gdb (v4lsrc):

--------------------------------------------------
[29 Nov - rbultje at tux tools]# libtool gdb ./gstreamer-launch
[...]
(gdb) set args v4lsrc device=/dev/video1 width=352 height=288 !
sdlvideosink
(gdb) run
Starting program:
/home/rbultje/mjpeg/gstreamer/tools/.libs/lt-gstreamer-launch v4lsrc
device=/dev/video1 width=352 height=288 ! sdlvideosink
[New Thread 1024 (LWP 13196)]
INFO (13196:-1) Initializing GStreamer Core Library
INFO (13196:-1) CPU features: (0c040843) MMX 

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 13196)]
0x0 in ?? ()
(gdb) bt
#0  0x0 in ?? ()
#1  0x40020115 in gst_v4lsrc_set_property (object=0x8068218, 
    prop_id=13, value=0x807ebd0, pspec=0x0) at gstv4lsrc.c:404
#2  0x4004188f in g_object_set_arg (object=0x8068218, 
    arg=0x807ebd0, id=13) at gobject2gtk.c:51
#3  0x40128351 in gtk_object_arg_set (object=0x8068218, 
    arg=0x807ebd0, info=0x8068150) at gtkobject.c:809
#4  0x40128139 in gtk_object_set (object=0x8068218, 
    first_arg_name=0x81082e0 "device") at gtkobject.c:751
#5  0x4005f53c in gst_util_set_object_arg (object=0x8068218, 
    name=0x81082e0 "device", value=0x81082e7 "/dev/video1")
    at gstutils.c:331
#6  0x40060ab0 in gst_parse_launch_cmdline (argc=6, argv=0x8108388, 
    parent=0x8108db0, priv=0xbffff720) at gstparse.c:241
#7  0x40061732 in gst_parse_launch (
    cmdline=0x8108280 "v4lsrc device=/dev/video1 width=352 height=288 !
sdlvideosink", parent=0x8108db0) at gstparse.c:573
#8  0x8049550 in main (argc=7, argv=0xbffff804)
    at gstreamer-launch.c:155
#9  0x403a9f31 in __libc_start_main (main=0x80493ec <main>, argc=7, 
    ubp_av=0xbffff804, init=0x8048d70 <_init>, 
    fini=0x804968c <_fini>, rtld_fini=0x4000e274 <_dl_fini>, 
    stack_end=0xbffff7fc) at ../sysdeps/generic/libc-start.c:129
(gdb) 
--------------------------------------------------

The crash seems to be at parent_class->set_property() in
gst_v4lsrc_set_property, although parent_class should have
set_property() defined... I don't get that. I could use
gst_v4lelement_set_property directly but that's pretty ugly.

Here's a run with v4lmjpegsrc, when I don't use any args (not needed),
so I shouldn't be getting this parent_class->set_property() error:
--------------------------------------------------
[29 Nov - rbultje at tux tools]# libtool gdb ./gstreamer-launch
[...]
(gdb) set args v4lmjpegsrc ! jpegdec ! sdlvideosink
(gdb) run
Starting program:
/home/rbultje/mjpeg/gstreamer/tools/.libs/lt-gstreamer-launch
v4lmjpegsrc ! jpegdec ! sdlvideosink
[New Thread 1024 (LWP 13229)]
INFO (13229:-1) Initializing GStreamer Core Library
INFO (13229:-1) CPU features: (0c040843) MMX 

Gtk-ERROR **: file gtkarg.c: line 316 (gtk_args_query_foreach):
assertion failed: (key == value)
aborting...

Program received signal SIGABRT, Aborted.
[Switching to Thread 1024 (LWP 13229)]
0x403badd1 in __kill () from /lib/libc.so.6
(gdb) bt
#0  0x403badd1 in __kill () from /lib/libc.so.6
#1  0x4007bd5b in raise (sig=6) at signals.c:65
#2  0x403bc352 in abort () at ../sysdeps/generic/abort.c:88
#3  0x401f28c2 in g_logv (log_domain=0x40182c4e "Gtk", 
    log_level=G_LOG_LEVEL_ERROR, 
    format=0x40182f60 "file %s: line %d (%s): assertion failed: (%s)",
args1=0xbffff64c) at gmessages.c:391
#4  0x401f2963 in g_log (log_domain=0x40182c4e "Gtk", 
    log_level=G_LOG_LEVEL_ERROR, 
    format=0x40182f60 "file %s: line %d (%s): assertion failed: (%s)")
at gmessages.c:408
#5  0x400ae00c in gtk_args_query_foreach (key=0x8067ef8, 
    value=0x8067f78, user_data=0xbffff6e0) at gtkarg.c:316
#6  0x401ed2a0 in g_hash_table_foreach (hash_table=0x806afa0, 
    func=0x400adfbc <gtk_args_query_foreach>, user_data=0xbffff6e0)
    at ghash.c:300
#7  0x400ae0e7 in gtk_args_query (class_type=44821, 
    arg_info_hash_table=0x806afa0, arg_flags=0xbffff754, 
    n_args_p=0xbffff758) at gtkarg.c:347
#8  0x40128ac8 in gtk_object_query_args (class_type=44821, 
    arg_flags=0xbffff754, n_args=0xbffff758) at gtkobject.c:1009
#9  0x8049201 in arg_search (bin=0x8108db8, 
    argname=0x8049791 "xid", handler=0x80492bc <xid_handler>, 
    priv=0x0) at gstreamer-launch.c:45
#10 0x80495b3 in main (argc=6, argv=0xbffff814)
    at gstreamer-launch.c:166
#11 0x403a9f31 in __libc_start_main (main=0x80493ec <main>, argc=6, 
    ubp_av=0xbffff814, init=0x8048d70 <_init>, 
    fini=0x804968c <_fini>, rtld_fini=0x4000e274 <_dl_fini>, 
    stack_end=0xbffff80c) at ../sysdeps/generic/libc-start.c:129
(gdb)
--------------------------------------------------
And here, I'm totally lost... This is all inside gstreamer-launch and
gtk, not in my plugin...

Here's a bit of gtkarg.c, where the error takes place (this is gtk):

static void
gtk_args_query_foreach (gpointer key,
			gpointer value,
			gpointer user_data)
{
  register GtkArgInfo *info;
  register GtkArgQueryData *data;

  g_assert (key == value); /* paranoid */

  info = value;
  data = user_data;

  if (info->class_type == data->class_type)
    data->arg_list = g_list_prepend (data->arg_list, info);
}
http://www.mit.edu/afs/sipb/project/gnome/old-and-dead/oldstuff/src/gtk+/gtk/gtkarg.c

g_assert(key == value) is where it's failing....

Anyway, my thoughts are that I did something stupid in the object-setup
within the v4l plugins. v4lelement is a parent class (it's a
gstelement), v4lsrc/v4lmjpegsrc are both v4lelements.

The code is available at
http://ronal.bitfreak.net/download/v4l_patch.tar.gz - just unpack it to
the v4l directory in gstreamer/plugins/cpture/v4l (it replaces the old
v4l plugin). If someone can have a look at it and tell me what I did
wrong, I'd be very happy.

Thanks,

Ronald


-- 
-   .-.
-   /V\    | Ronald Bultje <rbultje at ronald.bitfreak.net>
-  // \\   | Running: Linux 2.4.14-XFS and OpenBSD 2.8
- /(   )\  | http://ronald.bitfreak.net/
-  ^^-^^





More information about the gstreamer-devel mailing list