Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 259891 - media-libs/libcanberra-0.11-r1 segmentation fault in gtk_module_init (with app-editors/emacs-cvs-23.0.91)
Summary: media-libs/libcanberra-0.11-r1 segmentation fault in gtk_module_init (with ap...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2009-02-22 12:48 UTC by He Zhitong
Modified: 2009-03-28 18:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
log (log,25.55 KB, text/plain)
2009-03-15 16:56 UTC, He Zhitong
Details
GDB backtrace (gdb.out,9.54 KB, text/plain)
2009-03-16 14:09 UTC, Ulrich Müller
Details
Patch from upstream (libcanberra-0.11-dont-crash-without-default-display.patch,2.92 KB, patch)
2009-03-23 22:19 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description He Zhitong 2009-02-22 12:48:48 UTC
app-editors/emacs-cvs-23.0.90: daemon crash if I run client under X twice.

Reproducible: Always

Steps to Reproduce:
1. run "emacs --daemon" to start the emacs  daemon server.
2. run "emacsclient -c" twice under X.


Actual Results:  
the emacs daemon automatically quit, it seems it was crash.

Expected Results:  
emacs daemon should be always there.

$ eix emacs-cvs
[U] app-editors/emacs-cvs
     Available versions:  (23)  (~)23.0.60_pre20090125!s (~)23.0.90!s [M](~)23.0.9999!s {M}(~)23.0.9999-r1!s
	{X Xaw3d alsa dbus gif gpm gtk gzip-el hesiod jpeg kerberos m17n-lib motif png sound source spell svg tiff toolkit-scroll-bars xft xpm}
     Installed versions:  23.0.90(23)!s(05:25:42 AM 02/22/2009)(X alsa dbus gif gpm gtk jpeg png tiff toolkit-scroll-bars xft xpm -Xaw3d -gzip-el -hesiod -kerberos -m17n-lib -motif -sound -source -spell -svg)
     Homepage:            http://www.gnu.org/software/emacs/
     Description:         The extensible, customizable, self-documenting real-time display editor
Comment 1 Ulrich Müller gentoo-dev 2009-02-22 18:02:09 UTC
> Steps to Reproduce:
> 1. run "emacs --daemon" to start the emacs  daemon server.
> 2. run "emacsclient -c" twice under X.

Does this also happen if you start Emacs with "emacs -Q --daemon"?
Comment 2 He Zhitong 2009-03-15 16:56:06 UTC
Created attachment 185099 [details]
log

(In reply to comment #1)
> > Steps to Reproduce:
> > 1. run "emacs --daemon" to start the emacs  daemon server.
> > 2. run "emacsclient -c" twice under X.
> 
> Does this also happen if you start Emacs with "emacs -Q --daemon"?
> 

Yes, it do crash too.
I've try 23.0.91 and the latest cvs version these days. 
Same things happen.

If a emacsclient with "-t" is running, it will crash with daemon too.
Buf if a emacsclient with "-c" is running, the bug won't appear.
I straced with "emacsclient -c", no exception found.
I straced -p (process of daemon) again, and found something.
after the first client connected to daemon, the dameon read some lib related to gtk+
If I don't close the first(keep an X client open), clients followed use same lib in memory and no exceptions found.

after quit all client opened before and start a new client, the daemon crash.
it seems that the dameon stat gtk+ libiary failed, there's some stace log for it.
get it from "strace -p `pidof emacs` &> file"
Comment 3 Ulrich Müller gentoo-dev 2009-03-16 11:33:05 UTC
I succeeded to reproduce it, but only under Gnome (under Xfce4 it works for me). What desktop are you using?

(In reply to comment #2)
> Created an attachment (id=185099) [edit]
> log

From your log:
access("/usr/lib64/gtk-2.0/modules/libcanberra-gtk-module.so", F_OK) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---

Does the bug still happen if you unmerge media-libs/libcanberra?
Comment 4 He Zhitong 2009-03-16 13:00:19 UTC
(In reply to comment #3)
> I succeeded to reproduce it, but only under Gnome (under Xfce4 it works for
> me). What desktop are you using?
> 
> (In reply to comment #2)
> > Created an attachment (id=185099) [edit]
> > log
> 
> From your log:
> access("/usr/lib64/gtk-2.0/modules/libcanberra-gtk-module.so", F_OK) = 0
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> 
> Does the bug still happen if you unmerge media-libs/libcanberra?
> 

I am using gnome desktop enviroment(gnome-light).
thanks to your suggestion, it works! after unmerge libcanberra.
I've try to rebuild emacs with or without alsa and sound USE, rebuild libcanberra changing its USE and even update to a testing version, but problem still exists.
but gnome-sound-properties in gnome-control-center(with USE=sound) depends libcanberra.
I almost never use gnome-sound-properties so the way unmerging libcanberra is suitable for me.
but I think that's not a good attitude towards bug ^_^.
Comment 5 Ulrich Müller gentoo-dev 2009-03-16 13:38:42 UTC
(In reply to comment #4)
> thanks to your suggestion, it works! after unmerge libcanberra.
> [...]
> but I think that's not a good attitude towards bug ^_^.

Of course unmerging libcanberra is not the final bugfix. We will investigate this problem further.
Comment 6 Ulrich Müller gentoo-dev 2009-03-16 14:09:07 UTC
Created attachment 185188 [details]
GDB backtrace

The GDB backtrace shows that the segfault happens in gtk_module_init of canberra-gtk-module. Looks like gtk_settings_get_default() returns a NULL pointer.
Comment 7 Ulrich Müller gentoo-dev 2009-03-16 16:38:06 UTC
(In reply to comment #6)
> Looks like gtk_settings_get_default() returns a NULL pointer.

And this happens because there is no default display for GDK at this point.
Comment 8 Ulrich Müller gentoo-dev 2009-03-16 17:51:53 UTC
Reported upstream: <https://bugs.freedesktop.org/show_bug.cgi?id=20693>
Comment 9 Ulrich Müller gentoo-dev 2009-03-23 22:19:52 UTC
Created attachment 186050 [details, diff]
Patch from upstream

Attached patch from the upstream git repository fixes the segmentation fault.
Comment 10 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-03-23 23:56:40 UTC
looks fine.
Comment 11 Ulrich Müller gentoo-dev 2009-03-28 18:27:18 UTC
Fixed in libcanberra-0.11-r5.

Thank you for reporting the issue.