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 694142 - Crash on media pass on commandline
Crash on media pass on commandline
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.7.x
Other Linux
: Normal normal
: 3.22
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-02-19 02:56 UTC by Zeeshan Ali
Modified: 2016-03-31 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix crash when passing media on command line (918 bytes, patch)
2013-02-19 09:01 UTC, Alexander Larsson
committed Details | Review

Description Zeeshan Ali 2013-02-19 02:56:42 UTC
There seems to have been a regression introduce lately that causes a crash if you pass a media to boxes on commandline:

Program received signal SIGSEGV, Segmentation fault.
0x000000000042a178 in _____lambda198_ (_data4_=0x1e965a0) at /extra-data/checkout/gnome/gnome-boxes/src/app.vala:271
271	                call_when_ready (() => {
Missing separate debuginfos, use: debuginfo-install celt051-0.5.1.3-5.fc18.x86_64 gsm-1.0.13-7.fc18.x86_64 gtk-vnc2-0.5.1-5.fc18.x86_64 gvnc-0.5.1-5.fc18.x86_64 json-c-0.10-2.fc18.x86_64 libgudev1-197-1.fc18.2.x86_64 libnl3-3.2.21-1.fc18.x86_64 libpng-1.5.13-1.fc18.x86_64 libunistring-0.9.3-6.fc18.x86_64 libusbx-1.0.14-1.fc18.x86_64 libwayland-client-1.0.3-1.fc18.x86_64 libwayland-server-1.0.3-1.fc18.x86_64 systemd-libs-197-1.fc18.2.x86_64 tracker-0.14.4-1.fc18.x86_64 xz-libs-5.1.2-2alpha.fc18.x86_64
(gdb) bt
  • #0 _____lambda198_
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 271
  • #1 ______lambda198__boxes_app_call_ready_func
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 271
  • #2 __lambda179_
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 198
  • #3 ___lambda179__boxes_app_ready
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 197
  • #4 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #5 g_closure_invoke
    at gclosure.c line 777
  • #6 signal_emit_unlocked_R
    at gsignal.c line 3566
  • #7 g_signal_emit_valist
    at gsignal.c line 3314
  • #8 g_signal_emit_by_name
    at gsignal.c line 3407
  • #9 __lambda192_
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 182
  • #10 ___lambda192__gasync_ready_callback
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 179
  • #11 g_simple_async_result_complete
    at gsimpleasyncresult.c line 777
  • #12 boxes_app_setup_sources_co
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 382
  • #13 boxes_app_setup_sources_ready
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 388
  • #14 g_simple_async_result_complete
    at gsimpleasyncresult.c line 777
  • #15 boxes_foreach_filename_from_dir_co
    at /extra-data/checkout/gnome/gnome-boxes/src/util.vala line 175
  • #16 boxes_foreach_filename_from_dir_ready
    at /extra-data/checkout/gnome/gnome-boxes/src/util.vala line 177
  • #17 next_async_callback_wrapper
    at gfileenumerator.c line 297
  • #18 g_task_return_now
    at gtask.c line 1105
  • #19 complete_in_idle_cb
    at gtask.c line 1114
  • #20 g_idle_dispatch
    at gmain.c line 5199
  • #21 g_main_dispatch
    at gmain.c line 3048
  • #22 g_main_context_dispatch
    at gmain.c line 3624
  • #23 g_main_context_iterate
    at gmain.c line 3695
  • #24 g_main_context_iteration
    at gmain.c line 3756
  • #25 g_application_run
    at gapplication.c line 1620
  • #26 boxes_app_run
    at /extra-data/checkout/gnome/gnome-boxes/src/app.vala line 298
  • #27 _vala_main
    at /extra-data/checkout/gnome/gnome-boxes/src/main.vala line 85
  • #28 main
    at /extra-data/checkout/gnome/gnome-boxes/src/main.vala line 69

Need to fix this before releasing tomorrow.
Comment 1 Alexander Larsson 2013-02-19 09:01:30 UTC
Created attachment 236730 [details] [review]
Fix crash when passing media on command line

We need the call_when_ready delegate to be "owned" or we don't get
a ref to the continuation (so it'll be freed when we later call it).
Comment 2 Christophe Fergeau 2013-02-19 09:35:22 UTC
Review of attachment 236730 [details] [review]:

Thanks for debugging this!

::: src/app.vala
@@ +195,3 @@
         if (is_ready)
             func ();
         ready.connect (() => {

Should vala ref the delegate and the continuation when we use it in a callback?
Comment 3 Alexander Larsson 2013-02-19 09:47:39 UTC
There is no way to "ref" an unowned delegate, its just a function pointer.
The only way to handle this is to use function pointer + destroy notify in a _full() style callback. This is what an owned delegate means in vala.
Comment 4 Alexander Larsson 2013-02-19 09:48:06 UTC
Attachment 236730 [details] pushed as 6d3253a - Fix crash when passing media on command line