python: double free or corruption (out)

Bug #1017914 reported by Angel Guzman Maeso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GStreamer
Fix Released
Medium
gstreamer0.10 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Testing the code attached and extracted from

http://bazaar.launchpad.net/~jderose/+junk/gst-examples/view/head:/webcam-1.0

https://wiki.ubuntu.com/Novacut/GStreamer1.0

*** glibc detected *** python: double free or corruption (out): 0xb3467ed0 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x73e42)[0xb73a5e42]
/usr/lib/i386-linux-gnu/libX11.so.6(+0x368ff)[0xb624f8ff]
/usr/lib/i386-linux-gnu/libX11.so.6(_XEventsQueued+0x68)[0xb62503e8]
/usr/lib/i386-linux-gnu/libX11.so.6(XPending+0x68)[0xb6241188]
/usr/lib/i386-linux-gnu/libgdk-3.so.0(+0x4ad64)[0xb63a4d64]
/usr/lib/i386-linux-gnu/libgdk-3.so.0(+0x4add3)[0xb63a4dd3]
/lib/i386-linux-gnu/libglib-2.0.so.0(g_main_context_check+0x19f)[0xb6d6583f]
/lib/i386-linux-gnu/libglib-2.0.so.0(+0x46d02)[0xb6d65d02]
/lib/i386-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0x7b)[0xb6d6624b]
/usr/lib/i386-linux-gnu/libgtk-3.so.0(gtk_main+0x9d)[0xb6584d5d]
/usr/lib/i386-linux-gnu/libffi.so.6(ffi_call_SYSV+0x1a)[0xb6bb535a]
/usr/lib/i386-linux-gnu/libffi.so.6(ffi_call+0x6f)[0xb6bb508f]
/usr/lib/libgirepository-1.0.so.1(g_callable_info_invoke+0x38d)[0xb6e735cd]
/usr/lib/libgirepository-1.0.so.1(g_function_info_invoke+0xa4)[0xb6e74ba4]
/usr/lib/python2.7/dist-packages/gi/_gi.so(+0x1155a)[0xb6ede55a]
/usr/lib/python2.7/dist-packages/gi/_gi.so(+0x12260)[0xb6edf260]
python(PyEval_EvalFrameEx+0x3ead)[0x808c7bd]
python(PyEval_EvalCodeEx+0x150)[0x81a7d70]
python(PyEval_EvalFrameEx+0x6cc)[0x8088fdc]
python(PyEval_EvalFrameEx+0x7bc)[0x80890cc]
python(PyEval_EvalCodeEx+0x150)[0x81a7d70]
python(PyRun_SimpleFileExFlags+0x2c1)[0x8151e21]
python(Py_Main+0x559)[0x815a4d9]
python(main+0x1b)[0x805e78b]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb734b4d3]
python[0x805e7b1]
======= Memory map: ========
08048000-0829f000 r-xp 00000000 08:07 3015493 /usr/bin/python2.7
0829f000-082a0000 r--p 00256000 08:07 3015493 /usr/bin/python2.7
082a0000-082f5000 rw-p 00257000 08:07 3015493 /usr/bin/python2.7
082f5000-08301000 rw-p 00000000 00:00 0
09ec1000-0a284000 rw-p 00000000 00:00 0 [heap]
b2a00000-b2c80000 rw-s 00780000 00:05 8935 /dev/video0
b2c80000-b2f00000 rw-s 00500000 00:05 8935 /dev/video0
b2f00000-b3180000 rw-s 00280000 00:05 8935 /dev/video0
b3180000-b3400000 rw-s 00000000 00:05 8935 /dev/video0
b3400000-b346d000 rw-p 00000000 00:00 0
b346d000-b3500000 ---p 00000000 00:00 0
b353b000-b353c000 ---p 00000000 00:00 0
b353c000-b3d3c000 rw-p 00000000 00:00 0 [stack:6249]
b3d3c000-b3d80000 r-xp 00000000 08:07 3039227 /usr/lib/i386-linux-gnu/libjpeg.so.8.0.2
b3d80000-b3d81000 r--p 00043000 08:07 3039227 /usr/lib/i386-linux-gnu/libjpeg.so.8.0.2
b3d81000-b3d82000 rw-p 00044000 08:07 3039227 /usr/lib/i386-linux-gnu/libjpeg.so.8.0.2
b3d82000-b3d92000 rw-p 00000000 00:00 0
b3d92000-b3db6000 r-xp 00000000 08:07 3019345 /usr/lib/i386-linux-gnu/libv4lconvert.so.0
b3db6000-b3db7000 r--p 00024000 08:07 3019345 /usr/lib/i386-linux-gnu/libv4lconvert.so.0
b3db7000-b3db8000 rw-p 00025000 08:07 3019345 /usr/lib/i386-linux-gnu/libv4lconvert.so.0
b3db8000-b3e0a000 rw-p 00000000 00:00 0
b3e35000-b3e36000 ---p 00000000 00:00 0
b3e36000-b4636000 rw-p 00000000 00:00 0 [stack:6248]
b4636000-b46c1000 r-xp 00000000 08:07 3045207 /usr/lib/i386-linux-gnu/liborc-0.4.so.0.16.0
b46c1000-b46c2000 r--p 0008a000 08:07 3045207 /usr/lib/i386-linux-gnu/liborc-0.4.so.0.16.0
b46c2000-b46c6000 rw-p 0008b000 08:07 3045207 /usr/lib/i386-linux-gnu/liborc-0.4.so.0.16.0
b46c6000-b46fb000 r-xp 00000000 08:07 3014814 /usr/lib/i386-linux-gnu/libgstvideo-1.0.so.0.0.0
b46fb000-b46fc000 ---p 00035000 08:07 3014814 /usr/lib/i386-linux-gnu/libgstvideo-1.0.so.0.0.0
b46fc000-b46fd000 r--p 00035000 08:07 3014814 /usr/lib/i386-linux-gnu/libgstvideo-1.0.so.0.0.0
b46fd000-b4700000 rw-p 00036000 08:07 3014814 /usr/lib/i386-linux-gnu/libgstvideo-1.0.so.0.0.0
b4700000-b4721000 rw-p 00000000 00:00 0
b4721000-b4800000 ---p 00000000 00:00 0
b481a000-b483e000 r-xp 00000000 08:07 331428 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
b483e000-b483f000 r--p 00023000 08:07 331428 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
b483f000-b4840000 rw-p 00024000 08:07 331428 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
b4840000-b4897000 r-xp 00000000 08:07 3015457 /usr/lib/i386-linux-gnu/libgstbase-1.0.so.0.0.0
b4897000-b4898000 r--p 00056000 08:07 3015457 /usr/lib/i386-linux-gnu/libgstbase-1.0.so.0.0.0
b4898000-b4899000 rw-p 00057000 08:07 3015457 /usr/lib/i386-linux-gnu/libgstbase-1.0.so.0.0.0
b4899000-b48e3000 r-xp 00000000 08:07 295096 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstcoreelements.so
b48e3000-b48e4000 r--p 00049000 08:07 295096 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstcoreelements.so
b48e4000-b48e5000 rw-p 0004a000 08:07 295096 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstcoreelements.so
b48e5000-b48e6000 ---p 00000000 00:00 0
b48e6000-b50e6000 rw-p 00000000 00:00 0 [stack:6239]
b50e6000-b51d0000 r-xp 00000000 08:07 3015501 /usr/lib/i386-linux-gnu/libgstreamer-1.0.so.0.0.0
b51d0000-b51d3000 r--p 000ea000 08:07 3015501 /usr/lib/i386-linux-gnu/libgstreamer-1.0.so.0.0.0
b51d3000-b51d4000 rw-p 000ed000 08:07 3015501 /usr/lib/i386-linux-gnu/libgstreamer-1.0.so.0.0.0
b51d4000-b51d5000 rw-p 00000000 00:00 0
b51db000-b51e3000 r-xp 00000000 08:07 3030507 /usr/lib/i386-linux-gnu/libv4l2.so.0
b51e3000-b51e4000 r--p 00007000 08:07 3030507 /usr/lib/i386-linux-gnu/libv4l2.so.0
b51e4000-b51e8000 rw-p 00008000 08:07 3030507 /usr/lib/i386-linux-gnu/libv4l2.so.0
b51e8000-b51ec000 r-xp 00000000 08:07 3037220 /usr/lib/i386-linux-gnu/libXv.so.1.0.0
b51ec000-b51ed000 r--p 00003000 08:07 3037220 /usr/lib/i386-linux-gnu/libXv.so.1.0.0
b51ed000-b51ee000 rw-p 00004000 08:07 3037220 /usr/lib/i386-linux-gnu/libXv.so.1.0.0
b51ee000-b51fe000 r-xp 00000000 08:07 298598 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstxvimagesink.so
b51fe000-b51ff000 r--p 0000f000 08:07 298598 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstxvimagesink.so
b51ff000-b5200000 rw-p 00010000 08:07 298598 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstxvimagesink.so
b5200000-b5221000 rw-p 00000000 00:00 0
b5221000-b5300000 ---p 00000000 00:00 0
b5305000-b530d000 r-xp 00000000 08:07 331384 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstautodetect.so
b530d000-b530e000 r--p 00007000 08:07 331384 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstautodetect.so
b530e000-b530f000 rw-p 00008000 08:07 331384 /usr/lib/i386-linux-gnu/gstreamer-1.0/libgstautodetect.so
b530f000-b5318000 r--p 00000000 08:07 1313986 /usr/share/locale/es/LC_MESSAGES/gstreamer-1.0.mo
b5318000-b5322000 r--p 00000000 08:07 3029860 /usr/lib/girepository-1.0/GstBase-1.0.typelibAbortado (`core' generado)

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: python2.7 2.7.3-0ubuntu3
ProcVersionSignature: Ubuntu 3.5.0-1.1-generic 3.5.0-rc3
Uname: Linux 3.5.0-1-generic i686
ApportVersion: 2.2.5-0ubuntu1
Architecture: i386
Date: Tue Jun 26 14:21:37 2012
InstallationMedia:

ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
SourcePackage: python2.7
UpgradeStatus: Upgraded to quantal on 2012-06-05 (21 days ago)

Revision history for this message
Angel Guzman Maeso (shakaran) wrote :
Revision history for this message
Angel Guzman Maeso (shakaran) wrote :
Revision history for this message
Angel Guzman Maeso (shakaran) wrote :

On followings calls to the program, it generates core dumps or this message:

prepare-window-handle
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:273: poll_for_event: La declaración `!xcb_xlib_threads_sequence_lost' no se cumple.

It is difficult to reproduce, but there are some memory corruption, probably with some module that try to release memory twice

Revision history for this message
Angel Guzman Maeso (shakaran) wrote :

I filled a upstream bug more complete on gstreamer https://bugzilla.gnome.org/show_bug.cgi?id=678897

The problem seems is with gstreamer that raises the segfault on python.

Julian Taylor (jtaylor)
Changed in gstreamer:
importance: Undecided → Unknown
status: New → Unknown
affects: python2.7 (Ubuntu) → gstreamer0.10 (Ubuntu)
Changed in gstreamer:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Hi everyone, thanks for filing this bug and for testing my tutorial examples!

I was out-of-touch with some Gtk changes... you can no longer get the XID inside the prepare-xwindow-id/prepare-window-handle callback. Instead, you need to get the XID after you call window.show_all(), before you call Gtk.main().

I updated my examples with this fix:

http://bazaar.launchpad.net/~jderose/+junk/gst-examples/view/head:/webcam-1.0

http://bazaar.launchpad.net/~jderose/+junk/gst-examples/view/head:/webcam-0.10

And I also made a note about this in my porting guide:

https://wiki.ubuntu.com/Novacut/GStreamer1.0#prepare-xwindow-id

Big thanks to Tim-Philipp Müller (__tim in the #gstreamer IRC channel) for pointing this out. Sorry to lead people astray!

Curtis Hovey (sinzui)
affects: python → obsolete-junk
no longer affects: obsolete-junk
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.