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 655751 - totem crashed with SIGSEGV in g_type_name()
totem crashed with SIGSEGV in g_type_name()
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
1.1.x
Other Linux
: Normal critical
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-01 19:53 UTC by Pedro Villavicencio
Modified: 2011-08-10 18:30 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
totem --debug (10.25 KB, text/plain)
2011-08-01 23:26 UTC, lacyc3
  Details
gdb backtrace #1 (35.91 KB, text/plain)
2011-08-02 21:36 UTC, sam_
  Details
Backtrace(Lacking libpeas-dbg) (23.78 KB, text/plain)
2011-08-03 01:08 UTC, Nicholas C L Ipsen
  Details
backtrace (5.76 KB, text/plain)
2011-08-04 11:34 UTC, Adam Dingle
  Details
gdb backtrace (5.69 KB, text/plain)
2011-08-04 21:18 UTC, lacyc3
  Details
Peas debug (2.05 KB, text/plain)
2011-08-04 21:18 UTC, lacyc3
  Details
PEAS_DEBUG=1 totem with all plugins in place (2.07 KB, text/plain)
2011-08-05 08:17 UTC, Lukasz Olszewski
  Details
Fix for libpeas 64-bit-cleanness bug (738 bytes, patch)
2011-08-10 07:34 UTC, Steve Langasek
needs-work Details | Review
updated patch in git-diff format (995 bytes, patch)
2011-08-10 15:46 UTC, Steve Langasek
needs-work Details | Review

Description Pedro Villavicencio 2011-08-01 19:53:23 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/totem/+bug/816740

totem is crashing when open it or just open some files with it:

".

Thread 1 (Thread 4972)

  • #0 g_type_name
    at /build/buildd/glib2.0-2.29.14/./gobject/gtype.c line 3287
  • #1 g_typelib_get_dir_entry_by_gtype
    at girepository/gitypelib.c line 206
  • #2 find_by_gtype_foreach
    at girepository/girepository.c line 576
  • #3 find_by_gtype_foreach
    at girepository/girepository.c line 566
  • #4 g_hash_table_foreach
    at /build/buildd/glib2.0-2.29.14/./glib/ghash.c line 1420
  • #5 g_irepository_find_by_gtype
    at girepository/girepository.c line 616
  • #6 peas_gi_get_method_info
    from /usr/lib/libpeas-1.0.so.0
  • #7 peas_extension_call_valist
    from /usr/lib/libpeas-1.0.so.0
  • #8 peas_extension_call
    from /usr/lib/libpeas-1.0.so.0
  • #9 g_closure_invoke
    at /build/buildd/glib2.0-2.29.14/./gobject/gclosure.c line 773
  • #10 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3271
  • #11 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3002
  • #12 g_signal_emit
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3059
  • #13 g_closure_invoke
    at /build/buildd/glib2.0-2.29.14/./gobject/gclosure.c line 773
  • #14 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3341
  • #15 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3002
  • #16 g_signal_emit
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3059
  • #17 peas_engine_set_loaded_plugins
    from /usr/lib/libpeas-1.0.so.0
  • #18 object_set_property
    at /build/buildd/glib2.0-2.29.14/./gobject/gobject.c line 1199
  • #19 g_object_set_property
    at /build/buildd/glib2.0-2.29.14/./gobject/gobject.c line 1929
  • #20 g_settings_binding_key_changed
    at /build/buildd/glib2.0-2.29.14/./gio/gsettings.c line 2615
  • #21 g_settings_bind_with_mapping
    at /build/buildd/glib2.0-2.29.14/./gio/gsettings.c line 2918
  • #22 g_settings_bind
    at /build/buildd/glib2.0-2.29.14/./gio/gsettings.c line 2742
  • #23 totem_plugins_engine_get_default
    at plugins/totem-plugins-engine.c line 141
  • #24 totem_object_plugins_init
    at totem-object.c line 376
  • #25 app_init
    at totem.c line 156
  • #26 app_command_line
    at totem.c line 223
  • #27 ffi_call_unix64
    at ../src/x86/unix64.S line 75
  • #28 ffi_call
    at ../src/x86/ffi64.c line 486
  • #29 g_cclosure_marshal_generic
    at /build/buildd/glib2.0-2.29.14/./gobject/gclosure.c line 1146
  • #30 g_closure_invoke
    at /build/buildd/glib2.0-2.29.14/./gobject/gclosure.c line 773
  • #31 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3271
  • #32 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3012
  • #33 g_signal_emit
    at /build/buildd/glib2.0-2.29.14/./gobject/gsignal.c line 3059
  • #34 g_application_run
    at /build/buildd/glib2.0-2.29.14/./gio/gapplication.c line 1303
  • #35 main
    at totem.c line 280

Comment 1 Philip Withnall 2011-08-01 22:13:01 UTC
Would it be possible to get a backtrace with libpeas' debug symbols installed? Also, can the reporters please try disabling all their Totem plugins[1] and re-enabling them one-by-one to see if it's a specific plugin which is causing the crash? Thanks.

[1]: Edit the active-plugins key of the org.gnome.Totem GSettings schema.
Comment 2 lacyc3 2011-08-01 23:26:19 UTC
Created attachment 193023 [details]
totem --debug
Comment 3 lacyc3 2011-08-01 23:26:35 UTC
I am the reporter.

I installed libpeas-dev package, I hope it contains debug symbols.

Installed plugins:
~# gsettings get org.gnome.totem active-plugins
['skipto', 'chapters', 'screenshot', 'media_player_keys', 'screensaver', 'movie-properties', 'save-file', 'youtube']

Disabling plugins: ~# gsettings set org.gnome.totem active-plugins []

Totem still crashes.
Comment 4 Philip Withnall 2011-08-02 07:08:26 UTC
(In reply to comment #3)
> I am the reporter.
> 
> I installed libpeas-dev package, I hope it contains debug symbols.

Attachment #193023 [details] isn't a backtrace. To get a backtrace, you need to run Totem inside gdb, as described here: https://live.gnome.org/GettingTraces/Details

Basically, you need to run the following commands:
gdb totem
run
(Reproduce the crash)
t a a bt
(Copy the full backtrace to a new comment on this bug report)

Thanks!
Comment 5 sam_ 2011-08-02 21:36:03 UTC
Created attachment 193106 [details]
gdb backtrace #1

If you'd like to view the other two files let me know.
Comment 6 sam_ 2011-08-02 21:41:55 UTC
Actually there is no crash. Totem is in a loop and just shades. It doesn't open a file when it's open because it's unresponsive. After running a while gdb outputs the segfault message.
If you click on a video file to open it with totem it just disappears.
Comment 7 Philip Withnall 2011-08-02 22:03:19 UTC
(In reply to comment #5)
> Created an attachment (id=193106) [details]
> gdb backtrace #1
> 
> If you'd like to view the other two files let me know.

That backtrace is less useful than the first. Please make sure you have the debug symbols installed for GLib, GIR and libpeas. Thanks.

(In reply to comment #6)
> Actually there is no crash. Totem is in a loop and just shades. It doesn't open
> a file when it's open because it's unresponsive. After running a while gdb
> outputs the segfault message.

If gdb is outputting a segfault message then Totem is crashing.
Comment 8 Nicholas C L Ipsen 2011-08-03 01:08:41 UTC
Created attachment 193119 [details]
Backtrace(Lacking libpeas-dbg)

I have a very hard time finding the debug package for libpeas, but I installed the ones for libgir and glib, and ran the backtrace.

Like sam_ describes, when opening totem without asking it to open a video file, it shades and hangs, and gdb outputs the segfult message after a little while. Totem keeps hanging around 'till you quit GDB.
Comment 9 Nicholas C L Ipsen 2011-08-03 01:09:30 UTC
Comment on attachment 193119 [details]
Backtrace(Lacking libpeas-dbg)

I have a very hard time finding the debug package for libpeas, but I installed the ones for libgir and glib, and ran the backtrace.

Like sam_ describes, when opening totem without asking it to open a video file, it shades and hangs, and gdb outputs the segfault message after a little while. Totem keeps hanging around 'till you quit GDB.
Comment 10 Philip Withnall 2011-08-03 19:58:39 UTC
(In reply to comment #8)
> Created an attachment (id=193119) [details]
> Backtrace(Lacking libpeas-dbg)
> 
> I have a very hard time finding the debug package for libpeas, but I installed
> the ones for libgir and glib, and ran the backtrace.
> 
> Like sam_ describes, when opening totem without asking it to open a video file,
> it shades and hangs, and gdb outputs the segfult message after a little while.
> Totem keeps hanging around 'till you quit GDB.

Again, that backtrace is mostly missing. There should be about 35 frames in there, each with symbol information (not a message saying “No symbol table info available”).
Comment 11 Adam Dingle 2011-08-04 11:34:26 UTC
Created attachment 193241 [details]
backtrace
Comment 12 Adam Dingle 2011-08-04 11:36:25 UTC
I'm seeing this too: in the current Ubuntu Oneiric build, totem crashes on startup, even when I've disabled all plugins as suggested above.

I've attached a backtrace generated with all the necessary debug symbols installed.
Comment 13 Philip Withnall 2011-08-04 18:44:10 UTC
(In reply to comment #11)
> Created an attachment (id=193241) [details]
> backtrace

That's a good backtrace, thanks. Would you mind disabling all your plugins (as per comment #1) and re-enabling them one-by-one to see if it's a specific plugin which is causing the crash?

If Totem continues to crash with all your plugins disabled, could you get a backtrace of that crash as well and attach it here please.

Separately (i.e. with all your original plugins enabled), would you mind running Totem with the following command:
PEAS_DEBUG=1 totem
and attaching the log here? There's no need to get a backtrace for this one.

Thanks!
Comment 14 Ignacio Casal Quinteiro (nacho) 2011-08-04 18:46:32 UTC
I tried totem in fedora and I don't get this crash.
Comment 15 lacyc3 2011-08-04 21:17:29 UTC
I created backtrace (I hope it useful).

When I renamed /usr/lib/totem/plugins directory to plugins2, totem worked well. It's interesting because plugins disabled in gsettings.
Comment 16 lacyc3 2011-08-04 21:18:08 UTC
Created attachment 193278 [details]
gdb backtrace
Comment 17 lacyc3 2011-08-04 21:18:35 UTC
Created attachment 193279 [details]
Peas debug
Comment 18 Lukasz Olszewski 2011-08-05 08:02:47 UTC
OK, I've just checked all the plugins by removing them out of the plugins directory and then restoring them one by one.
These caused totem crash in my case:
properties
media-player-keys
chapters
save-file
screensaver
screenshot
youtube
Comment 19 Lukasz Olszewski 2011-08-05 08:17:43 UTC
Created attachment 193295 [details]
PEAS_DEBUG=1 totem with all plugins in place
Comment 20 Steve Frécinaux 2011-08-05 08:24:12 UTC
Could you please attach your traces as text files rather than binary files?
Comment 21 Steve Frécinaux 2011-08-05 08:30:12 UTC
Could you please give us the versions of totem, libpeas, gir-1.2-totem-1.0 and gir-1.2-peas-1.0 you have installed?

Especially, please ensure the versions of the gir package and the bare package match.
Comment 22 Lukasz Olszewski 2011-08-06 07:56:04 UTC
totem 3.0.1
libpeas 1.1.1
gir1.2-peas-1.0 1.1.1
gir1.2-totem-1.0 3.0.1
Comment 23 Philip Withnall 2011-08-06 11:48:16 UTC
(In reply to comment #22)
> totem 3.0.1
> libpeas 1.1.1
> gir1.2-peas-1.0 1.1.1
> gir1.2-totem-1.0 3.0.1

Can you please try either:
 • downgrading your version of libpeas to 1.0.x; or
 • upgrading your version of Totem to 3.1.x.

There were some API changes/deprecations between libpeas 1.0.x and 1.1.x which are most likely what's causing the problem. Totem 3.1.x has adapted to them, but 3.0.x has not.

Thanks.
Comment 24 Lukasz Olszewski 2011-08-06 13:01:25 UTC
Do you have plans on pushing v 3.1 to Ubuntu oneiric alpha any time soon?
Comment 25 Philip Withnall 2011-08-07 07:02:13 UTC
(In reply to comment #24)
> Do you have plans on pushing v 3.1 to Ubuntu oneiric alpha any time soon?

That's entirely up to the Ubuntu packagers, and nothing to do with Totem upstream. We made a 3.1.4 tarball release 4 days ago which could be packaged.
Comment 26 Steve Frécinaux 2011-08-08 08:21:42 UTC
Well even with the deprecated stuff, I'd say it's a bug if older programs don't work anymore. There might be a bug in the way deprecated functions have been reimplemented.

Looking at the stacktrace it might be a bug in the "new" peas_extension_call().
Comment 27 Steve Langasek 2011-08-10 07:34:16 UTC
Created attachment 193516 [details] [review]
Fix for libpeas 64-bit-cleanness bug

This is not a bug in totem, but in libpeas.  libpeas 1.1.1 includes code which is incorrectly casting a pointer to an integer and returning it from a function declared with a return type of GType.  A GType is not an unsigned integer!  It's an unsigned *long*, and the difference is critical on 64-bit systems as an unsigned long is large enough to hold a pointer and an unsigned integer is not.

The attached patch corrects this issue, solving the totem segfaults on x86_64 installs.

I would be interested in knowing why the author of this code wrote it the way he did, because this *specific* error in gobject type handling is, in my experience, the single most common 64-bit problem that occurs in GNOME code.  I don't believe developers are all independently arriving at the same wrong conclusion about how to write gobjects, so I suspect somewhere out there is some documentation telling people to do it wrong.  I would love to track down this wrong documentation and set it on fire. :)
Comment 28 Steve Frécinaux 2011-08-10 08:52:53 UTC
Steve, that's a good catch.

I think the issue is missing GPOINTER_TO_GTYPE and GTYPE_TO_POINTER macros in GLib, because developers have been told to use the macros instead of casts and GType is a typedef so it tricks developers used to x86 and not owning a newer x86_64 machine ;-)
Comment 29 Steve Frécinaux 2011-08-10 08:57:25 UTC
Review of attachment 193516 [details] [review]:

This patch looks good, but shouldn't you also change the way the data is set? (line 151 in loaders/c/peas-plugin-loader-c.c)

Also could you please attach your patch in git-diff format so I can apply it and you get credits? Please give a meaningful commit message as well.

Thank you.
Comment 30 Steve Langasek 2011-08-10 15:46:17 UTC
Created attachment 193568 [details] [review]
updated patch in git-diff format

Hi Steve,

Updated patch attached in git-diff format.  Commit message following the standard git conventions, let me know if there's anything else you need there as far as formatting (is there a convention for including references to GNOME bug #s?)

As for setting the data, the GUINT_TO_GPOINTER macro happens to be safe (because it never casts to a guint, only to a gulong).  I have no opinion on whether you should avoid the macro here.
Comment 31 Ignacio Casal Quinteiro (nacho) 2011-08-10 16:07:18 UTC
Review of attachment 193568 [details] [review]:

Still missing the g_object_set_data cast?
Comment 32 Steve Langasek 2011-08-10 16:34:43 UTC
It's not "missing"; as I said, I have no opinion on whether the macro use should remain in the setting case.  I can certainly replace it with a cast if that's what's wanted.
Comment 33 Steve Frécinaux 2011-08-10 18:30:37 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.