Bug 543278 - Fatal error in "_XError" in /usr/bin/istanbul
Summary: Fatal error in "_XError" in /usr/bin/istanbul
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: istanbul
Version: 12
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jef Spaleta
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:730c4eb4246d5da068713679413...
: 533884 541816 544544 546148 547584 547595 547803 548009 548566 548734 548778 548887 550178 550370 550946 550947 551129 551628 551863 553965 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-02 03:39 UTC by Luya Tshimbalanga
Modified: 2011-02-28 19:53 UTC (History)
29 users (show)

Fixed In Version: 0.2.2-14.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-02 01:24:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (32.36 KB, text/plain)
2009-12-02 03:39 UTC, Luya Tshimbalanga
no flags Details
istanbul-0.2.2-12 backtrace (3.69 KB, text/plain)
2009-12-16 13:20 UTC, Petr Šplíchal
no flags Details
Backtrace from alternate thread (9.52 KB, text/plain)
2009-12-18 16:56 UTC, Dave Malcolm
no flags Details
Temp. fix preview video widget in save_window.py (644 bytes, patch)
2010-01-19 09:18 UTC, Johan Dobbelstein
no flags Details | Diff

Description Luya Tshimbalanga 2009-12-02 03:39:30 UTC
abrt 1.0.0 detected a crash.

Attached file: backtrace
cmdline: /usr/bin/python /usr/bin/istanbul
component: python
executable: /usr/bin/python
kernel: 2.6.31.5-127.fc12.i686
package: python-2.6.2-2.fc12
rating: 3
reason: Process was terminated by signal 6

Comment 1 Luya Tshimbalanga 2009-12-02 03:39:34 UTC
Created attachment 375298 [details]
File: backtrace

Comment 2 Dave Malcolm 2009-12-02 14:30:30 UTC
Thank you for reporting this bug.

How reproducable is this problem?  If you run the program from a terminal, is an error message printed?

What version of istanbul do you have installed?

Looking at the backtrace, it looks like the problem occurred in thread #1 in _XError.  

Reassigning component from "python" to "istanbul"

Comment 3 Jef Spaleta 2009-12-02 17:16:15 UTC
Dave,

I'm having trouble making sense of the backtrace... but it looks like it might be a gdk library bug if I'm reading the thread 1 .  The debug symbols are missing so I'm not overly confident I'm following the trace correctly.
  
It's a bit of a head scratcher really.  Istanbul is mostly native python.  The only compiled code in the package is a gstreamer libgstximagesrc.so and there's no reference in the backtrace to libgstximagesrc.  

-jef

Comment 4 Luya Tshimbalanga 2009-12-02 20:54:34 UTC
Running istanbul from terminal

$ istanbul 
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:37: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:77: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Use a selector to select area of screen to capture."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:90: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select a window on the screen to capture"))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:107: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to screencast a 3d application.  This will however take more CPU power."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:119: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record the mouse pointer during the screencast."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:133: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record audio with the screencast.  You can choose the audio device to record from in the Multimedia Systems Selector in Preferences."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:145: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this if you do not want to scale down the size of the recording."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:169: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/2."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:176: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/4."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:43: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:45: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to start screencast.  Right click for menu."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:61: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to stop recording screencast."))
DEBUG: final pipeline: istximagesrc name=videosource display-name=:0.0 screen-num=0 show-pointer=false ! video/x-raw-rgb,framerate=10/1 ! videorate ! ffmpegcolorspace ! videoscale method=1 ! video/x-raw-yuv,width=1024,height=768,framerate=10/1 ! theoraenc ! oggmux name=mux ! filesink location=/tmp/tmpfr3jXh
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:72: DeprecationWarning: Use the new widget gtk.Tooltip
  _("In process of saving to disk."))

Gdk-ERROR **: The program 'istanbul' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 1771 error_code 14 request_code 1 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
aborting...
Aborted (core dumped)

Comment 5 Dave Malcolm 2009-12-02 21:07:22 UTC
(In reply to comment #4)
> Running istanbul from terminal
> 
> $ istanbul 
[snip lots of tooltip deprecation warnings]

> Gdk-ERROR **: The program 'istanbul' received an X Window System error.
> This probably reflects a bug in the program.
> The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
>   (Details: serial 1771 error_code 14 request_code 1 minor_code 0)
>   (Note to programmers: normally, X errors are reported asynchronously;
>    that is, you will receive the error a while after causing it.
>    To debug your program, run it with the --sync command line
>    option to change this behavior. You can then get a meaningful
>    backtrace from your debugger if you break on the gdk_x_error() function.)
> aborting...
> Aborted (core dumped)  

Luya: you could try running:
$ gdb --args python /usr/bin/istanbul --sync
(gdb) run

to try to get a better backtrace.

Having said that, I've heard reports that the --sync option is not well supported by pygtk; see: https://bugzilla.redhat.com/show_bug.cgi?id=540810#c15

so this might need fixing first :-(

Comment 6 Dave Malcolm 2009-12-02 21:14:35 UTC
(In reply to comment #5)
> Luya: you could try running:
> $ gdb --args python /usr/bin/istanbul --sync
sorry, you should do:
 (gdb) break gdk_x_error
here, before invoking "run", following the description in the output from GDK.

> (gdb) run

to try to get a better backtrace (assuming this works with pygtk, see my caveat above)

Comment 7 Luya Tshimbalanga 2009-12-03 09:58:40 UTC
Full report.

$ gdb --args python /usr/bin/istanbul --sync
GNU gdb (GDB) Fedora (7.0-7.fc12)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...(no debugging symbols found)...done.
Missing separate debuginfos, use: debuginfo-install python-2.6.2-2.fc12.i686
(gdb) break gdk_x_error
Function "gdk_x_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (gdk_x_error) pending.
(gdb) run
Starting program: /usr/bin/python /usr/bin/istanbul --sync
[Thread debugging using libthread_db enabled]
warning: .dynamic section for "/usr/lib/libgdk-x11-2.0.so.0" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libpango-1.0.so.0" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libfontconfig.so.1" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libXext.so.6" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libXi.so.6" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/lib/libresolv.so.2" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/lib/libselinux.so.1" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libpng12.so.0" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/lib/libz.so.1" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libcanberra-gtk.so.0" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libcanberra.so.0" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libltdl.so.7" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:37: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:77: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Use a selector to select area of screen to capture."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:90: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select a window on the screen to capture"))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:107: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to screencast a 3d application.  This will however take more CPU power."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:119: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record the mouse pointer during the screencast."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:133: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record audio with the screencast.  You can choose the audio device to record from in the Multimedia Systems Selector in Preferences."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:145: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this if you do not want to scale down the size of the recording."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:169: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/2."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:176: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/4."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:43: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:45: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to start screencast.  Right click for menu."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:61: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to stop recording screencast."))
DEBUG: final pipeline: istximagesrc name=videosource display-name=:0.0 screen-num=0 show-pointer=false ! video/x-raw-rgb,framerate=10/1 ! videorate ! ffmpegcolorspace ! videoscale method=1 ! video/x-raw-yuv,width=1024,height=768,framerate=10/1 ! theoraenc ! oggmux name=mux ! filesink location=/tmp/tmpwAd6Pu
[New Thread 0xb5bbab70 (LWP 13673)]
[New Thread 0xb38ffb70 (LWP 13677)]
[Thread 0xb38ffb70 (LWP 13677) exited]
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:72: DeprecationWarning: Use the new widget gtk.Tooltip
  _("In process of saving to disk."))
[Thread 0xb5bbab70 (LWP 13673) exited]
warning: .dynamic section for "/usr/lib/libbeagle.so.1" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
[New Thread 0xb5bbab70 (LWP 13683)]
warning: .dynamic section for "/usr/lib/libavahi-common.so.3" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
warning: .dynamic section for "/usr/lib/libavahi-client.so.3" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
[New Thread 0xb38ffb70 (LWP 13684)]
[New Thread 0xb45ffb70 (LWP 13685)]
[New Thread 0xb2cffb70 (LWP 13686)]
[New Thread 0xb22feb70 (LWP 13687)]
[Thread 0xb22feb70 (LWP 13687) exited]
[Thread 0xb5bbab70 (LWP 13683) exited]
[New Thread 0xb5bbab70 (LWP 13688)]
[New Thread 0xb22feb70 (LWP 13689)]
python: xcb_io.c:242: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb22feb70 (LWP 13689)]
0x009bf416 in __kernel_vsyscall ()

Comment 8 Tim Waugh 2009-12-06 11:20:47 UTC
Here's what I get:

$ gdb --args python /usr/bin/istanbul --sync
GNU gdb (GDB) Fedora (7.0-8.fc12)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/bin/python2.6.debug...done.
done.
(gdb) b gdk_x_error
Function "gdk_x_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (gdk_x_error) pending.
(gdb) r
Starting program: /usr/bin/python /usr/bin/istanbul --sync
[Thread debugging using libthread_db enabled]
Missing separate debuginfo for /usr/lib64/libtdb.so.1
Try: yum --enablerepo='*-debuginfo' install /usr/lib/debug/.build-id/34/fafaa8007ee23182c82ffdb451a09372dafb38.debug
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:37: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:77: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Use a selector to select area of screen to capture."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:90: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select a window on the screen to capture"))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:107: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to screencast a 3d application.  This will however take more CPU power."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:119: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record the mouse pointer during the screencast."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:133: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record audio with the screencast.  You can choose the audio device to record from in the Multimedia Systems Selector in Preferences."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:145: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this if you do not want to scale down the size of the recording."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:169: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/2."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:176: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/4."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:43: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:45: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to start screencast.  Right click for menu."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:61: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to stop recording screencast."))
DEBUG: final pipeline: istximagesrc name=videosource display-name=:0.0 screen-num=0 show-pointer=false ! video/x-raw-rgb,framerate=10/1 ! videorate ! ffmpegcolorspace ! videoscale method=1 ! video/x-raw-yuv,width=1920,height=1200,framerate=10/1 ! theoraenc ! oggmux name=mux ! filesink location=/tmp/tmpJHOcMb
[New Thread 0x7fffea706710 (LWP 2918)]
[New Thread 0x7fffe01e0710 (LWP 2919)]
[Thread 0x7fffe01e0710 (LWP 2919) exited]
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:72: DeprecationWarning: Use the new widget gtk.Tooltip
  _("In process of saving to disk."))
[New Thread 0x7fffe01e0710 (LWP 2920)]
[New Thread 0x7fffe3be9710 (LWP 2921)]
[New Thread 0x7fffe31e8710 (LWP 2922)]
[New Thread 0x7fffe27e7710 (LWP 2923)]
[New Thread 0x7fffe1de6710 (LWP 2924)]
[New Thread 0x7fffe13e5710 (LWP 2925)]
istanbul: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
[Thread 0x7fffe13e5710 (LWP 2925) exited]
[Thread 0x7fffe1de6710 (LWP 2924) exited]
[Thread 0x7fffea706710 (LWP 2918) exited]
[Thread 0x7fffe27e7710 (LWP 2923) exited]
[Thread 0x7fffe31e8710 (LWP 2922) exited]
[Thread 0x7fffe01e0710 (LWP 2920) exited]
[Thread 0x7fffe3be9710 (LWP 2921) exited]

Program exited with code 01.
Missing separate debuginfos, use: debuginfo-install ORBit2-2.14.17-3.fc12.x86_64 PackageKit-gtk-module-0.5.4-0.4.20091029git.fc12.x86_64 bzip2-libs-1.0.5-6.fc12.x86_64 expat-2.0.1-8.fc12.x86_64 gamin-0.1.10-5.fc12.x86_64 gnome-python2-gconf-2.28.0-1.fc12.x86_64 gnome-python2-gnomevfs-2.28.0-1.fc12.x86_64 gnome-python2-libegg-2.25.3-13.fc12.3.x86_64 gnome-vfs2-2.24.2-2.fc12.x86_64 gstreamer-0.10.25.1-1.fc12.x86_64 gstreamer-plugins-bad-0.10.17-1.fc12.x86_64 gstreamer-plugins-base-0.10.25.1-1.fc12.x86_64 gstreamer-plugins-good-0.10.17-3.fc12.x86_64 gstreamer-python-0.10.16-1.fc12.x86_64 gtk2-engines-2.18.4-4.fc12.x86_64 gvfs-1.4.2-1.fc12.x86_64 istanbul-0.2.2-11.fc12.x86_64 keyutils-libs-1.2-6.fc12.x86_64 krb5-libs-1.7-10.fc12.x86_64 libX11-1.3-1.fc12.x86_64 libXau-1.0.5-1.fc12.x86_64 libXcomposite-0.4.1-2.fc12.x86_64 libXcursor-1.1.10-1.fc12.x86_64 libXdamage-1.1.2-1.fc12.x86_64 libXext-1.1-1.fc12.x86_64 libXfixes-4.0.4-1.fc12.x86_64 libXi-1.3-1.fc12.x86_64 libXinerama-1.1-1.fc12.x86_64 libXrandr-1.3.0-3.fc12.x86_64 libXrender-0.9.5-1.fc12.x86_64 libbeagle-0.3.9-5.fc12.x86_64 libcanberra-0.22-1.fc12.x86_64 libcanberra-gtk2-0.22-1.fc12.x86_64 libcap-ng-0.6.2-3.fc12.x86_64 libcom_err-1.41.9-5.fc12.x86_64 libcroco-0.6.2-3.fc12.x86_64 libgsf-1.14.15-4.fc12.x86_64 libogg-1.1.4-2.fc12.x86_64 liboil-0.3.16-4.fc12.x86_64 libpng-1.2.39-1.fc12.x86_64 librsvg2-2.26.0-3.fc12.x86_64 libselinux-2.0.87-1.fc12.x86_64 libtheora-1.1.0-1.fc12.x86_64 libtool-ltdl-2.2.6-15.fc12.x86_64 libvorbis-1.2.3-3.fc12.x86_64 libxcb-1.4-2.fc12.x86_64 openssl-1.0.0-0.13.beta4.fc12.x86_64 pixman-0.16.2-1.fc12.x86_64 pycairo-1.8.6-2.fc12.x86_64 pygobject2-2.20.0-1.fc12.x86_64 pygtk2-2.16.0-1.fc12.x86_64
(gdb) r
Starting program: /usr/bin/python /usr/bin/istanbul --sync
[Thread debugging using libthread_db enabled]
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:37: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:77: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Use a selector to select area of screen to capture."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:90: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select a window on the screen to capture"))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:107: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to screencast a 3d application.  This will however take more CPU power."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:119: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record the mouse pointer during the screencast."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:133: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record audio with the screencast.  You can choose the audio device to record from in the Multimedia Systems Selector in Preferences."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:145: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this if you do not want to scale down the size of the recording."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:169: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/2."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:176: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/4."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:43: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:45: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to start screencast.  Right click for menu."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:61: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to stop recording screencast."))
DEBUG: final pipeline: istximagesrc name=videosource display-name=:0.0 screen-num=0 show-pointer=false ! video/x-raw-rgb,framerate=10/1 ! videorate ! ffmpegcolorspace ! videoscale method=1 ! video/x-raw-yuv,width=1920,height=1200,framerate=10/1 ! theoraenc ! oggmux name=mux ! filesink location=/tmp/tmp29nV5b
[New Thread 0x7fffea706710 (LWP 2927)]
[New Thread 0x7fffe01e0710 (LWP 2928)]
[Thread 0x7fffe01e0710 (LWP 2928) exited]
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:72: DeprecationWarning: Use the new widget gtk.Tooltip
  _("In process of saving to disk."))
[New Thread 0x7fffe01e0710 (LWP 2929)]
[New Thread 0x7fffe8b71710 (LWP 2930)]
[New Thread 0x7fffe3187710 (LWP 2931)]
[New Thread 0x7fffe2786710 (LWP 2932)]
[New Thread 0x7fffe1d85710 (LWP 2933)]
*** glibc detected *** /usr/bin/python: double free or corruption (fasttop): 0x00000000012139d0 ***

Program received signal SIGABRT, Aborted.
0x000000396ac326b5 in raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
Missing separate debuginfos, use: debuginfo-install libgcc-4.4.2-7.fc12.x86_64
(gdb) bt
#0  0x000000396ac326b5 in raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x000000396ac33e95 in abort () at abort.c:92
#2  0x000000396ac6ebe3 in __libc_message (do_abort=<value optimized out>, 
    fmt=<value optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:186
#3  0x000000396ac74576 in malloc_printerr (action=3, str=
    0x396ad3d9a0 "munmap_chunk(): invalid pointer", ptr=<value optimized out>)
    at malloc.c:6264
#4  0x0000003fd824cf42 in ?? () from /usr/lib64/libX11.so.6
#5  0x0000003fd824d887 in _XEventsQueued () from /usr/lib64/libX11.so.6
#6  0x0000003fd823612d in XPending () from /usr/lib64/libX11.so.6
#7  0x0000003fdb65c962 in gdk_event_prepare (source=<value optimized out>, 
    timeout=0x7fffffffd9fc) at gdkevents-x11.c:2330
#8  0x000000392ce3c43a in IA__g_main_context_prepare (context=0x9deac0, 
    priority=<value optimized out>) at gmain.c:2280
#9  0x000000392ce3c811 in g_main_context_iterate (context=0x9deac0, 
    block=<value optimized out>, dispatch=<value optimized out>, 
    self=<value optimized out>) at gmain.c:2571
#10 0x000000392ce3d065 in IA__g_main_loop_run (loop=0x10b81d0) at gmain.c:2799
#11 0x0000003fdbb4bcd7 in IA__gtk_main () at gtkmain.c:1218
#12 0x00007fffefa636e6 in ?? ()
   from /usr/lib64/python2.6/site-packages/gtk-2.0/gtk/_gtk.so
#13 0x0000003977cdc652 in call_function (oparg=<value optimized out>, 
    pp_stack=<value optimized out>) at Python/ceval.c:3690
#14 PyEval_EvalFrameEx (oparg=<value optimized out>, 
    pp_stack=<value optimized out>) at Python/ceval.c:2389
#15 0x0000003977cdd077 in fast_function (nk=<value optimized out>, 
    na=<value optimized out>, n=<value optimized out>, 
    pp_stack=<value optimized out>, func=<value optimized out>)
    at Python/ceval.c:3792
#16 call_function (nk=<value optimized out>, na=<value optimized out>, 
    n=<value optimized out>, pp_stack=<value optimized out>, 
    func=<value optimized out>) at Python/ceval.c:3727
#17 PyEval_EvalFrameEx (nk=<value optimized out>, na=<value optimized out>, 
    n=<value optimized out>, pp_stack=<value optimized out>, 
    func=<value optimized out>) at Python/ceval.c:2389
#18 0x0000003977cde4e5 in PyEval_EvalCodeEx (co=0x7ffff7ef3eb8, 
    globals=<value optimized out>, locals=<value optimized out>, args=0x0, 
    argcount=<value optimized out>, kws=<value optimized out>, kwcount=0, defs=
    0x0, defcount=0, closure=0x0) at Python/ceval.c:2968
#19 0x0000003977cde5f2 in PyEval_EvalCode (co=0xb6e, globals=0xb6e, locals=0x6)
    at Python/ceval.c:522
#20 0x0000003977cf965c in run_mod (mod=<value optimized out>, 
    filename=<value optimized out>, globals=0x62d630, locals=0x62d630, 
    flags=<value optimized out>, arena=<value optimized out>)
    at Python/pythonrun.c:1335
#21 0x0000003977cf9730 in PyRun_FileExFlags (fp=0x62d850, filename=
    0x7fffffffe545 "/usr/bin/istanbul", start=<value optimized out>, 
    globals=<value optimized out>, locals=0x62d630, closeit=1, flags=
    0x7fffffffe120) at Python/pythonrun.c:1321
#22 0x0000003977cfab0c in PyRun_SimpleFileExFlags (fp=<value optimized out>, 
    filename=0x7fffffffe545 "/usr/bin/istanbul", closeit=1, flags=
    0x7fffffffe120) at Python/pythonrun.c:931
#23 0x0000003977d07389 in Py_Main (argc=-134455152, argv=<value optimized out>)
    at Modules/main.c:599
#24 0x000000396ac1eb1d in __libc_start_main (main=<value optimized out>, 
    argc=<value optimized out>, ubp_av=<value optimized out>, 
    init=<value optimized out>, fini=<value optimized out>, 
    rtld_fini=<value optimized out>, stack_end=<value optimized out>)
    at libc-start.c:220
#25 0x0000000000400649 in _start ()


-----



And here's another run:

$ gdb --args python /usr/bin/istanbul --sync
GNU gdb (GDB) Fedora (7.0-8.fc12)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/bin/python2.6.debug...done.
done.
(gdb) b gdk_x_error
Function "gdk_x_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (gdk_x_error) pending.
(gdb) r
Starting program: /usr/bin/python /usr/bin/istanbul --sync
[Thread debugging using libthread_db enabled]
Missing separate debuginfo for /usr/lib64/libtdb.so.1
Try: yum --enablerepo='*-debuginfo' install /usr/lib/debug/.build-id/34/fafaa8007ee23182c82ffdb451a09372dafb38.debug
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:37: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:77: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Use a selector to select area of screen to capture."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:90: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select a window on the screen to capture"))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:107: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to screencast a 3d application.  This will however take more CPU power."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:119: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record the mouse pointer during the screencast."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:133: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Tick this if you want to record audio with the screencast.  You can choose the audio device to record from in the Multimedia Systems Selector in Preferences."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:145: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this if you do not want to scale down the size of the recording."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:169: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/2."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_popup.py:176: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Select this to scale down the recording resolution by 1/4."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:43: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:45: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to start screencast.  Right click for menu."))
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:61: DeprecationWarning: Use the new widget gtk.Tooltip
  _("Left click to stop recording screencast."))
DEBUG: final pipeline: istximagesrc name=videosource display-name=:0.0 screen-num=0 show-pointer=false ! video/x-raw-rgb,framerate=10/1 ! videorate ! ffmpegcolorspace ! videoscale method=1 ! video/x-raw-yuv,width=1920,height=1200,framerate=10/1 ! theoraenc ! oggmux name=mux ! filesink location=/tmp/tmpJ_nfQz
[New Thread 0x7fffea88c710 (LWP 3124)]
[New Thread 0x7fffe0646710 (LWP 3125)]
[Thread 0x7fffe0646710 (LWP 3125) exited]
/usr/lib/python2.6/site-packages/istanbul/main/tray_icon.py:72: DeprecationWarning: Use the new widget gtk.Tooltip
  _("In process of saving to disk."))
[New Thread 0x7fffe0646710 (LWP 3129)]
[New Thread 0x7fffe93a8710 (LWP 3130)]
[New Thread 0x7fffe33bb710 (LWP 3131)]
[New Thread 0x7fffe29ba710 (LWP 3132)]
[New Thread 0x7fffe1fb9710 (LWP 3133)]
[New Thread 0x7fffe15b8710 (LWP 3134)]

Breakpoint 1, gdk_x_error (display=0xb46c00, error=0x7fffffffd830)
    at gdkmain-x11.c:438
438	{
Missing separate debuginfos, use: debuginfo-install ORBit2-2.14.17-3.fc12.x86_64 PackageKit-gtk-module-0.5.4-0.4.20091029git.fc12.x86_64 bzip2-libs-1.0.5-6.fc12.x86_64 expat-2.0.1-8.fc12.x86_64 gamin-0.1.10-5.fc12.x86_64 gnome-python2-gconf-2.28.0-1.fc12.x86_64 gnome-python2-gnomevfs-2.28.0-1.fc12.x86_64 gnome-python2-libegg-2.25.3-13.fc12.3.x86_64 gnome-vfs2-2.24.2-2.fc12.x86_64 gstreamer-0.10.25.1-1.fc12.x86_64 gstreamer-plugins-bad-0.10.17-1.fc12.x86_64 gstreamer-plugins-base-0.10.25.1-1.fc12.x86_64 gstreamer-plugins-good-0.10.17-3.fc12.x86_64 gstreamer-python-0.10.16-1.fc12.x86_64 gtk2-engines-2.18.4-4.fc12.x86_64 gvfs-1.4.2-1.fc12.x86_64 istanbul-0.2.2-11.fc12.x86_64 keyutils-libs-1.2-6.fc12.x86_64 krb5-libs-1.7-10.fc12.x86_64 libX11-1.3-1.fc12.x86_64 libXau-1.0.5-1.fc12.x86_64 libXcomposite-0.4.1-2.fc12.x86_64 libXcursor-1.1.10-1.fc12.x86_64 libXdamage-1.1.2-1.fc12.x86_64 libXext-1.1-1.fc12.x86_64 libXfixes-4.0.4-1.fc12.x86_64 libXi-1.3-1.fc12.x86_64 libXinerama-1.1-1.fc12.x86_64 libXrandr-1.3.0-3.fc12.x86_64 libXrender-0.9.5-1.fc12.x86_64 libbeagle-0.3.9-5.fc12.x86_64 libcanberra-0.22-1.fc12.x86_64 libcanberra-gtk2-0.22-1.fc12.x86_64 libcap-ng-0.6.2-3.fc12.x86_64 libcom_err-1.41.9-5.fc12.x86_64 libcroco-0.6.2-3.fc12.x86_64 libgsf-1.14.15-4.fc12.x86_64 libogg-1.1.4-2.fc12.x86_64 liboil-0.3.16-4.fc12.x86_64 libpng-1.2.39-1.fc12.x86_64 librsvg2-2.26.0-3.fc12.x86_64 libselinux-2.0.87-1.fc12.x86_64 libtheora-1.1.0-1.fc12.x86_64 libtool-ltdl-2.2.6-15.fc12.x86_64 libvorbis-1.2.3-3.fc12.x86_64 libxcb-1.4-2.fc12.x86_64 openssl-1.0.0-0.13.beta4.fc12.x86_64 pixman-0.16.2-1.fc12.x86_64 pycairo-1.8.6-2.fc12.x86_64 pygobject2-2.20.0-1.fc12.x86_64
(gdb) bt
#0  gdk_x_error (display=0xb46c00, error=0x7fffffffd830) at gdkmain-x11.c:438
#1  0x0000003fd8246ad4 in _XError () from /usr/lib64/libX11.so.6
#2  0x0000003fd824ceec in ?? () from /usr/lib64/libX11.so.6
#3  0x0000003fd824d887 in _XEventsQueued () from /usr/lib64/libX11.so.6
#4  0x0000003fd823612d in XPending () from /usr/lib64/libX11.so.6
#5  0x0000003fdb65c8f9 in gdk_event_check (source=0xb5e970)
    at gdkevents-x11.c:2347
#6  0x000000392ce3c12a in IA__g_main_context_check (context=0xb5e9f0, 
    max_priority=2147483647, fds=<value optimized out>, 
    n_fds=<value optimized out>) at gmain.c:2469
#7  0x000000392ce3c90d in g_main_context_iterate (context=0xb5e9f0, 
    block=<value optimized out>, dispatch=<value optimized out>, 
    self=<value optimized out>) at gmain.c:2588
#8  0x000000392ce3d065 in IA__g_main_loop_run (loop=0x123c880) at gmain.c:2799
#9  0x0000003fdbb4bcd7 in IA__gtk_main () at gtkmain.c:1218
#10 0x00007fffefb266e6 in _wrap_gtk_main (self=<value optimized out>)
    at ./gtk.override:1241
#11 0x0000003977cdc652 in call_function (oparg=<value optimized out>, 
    pp_stack=<value optimized out>) at Python/ceval.c:3690
#12 PyEval_EvalFrameEx (oparg=<value optimized out>, 
    pp_stack=<value optimized out>) at Python/ceval.c:2389
#13 0x0000003977cdd077 in fast_function (nk=<value optimized out>, 
    na=<value optimized out>, n=<value optimized out>, 
    pp_stack=<value optimized out>, func=<value optimized out>)
    at Python/ceval.c:3792
#14 call_function (nk=<value optimized out>, na=<value optimized out>, 
    n=<value optimized out>, pp_stack=<value optimized out>, 
    func=<value optimized out>) at Python/ceval.c:3727
#15 PyEval_EvalFrameEx (nk=<value optimized out>, na=<value optimized out>, 
    n=<value optimized out>, pp_stack=<value optimized out>, 
    func=<value optimized out>) at Python/ceval.c:2389
#16 0x0000003977cde4e5 in PyEval_EvalCodeEx (co=0x7ffff7ef3eb8, 
    globals=<value optimized out>, locals=<value optimized out>, args=0x0, 
    argcount=<value optimized out>, kws=<value optimized out>, kwcount=0, defs=
    0x0, defcount=0, closure=0x0) at Python/ceval.c:2968
#17 0x0000003977cde5f2 in PyEval_EvalCode (co=0xb46c00, globals=
    0x7fffffffd830, locals=0x50001f3) at Python/ceval.c:522
#18 0x0000003977cf965c in run_mod (mod=<value optimized out>, 
    filename=<value optimized out>, globals=0x62d630, locals=0x62d630, 
    flags=<value optimized out>, arena=<value optimized out>)
    at Python/pythonrun.c:1335
#19 0x0000003977cf9730 in PyRun_FileExFlags (fp=0x62d850, filename=
    0x7fffffffe545 "/usr/bin/istanbul", start=<value optimized out>, 
    globals=<value optimized out>, locals=0x62d630, closeit=1, flags=
    0x7fffffffe120) at Python/pythonrun.c:1321
#20 0x0000003977cfab0c in PyRun_SimpleFileExFlags (fp=<value optimized out>, 
    filename=0x7fffffffe545 "/usr/bin/istanbul", closeit=1, flags=
    0x7fffffffe120) at Python/pythonrun.c:931
#21 0x0000003977d07389 in Py_Main (argc=-134455152, argv=<value optimized out>)
    at Modules/main.c:599
#22 0x000000396ac1eb1d in __libc_start_main (main=<value optimized out>, 
    argc=<value optimized out>, ubp_av=<value optimized out>, 
    init=<value optimized out>, fini=<value optimized out>, 
    rtld_fini=<value optimized out>, stack_end=<value optimized out>)
    at libc-start.c:220
#23 0x0000000000400649 in _start ()
(gdb) quit

Comment 9 Tim Waugh 2009-12-06 11:21:00 UTC
*** Bug 544544 has been marked as a duplicate of this bug. ***

Comment 10 Dave Malcolm 2009-12-10 19:52:38 UTC
*** Bug 546148 has been marked as a duplicate of this bug. ***

Comment 11 Dave Malcolm 2009-12-14 17:12:53 UTC
Luya and I spent a while at FUDcon trying to track this down.  We were able to reliably trigger this XError assertion failure on an F12 laptop by
 1: launch istanbul, e.g. from command line, using:
$ gdb --args python /usr/bin/istanbul --sync
(gdb) break gdk_x_error
(gdb) run
 2: istanbul icon appears in panel; click on it to start recording
 3: click on it to stop recording
 4: file save dialog starts appearing, but the XError abort happens before it can fully appear.

I've written up some notes on pygtk and the --sync option at: https://bugzilla.redhat.com/show_bug.cgi?id=540810#c22 (virt-manager bug showing a similar XError assertion failure).

When passing --sync to istanbul, GTK appears to be actually honoring the --sync option, but the breakpoint doesn't seem to be halting the code in a useful place, or, at least, one that I can decipher (my knowledge of the innards of GTK is rusty, alas)

CCing mclasen (GTK maintainer) in the hope of more insight.

$ rpm -q istanbul gtk2 pygtk2
istanbul-0.2.2-11.fc12.i686
gtk2-2.18.3-21.fc12.i686
pygtk2-2.16.0-1.fc12.i686

Comment 12 Jef Spaleta 2009-12-14 17:41:02 UTC
Dave,
Thanks for deep diving on this.  \

I have a question.. is this problem a potential class of problems for a number of existing python applications?  Do we have a way to data mining the complete set of abrt crashes looking for a characteristic string associated with this pygtk/gtk problem?

-jef

Comment 13 Dave Malcolm 2009-12-15 19:05:16 UTC
*** Bug 547584 has been marked as a duplicate of this bug. ***

Comment 14 Dave Malcolm 2009-12-15 19:05:50 UTC
*** Bug 547595 has been marked as a duplicate of this bug. ***

Comment 15 Dave Malcolm 2009-12-15 19:16:23 UTC
*** Bug 547803 has been marked as a duplicate of this bug. ***

Comment 16 Petr Šplíchal 2009-12-16 13:20:34 UTC
Created attachment 378757 [details]
istanbul-0.2.2-12 backtrace

I've tested with the latest istanbul-0.2.2-12.fc12.i686 and ended
up with the same failure. Attaching my backtrace.

Comment 17 Jef Spaleta 2009-12-16 17:25:52 UTC
The latest update was for another crash condition.. an unhandled exception in the istanbul python codebase.  

This X error bug is down deep in the gdk library being called through the pygtk bindings and not in istanbul itself.  I'm not even sure why istanbul is the only thing triggering it. If I knew of a way to patch around the problem I would.

-jef

Comment 18 Dave Malcolm 2009-12-16 23:44:22 UTC
*** Bug 548009 has been marked as a duplicate of this bug. ***

Comment 19 Dave Malcolm 2009-12-18 16:18:23 UTC
*** Bug 548778 has been marked as a duplicate of this bug. ***

Comment 20 Dave Malcolm 2009-12-18 16:55:51 UTC
This appears to be a threading issue with how istanbul is calling in to GDK.

I can repeat the recipe in comment #11 to reproduce the problem, and break at "gdk_x_error".
If I then run "thread apply all backtrace" (or "t a a bt" for short) in gdb, I see that the main thread is indeed stopped inside gdk_x_error, but there's another thread making a call to the X server using XSetWindowBackground.

Comment 21 Dave Malcolm 2009-12-18 16:56:26 UTC
Created attachment 379251 [details]
Backtrace from alternate thread

Comment 22 Dave Malcolm 2009-12-18 17:07:16 UTC
Digging into the backtrace from the alternate thread:
  - frame #10 has the call to  XSetWindowBackground, from
  - frame #11: gdk_window_x11_set_background, from
  - frame #14: _wrap_gdk_drawable__get_xid

this is being invoked in frame #18: PyEval_EvalFrameEx, which is calling:
    /usr/lib/python2.6/site-packages/istanbul/main/save_window.py:set_sink 
which appears to be due to line 50 of the python code:
    self.imagesink.set_xwindow_id(self.window.xid)
which is called by (frame #22 PyEval_EvalFrameEx): 
/usr/lib/python2.6/site-packages/istanbul/main/gst_player.py:on_sync_message
which seems to be this line:
    def on_sync_message(self, bus, message):
        if message.structure is None:
            return
        if message.structure.get_name() == 'prepare-xwindow-id':
            self.videowidget.set_sink(message.src)  # here's where it happens
            message.src.set_property('force-aspect-ratio', True)
and this callback is wired up in GstPlayer.__init__ in the same file:
        bus.connect('sync-message::element', self.on_sync_message)

So walking backwards through this: I believe that the sync-message::element happens, triggering the callback in a thread that isn't the one running the main GTK loop, and that the lookup of self.window.xid causes a communication on the socket connection to the X server, interfering with the "conversation" that the main thread is having.

As I understand it, it's forbidden to call gdk functions outside of gdk_threads_{enter|leave} (should pygtk check for this automatically, perhaps?)

Comment 23 Dave Malcolm 2009-12-18 17:47:43 UTC
Summary: it looks like the way istanbul wires up the preview window in the "Save Screencast" dialog is incompatible with the client-side window code in GTK-2.18, and that istanbul will need to recode how this is wired up.

jspaleta: you should report this bug upstream.

Details:
<dmalcolm> aha: am I right in thinking that all Gdk calls should be coming from the main thread, and that having other thread call into gdk is likely to cause an XError?
<dmalcolm> walters: ^^
<walters> dmalcolm: you need to grab the GDK lock at least
<walters> dmalcolm: gdk_threads_{enter,leave}
<walters> dmalcolm: but i strongly urge Don't Do That
<dmalcolm> thanks; I think that's what's going wrong with istanbul
<walters> dmalcolm: hmm, oh, this is probably fallout from CSW
<dmalcolm> csw?
<walters> client side windows
<dmalcolm> looks like the gstreamer stuff happens in a thread pool, and one of those threads invokes a callback, calling back into python which calls back into GDK
<walters> my guess is before CSW, whatever self is had a native X window already (with a defined xid), and in CSW it doesn't, but calling self.window is allocating one
<walters> dmalcolm: try calling self.window before any gstreamer stuff happens
<walters> probably cleaner is self._xid = self.window.xid
<walters> then pass self._xid in that code
<walters> dmalcolm: any luck?
<dmalcolm> walters: nope; trying to figure out when these objects gain a "window" attribute.  Realization?
<dmalcolm> walters: I also tried wrapping with gtk.gdk.threads_enter() and leave() but that doesn't seem to help
<walters> dmalcolm: oh; yeah, it needs to be realized
<dmalcolm> walters: oh, and if I delete the "assert self.window.xid" and "self.imagesink.set_xwindow_id(self.window.xid)" lines from set_sink then instanbul dialog appears ok (but obviously the video playback doesn't work)
<dmalcolm> so I think we've found the root cause
<dmalcolm> walters: do you know to what extent other distros are using CSW?
<walters> dmalcolm: they're in 2.18

Comment 24 Dave Malcolm 2009-12-18 17:52:56 UTC
(In reply to comment #22)
> which appears to be due to line 50 of the python code:
>     self.imagesink.set_xwindow_id(self.window.xid)
I now believe this is happening in line 48 here:
        assert self.window.xid

Note on debugging:
I'm using the /usr/share/doc/python-devel-2.6.4/gdbinit file, copied to ~/.gdbinit 

This provides various handy commands for debugging python in gdb.

Specifically, "pyframe" when called within a PyEval_EvalFrameEx will attempt to print the python source file, function, and line number.

Unfortunately, this isn't fully working for some reason:
(gdb) pyframe
/usr/lib/python2.6/site-packages/istanbul/main/save_window.py (Cannot access memory at address 0x10

but I'm able to at least scrape out the filename and function name thus:
(gdb) p (char*)((PyStringObject*)co->co_filename)->ob_sval
$34 = 0x81ac5b4 "/usr/lib/python2.6/site-packages/istanbul/main/save_window.py"
(gdb) p (char*)((PyStringObject*)co->co_name)->ob_sval
$35 = 0x81b6eb4 "set_sink"

Comment 25 Dave Malcolm 2009-12-18 18:07:19 UTC
I went ahead and filed this upstream here:
https://bugzilla.gnome.org/show_bug.cgi?id=604938

Comment 26 Dave Malcolm 2009-12-18 18:08:18 UTC
From: http://library.gnome.org/devel/gtk/stable/gtk-migrating-ClientSideWindows.html
"A small gotcha is that the GDK_WINDOW_XID() call is no longer a trivial accessor for the XID of the window, and thus must not be called from another thread without taking locking precautions."

Comment 27 Dave Malcolm 2009-12-18 18:50:46 UTC
jspaleta: I attached Colin's patch to the upstream bug (https://bugzilla.gnome.org/show_bug.cgi?id=604938).  It doesn't fully work for me, but at least renders istanbul usable again:
On gtk-2.18 (client-side windows):
...without this patch, istanbul exits with a c-level assertion failure from
inside GDK opening the "Save Screencast" dialog; Istanbul is thus unusable.

...with this patch, istanbul prints a python-level backtrace, but the program
carries on; the only bug is that the video preview is in a separate top-level
window to the rest of the "Save Screencast" dialog.

Comment 28 Dave Malcolm 2009-12-18 21:51:18 UTC
*** Bug 548566 has been marked as a duplicate of this bug. ***

Comment 29 Dave Malcolm 2009-12-21 19:18:02 UTC
*** Bug 548887 has been marked as a duplicate of this bug. ***

Comment 30 Fedora Update System 2009-12-24 19:57:21 UTC
istanbul-0.2.2-13.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/istanbul-0.2.2-13.fc12

Comment 31 Luya Tshimbalanga 2009-12-24 20:43:24 UTC
*** Bug 550370 has been marked as a duplicate of this bug. ***

Comment 32 Fedora Update System 2009-12-25 08:23:11 UTC
istanbul-0.2.2-13.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update istanbul'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-13701

Comment 33 Felix Schwarz 2009-12-26 22:23:21 UTC
Using istanbul 0:0.2.2-13.fc12 from updates-testing, it does not crash anymore so I can save videos successfully. However it still does not work completely - this is the crash abrt catched:

Summary: TB54f92210 save_window.py:53:set_sink:AssertionError

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/istanbul/main/gst_player.py", line 52, in on_sync_message
    self.videowidget.set_sink(message.src)
  File "/usr/lib/python2.6/site-packages/istanbul/main/save_window.py", line 53, in set_sink
    assert self._xid is not None
AssertionError

Local variables in innermost frame:
self: <VideoWidget object at 0x1057fa0 (GtkDrawingArea at 0x119dc00)>
sink: /GstPlayBin:player/GstBin:vbin/GstXImageSink:videosink (__main__.GstXImageSink)

Also the preview does not show any picture.

Comment 34 Felix Schwarz 2009-12-26 22:24:16 UTC
sorry just noticed comment 27 - please disregard my previous comment 26

Comment 35 Felix Schwarz 2009-12-26 22:27:00 UTC
*** Bug 548734 has been marked as a duplicate of this bug. ***

Comment 36 Dave Malcolm 2010-01-04 17:12:20 UTC
*** Bug 550178 has been marked as a duplicate of this bug. ***

Comment 37 Dave Malcolm 2010-01-04 18:33:18 UTC
*** Bug 550946 has been marked as a duplicate of this bug. ***

Comment 38 Dave Malcolm 2010-01-04 18:33:50 UTC
*** Bug 550947 has been marked as a duplicate of this bug. ***

Comment 39 Dave Malcolm 2010-01-04 18:34:18 UTC
*** Bug 551129 has been marked as a duplicate of this bug. ***

Comment 40 Dave Malcolm 2010-01-04 19:04:25 UTC
*** Bug 551628 has been marked as a duplicate of this bug. ***

Comment 41 Jon VanAlten 2010-01-04 20:08:03 UTC
Hi,

I seem to be hitting this bug, but it's manifesting itself slightly differently.  So while this has been reported upstream I thought I'd add my two cents in case it makes a difference.

My symptoms match those of other reporters in terms of save window crashes as it opens, and same gdk BadIDChoice error message on console if started from command line.  However, if I run either 1) with the '--sync' command line option OR 2) within a debugger (ie 'gdb /usr/bin/python --args /usr/bin/istanbul' without any other command line options), the problem goes away and I can save the screencast.  (thus I do not have a backtrace to attach).

This is in F12 x86_64 fully updated.

Comment 42 Dave Malcolm 2010-01-04 20:23:45 UTC
*** Bug 551863 has been marked as a duplicate of this bug. ***

Comment 43 Paul W. Frields 2010-01-18 15:50:15 UTC
*** Bug 553965 has been marked as a duplicate of this bug. ***

Comment 44 Paul W. Frields 2010-01-18 15:51:30 UTC
*** Bug 553498 has been marked as a duplicate of this bug. ***

Comment 45 Paul W. Frields 2010-01-18 15:56:13 UTC
Bug 554512 may be a duplicate, but I'm not certain -- if I read the backtrace properly, the problem is happening in _XReply and not _XError in that bug.  Can someone wiser take a look at attachment 383095 [details] and if needed, mark bug 554512 as a duplicate?

Comment 46 Johan Dobbelstein 2010-01-19 09:18:55 UTC
Created attachment 385346 [details]
Temp. fix preview video widget in save_window.py

'Morning everyone !

I've tried the last istanbul 0:0.2.2-13.fc12 and got the same problem as mentioned in comments 27 and 33.

I don't really know if this can be useful but I made a temporary (and ugly) hack to the failed assert. I've just assigned the videowidget.window.xid within a callback linked to the event "realize". Using this trick, Istanbul save_window works flawlessly on my x86 32bits.

I've come across similar problems when toying with example2.2 of the PyGst tutorial (http://pygstdocs.berlios.de/pygst-tutorial/playbin.html) and so I suppose this is not only related to Istanbul. I hope a more global solution to this gdk.thread/gst problem will be found in pygtk or pygst.

regards, 
Johan

Comment 47 Jef Spaleta 2010-01-20 06:51:25 UTC
(In reply to comment #46)
Thanks for the patch.

I'm still stuck in Antarctica for a couple more weeks with limited connectivity.  I'll try to get your patch integrated into a testing updates build this weekend if one of my co-maintainers don't beat me to it. Cough... hint hint.

-jef

Comment 48 Paul W. Frields 2010-01-20 13:24:19 UTC
Johan's patch seems to work fine on my F12 x86_64 as well.  I'm putting the fix into CVS and doing a build for updates-testing.  Jef, if this looks good, can you communicate it to upstream?

Comment 49 Paul W. Frields 2010-01-20 13:50:32 UTC
Oops, looks like I'm still waiting for Jef's approval for me to work on the Fedora 12 branch for packages.  I'm already approved to work on the Rawhide branch, so I've tagged and built 0.2.2-14 there.  If appropriate, Jef can review that and use it to decide whether to either send out a Fedora 12 testing update, or approve me to do it.

Comment 50 Jef Spaleta 2010-01-20 19:53:41 UTC
(In reply to comment #49)
Oops, lets see if I can fix that in pkgdb. Paul you should have F12 commit rights now...according to pkgdb.

I'll find a couple of spare minutes today to ping the upstream bug report Dave opened with the new patch.

Thanks for hanging in there everyone.  I wonder how many less used programs are affected by this little gotcha.

-jef

Comment 51 Fedora Update System 2010-01-20 22:37:49 UTC
istanbul-0.2.2-14.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/istanbul-0.2.2-14.fc12

Comment 52 Paul W. Frields 2010-01-20 22:39:48 UTC
*** Bug 533884 has been marked as a duplicate of this bug. ***

Comment 53 Paul W. Frields 2010-01-20 23:54:51 UTC
OK, if you're one of the many people who reported this bug (through the ABRT tool or otherwise), we could use your help testing the update.  You should be able to click on one of these links to install the package for testing.

32-bit:
   http://kojipkgs.fedoraproject.org/packages/istanbul/0.2.2/14.fc12/i686/istanbul-0.2.2-14.fc12.i686.rpm
64-bit:
   http://kojipkgs.fedoraproject.org/packages/istanbul/0.2.2/14.fc12/x86_64/istanbul-0.2.2-14.fc12.x86_64.rpm

Once you've tested it, leave a comment at the bodhi site:
   https://admin.fedoraproject.org/updates/istanbul-0.2.2-14.fc12

(Please login at that site before commenting, if you have a Fedora account.)  The sooner we receive feedback, the sooner we'll know whether we can release this update to the stable distribution.  Thanks for participating.

Comment 54 Luya Tshimbalanga 2010-01-21 01:46:21 UTC
As the original bug reporter, running the latest package from koji, the "_XError" crash no longer appear meaning the patch worked.

Comment 55 Jef Spaleta 2010-01-21 02:30:24 UTC
(In reply to comment #54)
Luya,

great!  big thanks to Colin and Dave for tracking the cause of this down initially and to Johan for the preview window fix.  I've poked the upstream bug report Dave original files with Johan's additional patch.


-jef

Comment 56 Luya Tshimbalanga 2010-01-21 04:40:38 UTC
(In reply to comment #55)
> (In reply to comment #54)
> Luya,
> 
> great!  big thanks to Colin and Dave for tracking the cause of this down
> initially and to Johan for the preview window fix.  I've poked the upstream bug
> report Dave original files with Johan's additional patch.
> 
> 
> -jef    

Cool. Another thing I noticed was some missing frames after recording but I presume it might be due to CPU limit from my laptop I tested. I wish it could be optimized but that is another story. Anyway, credits are due to all team for resolving that bug

Comment 57 Paul W. Frields 2010-01-22 20:23:16 UTC
*** Bug 557743 has been marked as a duplicate of this bug. ***

Comment 58 Fedora Update System 2010-01-22 22:35:53 UTC
istanbul-0.2.2-14.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update istanbul'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-0916

Comment 59 Fedora Update System 2010-02-02 01:24:41 UTC
istanbul-0.2.2-14.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 60 Paul W. Frields 2010-02-02 13:13:27 UTC
*** Bug 541816 has been marked as a duplicate of this bug. ***

Comment 61 Usama Akkad 2011-02-28 03:50:55 UTC
it have just crashed today and reporting tool could not report it.

screencast.py:118:start_recording:GError: could not link videoscale0 to theoraenc0

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/istanbul/main/tray_icon.py", line 65, in _trayicon_clicked
    self.current_screencast.start_recording()
  File "/usr/lib/python2.7/site-packages/istanbul/main/screencast.py", line 118, in start_recording
    self._pipeline = gst.parse_launch(final_pipeline)
GError: could not link videoscale0 to theoraenc0

Local variables in innermost frame:
acappipeline: ''
area_y2: 144.0
videoscale_method: 1
vencode_pipeline: 'video/x-raw-yuv,width=300,height=-223,framerate=10/1 ! theoraenc'
vcappipeline: 'istximagesrc name=videosource display-name=:0.0 screen-num=0 startx=78 starty=590 endx=678 endy=143  show-pointer=false ! video/x-raw-rgb,framerate=10/1 ! videorate ! ffmpegcolorspace ! videoscale method=1'
screen_number: 0
screen: <gtk.gdk.ScreenX11 object at 0x7f1c808eceb0 (GdkScreenX11 at 0x1a72da0)>
area_y1: 590.0
framerate: '10/1'
filename: None
final_pipeline: 'istximagesrc name=videosource display-name=:0.0 screen-num=0 startx=78 starty=590 endx=678 endy=143  show-pointer=false ! video/x-raw-rgb,framerate=10/1 ! videorate ! ffmpegcolorspace ! videoscale method=1 ! video/x-raw-yuv,width=300,height=-223,framerate=10/1 ! theoraenc ! oggmux name=mux ! filesink location=/tmp/tmppU29oE'
height: -223.0
width: 300.5
vsource: 'istximagesrc name=videosource display-name=:0.0 screen-num=0 startx=78 starty=590 endx=678 endy=143  show-pointer=false'
asource: ''
area_x1: 78.0
display_name: ':0.0'
area_x2: 679.0
self: <istanbul.main.screencast.Screencast instance at 0x7f1c80896cf8>
settings: {'record_sound': False, 'record_decorations': False, 'video_size': 'half', 'record_3d': False, 'record_mousepointer': False, 'video_framerate': 10}
mux_pipeline: 'oggmux name=mux ! filesink location=/tmp/tmppU29oE'

Comment 62 Dave Malcolm 2011-02-28 19:53:24 UTC
(In reply to comment #61)
> it have just crashed today and reporting tool could not report it.
[... snip error report ...]

That looks to me like a separate error.  Thanks for reporting it, but please open a separate bug report about it.


Note You need to log in before you can comment on or make changes to this bug.