Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169590 - media-video/kino-0.9.5 seg faults
Summary: media-video/kino-0.9.5 seg faults
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-06 10:18 UTC by DEMAINE Benoît-Pierre, aka DoubleHP
Modified: 2007-03-25 09:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
media-video:kino-0.9.5:20070306-100347.log (media-video:kino-0.9.5:20070306-100347.log,110.62 KB, text/plain)
2007-03-06 10:21 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details
/tmp/strace (strace,32.63 KB, text/plain)
2007-03-06 10:51 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details
media-libs:libquicktime-0.9.10:20070209-164517.log (media-libs:libquicktime-0.9.10:20070209-164517.log,193.24 KB, text/plain)
2007-03-06 13:13 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 10:18:47 UTC
dhp@moon_gen_2:~$ kino
> help language code en

Kino experienced a segmentation fault.
Dumping stack from the offending thread

Obtained 10 stack frames.
kino [0x8074c71]
[0xffffe420]
/usr/lib/libgthread-1.2.so.0 [0xb7e7318d]
/usr/lib/libglib-2.0.so.0(g_slice_alloc+0x3c5) [0xb761a865]
/usr/lib/libglib-2.0.so.0(g_hash_table_new_full+0x29) [0xb75f6f59]
/usr/lib/libglib-2.0.so.0(g_hash_table_new+0x28) [0xb75f6fd8]
/usr/lib/libglib-2.0.so.0(g_intern_static_string+0x192) [0xb75f0532]
/usr/lib/libgobject-2.0.so.0(g_type_init_with_debug_flags+0x14f) [0xb768f65f]
/usr/lib/libgobject-2.0.so.0(g_type_init+0x12) [0xb768f7d2]
/usr/lib/libgdk-x11-2.0.so.0(gdk_pre_parse_libgtk_only+0x46) [0xb78a1ce6]

Done dumping - exiting.
dhp@moon_gen_2:~$

I dont have very much more to say ... never used it, wanted to try it, no clue what should happen ... but is obviously "abnormal".
Comment 1 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 10:20:01 UTC
emerge --info: http://bugs.gentoo.org/attachment.cgi?id=111509&action=view
Comment 2 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 10:21:32 UTC
Created attachment 112273 [details]
media-video:kino-0.9.5:20070306-100347.log
Comment 3 Alexis Ballier gentoo-dev 2007-03-06 10:30:35 UTC
Could you please read : 
http://www.gentoo.org/proj/en/qa/backtraces.xml

and post a more complete error ? 
Comment 4 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 10:51:35 UTC
Created attachment 112274 [details]
/tmp/strace

By the mean time, here are bits of strace. Lot to compile before gdbing.
Comment 5 Denis Dupeyron (RETIRED) gentoo-dev 2007-03-06 11:46:16 UTC
(In reply to comment #4)
> Lot to compile before gdbing.

Sure, thanks for your effort. I will look into it when you send us a backtrace.

Denis.
Comment 6 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 12:11:34 UTC
recompiled kino and =dev-libs/glib-1.2.10-r5 with added:
CFLAGS="-ggdb"
FEATURES="splitdebug"

dhp@moon_gen_2:~$ gdb kino
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /usr/bin/kino
[Thread debugging using libthread_db enabled]
[New Thread -1232042320 (LWP 16311)]
> help language code en

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1232042320 (LWP 16311)]
0xb6ab9db0 in pthread_mutex_trylock () from /lib/libpthread.so.0
(gdb) q
The program is running.  Exit anyway? (y or n) y
dhp@moon_gen_2:~$

shall I also recompile =dev-libs/glib-2.12.9 and libgtk+ ? (according to strace glib-1.2 should be the bugging part)
Comment 7 Alexis Ballier gentoo-dev 2007-03-06 12:29:02 UTC
seems to be due to the fact that it links with gthread 1.2, I grepper my kino emerge logs and found only links to gthread 2 and found the offending line in your emerge log : 
-lgthread


Now we have to figure why it wants to link with gthread 1 ;)

(btw you forgot the "bt full" part in your previous post, which is the interesting part ;) )
Comment 8 Alexis Ballier gentoo-dev 2007-03-06 12:32:37 UTC
could you please post the output you get from : 
pkg-config --cflags libquicktime
pkg-config --libs libquicktime

I think that libquicktime forces kino to link to gthread 1.
Comment 9 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 13:11:18 UTC
(In reply to comment #8)

root@moon_gen_2:~# pkg-config --cflags libquicktime
-I/usr/include/lqt
root@moon_gen_2:~# pkg-config --libs libquicktime
-lquicktime -lgthread -lm -lz -ldl
root@moon_gen_2:~# emerge -vp libquicktime

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-libs/libquicktime-0.9.10  USE="X aac alsa dv encode ffmpeg gtk jpeg lame mmx opengl png vorbis x264" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

want emerge -vep libquicktime ?
Comment 10 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 13:13:29 UTC
Created attachment 112284 [details]
media-libs:libquicktime-0.9.10:20070209-164517.log
Comment 11 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 13:16:26 UTC
(In reply to comment #7)

just ask ^^

dhp@moon_gen_2:~$ gdb kino
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) bt full
No stack.
(gdb) run
Starting program: /usr/bin/kino
[Thread debugging using libthread_db enabled]
[New Thread -1231919440 (LWP 30898)]
> help language code en

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1231919440 (LWP 30898)]
0xb6ad7db0 in pthread_mutex_trylock () from /lib/libpthread.so.0
(gdb) bt full
#0  0xb6ad7db0 in pthread_mutex_trylock () from /lib/libpthread.so.0
No symbol table info available.
#1  0xb7e5818d in g_mutex_trylock_posix_impl (mutex=0x0) at gthread-posix.c:78
        result = <value optimized out>
        __PRETTY_FUNCTION__ = "g_mutex_trylock_posix_impl"
#2  0xb75fe865 in g_slice_alloc () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#3  0xb75daf59 in g_hash_table_new_full () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#4  0xb75dafd8 in g_hash_table_new () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#5  0xb75d4532 in g_intern_static_string () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#6  0xb767365f in g_type_init_with_debug_flags () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#7  0xb76737d2 in g_type_init () from /usr/lib/libgobject-2.0.so.0
No symbol table info available.
#8  0xb7886ce6 in gdk_pre_parse_libgtk_only () from /usr/lib/libgdk-x11-2.0.so.0
No symbol table info available.
#9  0xb7a21fb1 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#10 0x00000006 in ?? ()
No symbol table info available.
#11 0xb75f47fa in g_option_context_parse () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#12 0xb7a21b5a in gtk_parse_args () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#13 0xb7a21bd4 in gtk_init_check () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#14 0xb7a21c14 in gtk_init () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#15 0x08074af0 in main (argc=1, argv=0xbfcaa3c4) at main.c:151
        parts = (gchar **) 0x8460020
        translations = (gchar **) 0x845e690
        locales = (const gchar * const *) 0x8460000
(gdb)


Which to me looks pretty much like strace's output ...

Note that at a time, I thought it was a problem with my locale being en_GB.ISO-8859-15 ... so, I do tests in a console where locale is C.
Comment 12 Alexis Ballier gentoo-dev 2007-03-06 13:18:08 UTC
got that here : 

$ pkg-config --libs libquicktime
-lquicktime -lpthread -lm -lz -ldl



while looking at your emerge log : 
checking for library containing pthread_create... -lgthread


while for me it finds pthread, which seems more sane ;)

Could please attach libquicktime config.log ?
Comment 13 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 13:22:08 UTC
(In reply to comment #12)

cf comment #10 ? :D

ldd says both kino and libquicktime are linked to libgthread-1.2.so.0 and libpthread.so.0 

Kino is also additionnally linked to libgthread-2.0.so.0

want compleet outputs ?
Comment 14 Alexis Ballier gentoo-dev 2007-03-06 13:36:00 UTC
yep libquicktime tries in its configure checks to look for pthread_create in gthread 1. I dunno if it's really wrong, but you're the first person I see that has it :)

Anyway, I've uploaded a hack : http://dev.gentoo.org/~aballier/kino-0.9.5-gthreads.patch

could you try it ?
could you also post the output of emerge -pv =dev-libs/glib-yourglib1.2-version ?


Denis any thoughts about this ? It should be sane also to remove gthread from libquicktime to prevent those kind of bugs, but as it's a lib I'd prefer to keep in sync with upstream.
Comment 15 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 13:46:59 UTC
(In reply to comment #14)
> Anyway, I've uploaded a hack :
> http://dev.gentoo.org/~aballier/kino-0.9.5-gthreads.patch

later ... soon.

> could you try it ?
> could you also post the output of emerge -pv =dev-libs/glib-yourglib1.2-version
> ?

Calculating dependencies... done!
[ebuild   R   ] dev-libs/glib-1.2.10-r5  USE="-hardened" 0 kB
Total: 1 package (1 reinstall), Size of downloads: 0 kB
Comment 16 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 14:48:10 UTC
(In reply to comment #14)
> http://dev.gentoo.org/~aballier/kino-0.9.5-gthreads.patch

what should I do with it to get it applied ?

put in /usr/portage/media-video/kino/files/ did not do ...
Comment 17 Alexis Ballier gentoo-dev 2007-03-06 14:56:31 UTC
add this line at the end of src unpack : 
epatch "${FILESDIR}/${P}-gthreads.patch"

and add : 
inherit eutils

at the top of the ebuild


(note that if you don't copy the modified ebuild and the patch it will be lost at the next emerge --sync )
Comment 18 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 15:54:12 UTC
Patch proposed at comments #14 and #17 allowed me to build a runnable program.

Waiting for merge, then I ll close.
Comment 19 Alexis Ballier gentoo-dev 2007-03-06 16:54:40 UTC
Can you also test exporting/importing a quicktime video ?

If quicktime is compiled against gthread 1 and kino gives him gthread 2, this will segfault also, and thus libquicktime will need to be fixed rather than kino.
Comment 20 DEMAINE Benoît-Pierre, aka DoubleHP 2007-03-06 18:06:28 UTC
not how to export to this format. Exporting to 3GPP worked (using ffmpeg)
Comment 21 Alexis Ballier gentoo-dev 2007-03-07 08:13:23 UTC
exporting to dv using dv quicktime should use libquicktime, for example in the terminal output I get : 

quicktime_encode_video_stub called
quicktime_delete_vcodec_stub called


which are from libquicktime.
Comment 22 Denis Dupeyron (RETIRED) gentoo-dev 2007-03-25 09:53:34 UTC
The fix looks rather harmless to me, so I have just committed it to cvs. I've used the following sed statement instead of Alexis' patch, but it does the same thing:

sed -i \
    -e '/\$(LIBQUICKTIME_LIBS) \\/d' \
    -e '/^[[:space:]]*\$(SRC_LIBS)/ a\
        \$(LIBQUICKTIME_LIBS) \\' \
    src/Makefile.in

Thanks Benoît-Pierre for your bug report, and thanks Alexis for your solution.

Denis.