After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 592100 - Cheese crashes when taking a photo or recording a video in fullscreen
Cheese crashes when taking a photo or recording a video in fullscreen
Status: RESOLVED FIXED
Product: cheese
Classification: Applications
Component: general
git master
Other All
: High critical
: 2.30
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
: 594108 613419 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-08-17 15:32 UTC by Richard Schwarting
Modified: 2010-03-28 08:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
Testcase testing output of macros (860 bytes, text/x-csrc)
2009-09-23 00:29 UTC, Richard Schwarting
  Details
countdown: move rsvg_init and rsvg_term into main (2.21 KB, patch)
2010-03-24 08:01 UTC, Filippo Argiolas
committed Details | Review

Description Richard Schwarting 2009-08-17 15:32:58 UTC
Version: 2.26.3

What were you doing when the application crashed?
* I opened cheese.
* I made cheese full screen.  
* It crashed.

I have a separate issue where cheese seems to display only the first image when it boots and doesn't update the preview after opening, but I can still take photos.  

Does full screen have issues with dual monitors?  That's what I'm using at least.  I'll try to update this with a test of it without dual monitors.




Distribution: Fedora release 11 (Leonidas)
Gnome Release: 2.26.3 2009-07-07 (Red Hat, Inc)
BugBuddy Version: 2.26.0

System: Linux 2.6.29.6-217.2.7.fc11.i686.PAE #1 SMP Fri Aug 14 20:52:46 EDT 2009 i686
X Vendor: The X.Org Foundation
X Vendor Release: 10601901
Selinux: Enforcing
Accessibility: Enabled
GTK+ Theme: Glider
Icon Theme: gnome
GTK+ Modules: canberra-gtk-module, globalmenu-gnome, pk-gtk-module, gail:atk-bridge, gnomebreakpad

Memory status: size: 230653952 vsize: 230653952 resident: 29224960 share: 20140032 rss: 29224960 rss_rlim: 18446744073709551615
CPU usage: start_time: 1250522749 rtime: 653 utime: 623 stime: 30 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/usr/bin/cheese'

[?1034h[Thread debugging using libthread_db enabled]
[New Thread 0xb55feb70 (LWP 4794)]
[New Thread 0xb5fffb70 (LWP 4789)]
[New Thread 0xaeb8bb70 (LWP 4788)]
[New Thread 0xaf5fdb70 (LWP 4787)]
[New Thread 0xafffeb70 (LWP 4779)]
[New Thread 0xb61dbb70 (LWP 4775)]
0x00a29424 in __kernel_vsyscall ()

Thread 1 (Thread 0xb7f2e770 (LWP 4768))

  • #0 __kernel_vsyscall
  • #1 waitpid
    from /lib/libpthread.so.0
  • #2 IA__g_spawn_sync
    at gspawn.c line 382
  • #3 IA__g_spawn_command_line_sync
    at gspawn.c line 694
  • #4 ??
    from /usr/lib/gtk-2.0/modules/libgnomebreakpad.so
  • #5 ??
    from /usr/lib/gtk-2.0/modules/libgnomebreakpad.so
  • #6 <signal handler called>
  • #7 __kernel_vsyscall
  • #8 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #9 *__GI_abort
    at abort.c line 88
  • #10 pa_tls_set
    at pulsecore/thread-posix.c line 200
  • #11 current_thread_tls_set
    at pulsecore/thread-posix.c line 61
  • #12 pa_thread_self
    at pulsecore/thread-posix.c line 145
  • #13 in_worker
    at pulse/thread-mainloop.c line 58
  • #14 pa_threaded_mainloop_lock
    at pulse/thread-mainloop.c line 170
  • #15 pulse_driver_play
    at pulse.c line 734
  • #16 driver_play
    at dso.c line 335
  • #17 ca_context_play_full
    at common.c line 520
  • #18 ca_gtk_play_for_widget
    at canberra-gtk.c line 319
  • #19 dispatch_sound_event
    at canberra-gtk-module.c line 489
  • #20 idle_cb
    at canberra-gtk-module.c line 643
  • #21 g_idle_dispatch
    at gmain.c line 3929
  • #22 g_main_dispatch
    at gmain.c line 1824
  • #23 IA__g_main_context_dispatch
    at gmain.c line 2377
  • #24 g_main_context_iterate
    at gmain.c line 2455
  • #25 IA__g_main_loop_run
    at gmain.c line 2663
  • #26 IA__gtk_main
    at gtkmain.c line 1205
  • #27 main
    at cheese.c line 210


---- Critical and fatal warnings logged during execution ----

** Gdk **: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed 
Output of custom script "/usr/libexec/cheese/cheese-bugreport.sh":
Cheese log:




----------- .xsession-errors (1047 sec old) ---------------------
Nautilus-Share-Message: REFRESHING SHARES
Nautilus-Share-Message: ------------------------------------------
Nautilus-Share-Message: spawn arg "net"
Nautilus-Share-Message: spawn arg "usershare"
Nautilus-Share-Message: spawn arg "info"
Nautilus-Share-Message: end of spawn args; SPAWNING
Nautilus-Share-Message: returned from spawn: SUCCESS: 
Nautilus-Share-Message: exit code 255
Nautilus-Share-Message: ------------------------------------------
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: usershares are currently disabled
[DEBUG]: EnableDisable Called: enabling... True
[DEBUG]: Binding key '<Alt>F12' for '/apps/tomboy/global_keybindings/show_note_menu'
[DEBUG]: Binding key '<Alt>F11' for '/apps/tomboy/global_keybindings/open_start_here'
--------------------------------------------------
Comment 1 Richard Schwarting 2009-08-17 15:37:54 UTC
Yah, disabling dual screen doesn't change anything.

IBM Thinkpad x41, with
00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
Comment 2 Licio Fonseca 2009-08-18 16:56:49 UTC
Hi,

I've tested it running cheese on ubuntu(acer aspire one) and fedora 11(eeepc) and I couldn't reproduce it.
Comment 3 Filippo Argiolas 2009-09-21 17:40:33 UTC
Definitely a pulseaudio related issue, it happens when doing audio stuff happening in fullscreen mode: both with the shutter sound event on "take photo" and with the audio recording in "start recording". I can reproduce it here and goes away if I disable the audio device from the audio capplet.
Comment 4 Filippo Argiolas 2009-09-21 17:42:11 UTC
*** Bug 594108 has been marked as a duplicate of this bug. ***
Comment 5 Bastien Nocera 2009-09-22 15:11:54 UTC
Looks like a libcanberra/pulseaudio-libs bug
Comment 6 Lennart Poettering 2009-09-22 17:28:21 UTC
Which version of libcanberra is this? Could anyone get me a full bt? Is this rawhide?
Comment 7 Filippo Argiolas 2009-09-22 18:43:49 UTC
FWIW, the trace in the duplicate bug (http://bugzilla-attachments.gnome.org/attachment.cgi?id=142456) comes from an abort in the same function (pa_tls_set) but doesn't seem to contain anything related to libcanberra as this one.

I reproduced it on fedora 11, will switch to rawhide in the next few days and try to provide a better trace.
Comment 8 Richard Schwarting 2009-09-22 21:36:35 UTC
I'm not sure what exactly you need, but here's a backtrace from GDB with some checking of various values at the time it crashed, and a 'thread apply all bt'.

=================================================

Assertion 'pthread_setspecific(t->key, userdata) == 0' failed at pulsecore/thread-posix.c:200, function pa_tls_set(). Aborting.

Program received signal SIGABRT, Aborted.
0x00b0d424 in __kernel_vsyscall ()
(gdb) bt

Thread 15 (Thread 0xaeba0b70 (LWP 24347))

  • #0 *__GI___libc_realloc
    at malloc.c line 3734
  • #1 IA__g_realloc
    at gmem.c line 170
  • #2 g_array_maybe_expand
    at garray.c line 339
  • #3 IA__g_array_append_vals
    at garray.c line 132
  • #4 gst_structure_set_field
    at gststructure.c line 699
  • #5 gst_structure_id_set_value
    at gststructure.c line 447
  • #6 gst_caps_structure_intersect_field
    at gstcaps.c line 1120
  • #7 gst_structure_foreach
    at gststructure.c line 988
  • #8 gst_caps_structure_intersect
    at gstcaps.c line 1145
  • #9 gst_caps_intersect
    at gstcaps.c line 1275
  • #10 gst_ffmpegcsp_transform_caps
    at gstffmpegcolorspace.c line 146
  • #11 gst_base_transform_transform_caps
    at gstbasetransform.c line 483
  • #12 gst_base_transform_getcaps
    at gstbasetransform.c line 631
  • #13 gst_pad_get_caps_unlocked
    at gstpad.c line 2132
  • #14 gst_pad_get_caps
    at gstpad.c line 2216
  • #15 gst_pad_peer_get_caps
    at gstpad.c line 2256
  • #16 intersect_caps_func
    at gstutils.c line 2404
  • #17 gst_iterator_fold
    at gstiterator.c line 545
  • #18 gst_pad_proxy_getcaps
    at gstutils.c line 2454
  • #19 gst_pad_get_caps_unlocked
    at gstpad.c line 2132
  • #20 gst_pad_get_caps
    at gstpad.c line 2216
  • #21 gst_pad_peer_get_caps
    at gstpad.c line 2256
  • #22 gst_queue_getcaps
    at gstqueue.c line 463
  • #23 gst_pad_get_caps_unlocked
    at gstpad.c line 2132
  • #24 gst_pad_get_caps
    at gstpad.c line 2216
  • #25 gst_pad_peer_get_caps
    at gstpad.c line 2256
  • #26 gst_base_transform_getcaps
    at gstbasetransform.c line 616
  • #27 gst_pad_get_caps_unlocked
    at gstpad.c line 2132
  • #28 gst_pad_get_caps
    at gstpad.c line 2216
  • #29 gst_base_transform_acceptcaps
    at gstbasetransform.c line 1002
  • #30 gst_pad_accept_caps
    at gstpad.c line 2442
  • #31 gst_proxy_pad_do_acceptcaps
    at gstghostpad.c line 273
  • #32 gst_pad_accept_caps
    at gstpad.c line 2442
  • #33 gst_proxy_pad_do_acceptcaps
    at gstghostpad.c line 273
  • #34 gst_pad_accept_caps
    at gstpad.c line 2442
  • #35 gst_proxy_pad_do_acceptcaps
    at gstghostpad.c line 273
  • #36 gst_pad_accept_caps
    at gstpad.c line 2442
  • #37 gst_pad_peer_accept_caps
    at gstpad.c line 2489
  • #38 gst_ximagesink_buffer_alloc
    at ximagesink.c line 1822
  • #39 gst_base_sink_pad_buffer_alloc
    at gstbasesink.c line 575
  • #40 gst_pad_buffer_alloc_unchecked
    at gstpad.c line 2828
  • #41 gst_pad_alloc_buffer_full
    at gstpad.c line 2905
  • #42 gst_proxy_pad_do_bufferalloc
    at gstghostpad.c line 168
  • #43 gst_pad_buffer_alloc_unchecked
    at gstpad.c line 2828
  • #44 gst_pad_alloc_buffer_full
    at gstpad.c line 2905
  • #45 gst_proxy_pad_do_bufferalloc
    at gstghostpad.c line 168
  • #46 gst_pad_buffer_alloc_unchecked
    at gstpad.c line 2828
  • #47 gst_pad_alloc_buffer_full
    at gstpad.c line 2905
  • #48 gst_proxy_pad_do_bufferalloc
    at gstghostpad.c line 168
  • #49 gst_pad_buffer_alloc_unchecked
    at gstpad.c line 2828
  • #50 gst_pad_alloc_buffer_full
    at gstpad.c line 2905
  • #51 gst_base_transform_prepare_output_buffer
    at gstbasetransform.c line 1245
  • #52 gst_base_transform_handle_buffer
    at gstbasetransform.c line 1877
  • #53 gst_base_transform_chain
    at gstbasetransform.c line 2019
  • #54 gst_pad_chain_data_unchecked
    at gstpad.c line 4057
  • #55 gst_pad_push_data
    at gstpad.c line 4287
  • #56 gst_queue_push_one
    at gstqueue.c line 1047
  • #57 gst_queue_loop
    at gstqueue.c line 1149
  • #58 gst_task_func
    at gsttask.c line 234
  • #59 default_func
    at gsttaskpool.c line 70
  • #60 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #61 g_thread_create_proxy
    at gthread.c line 635
  • #62 start_thread
    at pthread_create.c line 297
  • #63 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130

Thread 14 (Thread 0xb6efab70 (LWP 24346))

  • #0 do_lookup_x
    at do-lookup.h line 73
  • #1 _dl_lookup_symbol_x
    at dl-lookup.c line 338
  • #2 _dl_fixup
    at dl-runtime.c line 114
  • #3 _dl_runtime_resolve
    at ../sysdeps/i386/dl-trampoline.S line 37
  • #4 gst_navigation_send_mouse_event
    at navigation.c line 156
  • #5 gst_ximagesink_handle_xevents
    at ximagesink.c line 1008
  • #6 gst_ximagesink_event_thread
    at ximagesink.c line 1138
  • #7 g_thread_create_proxy
    at gthread.c line 635
  • #8 start_thread
    at pthread_create.c line 297
  • #9 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130

Comment 9 Lennart Poettering 2009-09-22 23:15:01 UTC
Hmm, pthread_setspecific() failing is something that simply cannot happen. This is really weird, and I wonder if PA is actually the culprit here...
Comment 10 Richard Schwarting 2009-09-22 23:34:21 UTC
Indeed.  

I tried again, breaking on pa_tls_set, and then stepped through pthread_setspecific(), and it gets to the "return 0;" at the end.  (Perhaps my earlier gdb session that claimed a return value of 22 is due to try trying to setspecific a second time after it was already set?)

In theory, pa_assert_se() is failing despite getting 0 == 0?  I don't understand :( 

Here's the excerpt from this latest gdb session, though I don't think it adds much:

Breakpoint 1, pa_tls_set (t=0x81c52b0, userdata=0x83eec98) at pulsecore/thread-posix.c:199
199	    r = pthread_getspecific(t->key);
(gdb) next
200	    pa_assert_se(pthread_setspecific(t->key, userdata) == 0);
(gdb) step
__pthread_setspecific (key=5, value=0x83eec98) at pthread_setspecific.c:36
36	  self = THREAD_SELF;
(gdb) step
40	  if (__builtin_expect (key < PTHREAD_KEY_2NDLEVEL_SIZE, 1))
(gdb) 
29	{
(gdb) 
40	  if (__builtin_expect (key < PTHREAD_KEY_2NDLEVEL_SIZE, 1))
(gdb) 
43	      if (KEY_UNUSED ((seq = __pthread_keys[key].seq)))
(gdb) 
93	  return 0;
(gdb) 
94	}
(gdb) 
pa_log_level_meta (level=PA_LOG_ERROR, file=0x60998df "pulsecore/thread-posix.c", line=200, func=0x60999af "pa_tls_set", 
    format=0x60998fc "Assertion '%s' failed at %s:%u, function %s(). Aborting.") at pulsecore/log.c:409
409	    va_start(ap, format);
(gdb) l
Comment 11 Richard Schwarting 2009-09-23 00:29:32 UTC
Created attachment 143763 [details]
Testcase testing output of macros

I wrote a small test checking the outputs of PA_UNLIKELY, __builtin_expect and pa_assert_se given that 0 should be being returned, and I get what we would want (sadly?)

-----------------------------------
PA_UNLIKELY (returns_zero() == 0)
returned 1

__builtin_expect (!! (returns_zero() == 0), 0);
returned 1

 pa_assert_se (returns_zero() == 0);
survived assertion

  pa_assert_se (returns_zero() != 0); /* should die here */
in pa_log_levelv_meta
Aborted
-----------------------------------
Comment 12 Lennart Poettering 2009-09-29 22:27:01 UTC
(In reply to comment #10)
> Indeed.  
> 
> I tried again, breaking on pa_tls_set, and then stepped through
> pthread_setspecific(), and it gets to the "return 0;" at the end.  

This might simply be misleading because you have optimizations enabled. When you gdb through this make sure you compiled your glibc with -O0.
Comment 13 Filippo Argiolas 2010-03-20 17:16:58 UTC
*** Bug 613419 has been marked as a duplicate of this bug. ***
Comment 14 Filippo Argiolas 2010-03-20 18:05:28 UTC
Lennart, looking at empathy similar bug in bugzilla.redhat.com
https://bugzilla.redhat.com/show_bug.cgi?id=532307 I see you managed to fix it
removing extra xmlCleanupParser calls.
We don't do that but yet we have a quite similar and easily reproducible bug.
Do you have any hint about the possible cause?
Comment 15 Filippo Argiolas 2010-03-21 09:17:08 UTC
Just reproduced it with latest cheese, fedora 12, pulseaudio 0.9.21.
Steps to reproduce:
- enable windows and buttons sounds from gnome-volume-control
- start cheese
- press F11
It happens *every time*.
Comment 16 Lennart Poettering 2010-03-23 16:43:32 UTC
Could be something similar to the xmlCleanup thing indeed. Might be worth gdb'ing through cheese and setting a breakpoint on pthread_setspecific() as well as pthread_key_delete() to see if something erronously deletes PA's TLS var. Thats how the empathy issue got tracked down.
Comment 17 Filippo Argiolas 2010-03-23 20:12:12 UTC
(In reply to comment #16)
> Could be something similar to the xmlCleanup thing indeed. Might be worth
> gdb'ing through cheese and setting a breakpoint on pthread_setspecific() as
> well as pthread_key_delete() to see if something erronously deletes PA's TLS
> var. Thats how the empathy issue got tracked down.

BINGO! Breaking on pthread_key_delete was just the right hint!
There is indeed an xmlCleanup call that sneaks in when we call rsvg_term() in cheese-countdown.c (cheese_create_surface_from_svg), commenting out that the crash just goes away.
Now I just have to understand how the countdown widget works (honestly I never even opened cheese-countdown.c before...) and see if I can get rid of that call.
It seems that it creates the surface on style-set and style-set for some reason is emitted when going fullscreen.

Thank you for your precious hint.
Comment 18 Lennart Poettering 2010-03-23 20:23:02 UTC
you probably should just drop the invocation of rsvg_term(). 

(And of course prepare a patch for librsvg that documents that this function should not be called unless followed immediately by an exit())
Comment 19 Lennart Poettering 2010-03-23 20:24:41 UTC
Meh google codesearching for rsvg_term() tells me there's another bunch of projects misusing that call the same way as xmlCleanup().
Comment 20 Filippo Argiolas 2010-03-23 20:50:56 UTC
(In reply to comment #18)
> you probably should just drop the invocation of rsvg_term(). 

Removing rsvg_init() and rsvg_term() completely doesn't seem to cause any harm. I wonder if they are really mandatory.
I guess I'll move them in main() together with the other _init functions (g_threads_init, gst_init, etc...).
Comment 21 Filippo Argiolas 2010-03-24 08:01:11 UTC
Created attachment 156945 [details] [review]
countdown: move rsvg_init and rsvg_term into main

Initialize rsvg at startup and clean it up at exit.
rsvg_term is particularly subtle as it calls xmlCleanupParser()
triggering nasty crashes (e.g. with PulseAudio) with multithread
applications.
See http://0pointer.de/blog/projects/beware-of-rsvg-term.html for more
info.
Rsvg loading seems to work even without these functions so I'm not sure
it's worth to keep them.
Comment 22 Bastien Nocera 2010-03-24 12:06:54 UTC
Filippo, this needs to go in before 2.30.0.

I requested a freeze break for it.
Comment 23 Filippo Argiolas 2010-03-24 12:37:44 UTC
(In reply to comment #22)
> Filippo, this needs to go in before 2.30.0.
> 
> I requested a freeze break for it.

Sure, I already requested a freeze break this morning ;) And also obtained approval. Will commit after lunch probably.
Comment 24 Filippo Argiolas 2010-03-24 15:56:00 UTC
Attachment 156945 [details] pushed as f3d79dd - countdown: move rsvg_init and rsvg_term into main
Comment 25 Michal Schmidt 2010-03-27 22:09:50 UTC
This crash was reported by several people in Fedora 12. I (perhaps wrongly) blamed it on librsvg2 for calling xmlCleanupParser():
https://bugzilla.redhat.com/show_bug.cgi?id=542277#c5
Comment 26 Filippo Argiolas 2010-03-28 08:03:52 UTC
(In reply to comment #25)
> This crash was reported by several people in Fedora 12. I (perhaps wrongly)
> blamed it on librsvg2 for calling xmlCleanupParser():
> https://bugzilla.redhat.com/show_bug.cgi?id=542277#c5

I guess it's legitimate for rsvg_term to call xmlCleanupParser, they should just put a big warning in the docs.
I opened a bug for this, bug 614157, not sure if it is actively maintained though.