gnome-session: malloc() memory corruption

Bug #93613 reported by LGB [Gábor Lénárt]
6
Affects Status Importance Assigned to Milestone
gnome-session (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gnome-session

After upgrading from edgy to feisty (on i386 arch), logging in at gdm login screen will result in a gialog saying:

Your session only lasted less than 10 seconds. If you have not logged out yourself, this could mean that there is some installation problem or that you may be out of diskspace. Try logging in with one of the failsafe sessions to see if you can fix this problem.

.xsession-errors contains:

seahorse nautilus module initialized
Initializing nautilus-open-terminal extension
Initializing gnome-mount extension
*** glibc detected *** /usr/bin/gnome-session: malloc(): memory corruption: 0x08
2694a0 ***

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

The full .xsession-errors file

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your bug report. The crash looks like a memory corruption. Could you try to get a valgrind log for it? (you can follow the instructions from https://wiki.ubuntu.com/Valgrind for that)

Changed in gnome-session:
assignee: nobody → desktop-bugs
importance: Undecided → Medium
status: Unconfirmed → Needs Info
Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

Strange. This bug triggers _all_ the time I tried to start gnome session (altough sometimes it simply existed, sometimes presented a dialog instead). Now, changed gnome-session to a little shell script to do valgrind the renamed "real" gnome-session, its log it attached. However, the bug was _NOT_ triggered this time, everything worked. So I restored binary gnome-session, and not it works well without problem (though I've managed to save session before this move). The only reamining .xsession-errors file now:

/etc/gdm/PreSession/Default: Registering your session with wtmp and utmp
/etc/gdm/PreSession/Default: running: /usr/X11R6/bin/sessreg -a -w /var/log/wtmp
 -u /var/run/utmp -x "/var/lib/gdm/:0.Xservers" -h "" -l ":0" "lgb"
/etc/gdm/Xsession: Beginning session setup...
No profile for user 'lgb' found
** Message: Another GPG agent already running

SESSION_MANAGER=local/vega:/tmp/.ICE-unix/25104

** (update-notifier:25227): WARNING **: not starting because user is not in admi
n group

sys:1: Warning: Two different plugins tried to register 'NautilusActions'.
sys:1: Warning: g_type_add_interface_dynamic: assertion `G_TYPE_IS_INSTANTIATABL
E (instance_type)' failed
sys:1: Warning: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed
sys:1: Warning: g_object_weak_ref: assertion `G_IS_OBJECT (object)' failed
seahorse nautilus module initialized
Initializing nautilus-open-terminal extension
Initializing gnome-mount extension

** (gnome-session:25104): WARNING **: Host name lookup failure on localhost.
Must be run as member of admin group
/etc/init.d/xprint: 531: Syntax error: Bad substitution
/lib/i386/libjavaplugin_nscp.so: cannot open shared object file: No such file or
 directory

Also please note, that only ssh still does not work: according to strace output on ssh it blocks at connecting to /tmp/ssh-JhRQj25104/agent.25104.seahorse
After its deletion, ssh worked again.

Revision history for this message
Sebastien Bacher (seb128) wrote :

The log mentions /usr/bin/gnome-session.real which doesn't exist on an Ubuntu desktop. Where did you get it? Could you run "dpkg -l gnome-session", "dpkg -S /usr/bin/gnome-session.real" and "ls -l /usr/bin/gnome-session.real" and copy that to a comment? Could you also get a valgrind log with gnome-session-dbgsym libglib2.0-0-dbg libgtk2.0-0-dbg installed?

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

As I've mentioned above (in the comment of valgrind log attachment), this is the result of my work: I renamed gnome-session to gnome-session.real, and write a shell script with name of gnome-session with the needed valgrind command line in it (referring for the original binary of course, which was gnome-session.real).

Also, there is no point to try further tests, since after that move everything started to work (even after renamed gnome-session.real back to gnome-session). I've no idea ...

Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you get a debug log anyway? It might be useful even if the bug happens every now and then.

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

Ok, I will (however I can't do this at this very moment). By the way, I could not find package named gnome-session-dbgsym or similar, though I've just installed libglib2.0-0-dbg libgtk2.0-0-dbg to prepare for the valgrind task.

Revision history for this message
Sebastien Bacher (seb128) wrote :

https://wiki.ubuntu.com/DebuggingProgramCrash describes how to install a dbgsym

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

Ok. Hope it was well done now.

Revision history for this message
Pete Jewell (boredbypolitics) wrote :

I've recently upgraded to fiesty from edgy, and I'm experiencing the same problem (on initial upgrade I wasn't experiencing this problem - about 3/4 days ago).

I've tried the method of renaming gnome-session with a .real extension, and having a shell script running the following command as gnome-session in /usr/bin:

#!/bin/bash
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log /usr/bin/gnome-session.real $*

I also found that running like this did not produce the crash. So I logged out and renamed the files back (leaving gnome-session and gnome-session.valgrind), then logged back in again via gdm. I'm getting the crash again!

I'll try changing it back and logging in and out a few times, to see if I can reproduce it. In the meantime, here's the valgrind.log produced.

Revision history for this message
Sebastien Bacher (seb128) wrote :

The new valgrind log has an error:

==12743== Invalid write of size 1
==12743== at 0x805CD54: update_trans_effect (splash-widget.c:646)
==12743== by 0x48323C5: (within /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4831DF1: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4834DCE: (within /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4835178: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4260043: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.1000.11)
==12743== by 0x805638D: main (main.c:547)
==12743== Address 0x54075E8 is 0 bytes inside a block of size 5,184 free'd
==12743== at 0x402123A: free (vg_replace_malloc.c:233)
==12743== by 0x4839130: g_free (in /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x451F1CC: (within /usr/lib/libgdk_pixbuf-2.0.so.0.1000.11)
==12743== by 0x451EC6F: (within /usr/lib/libgdk_pixbuf-2.0.so.0.1000.11)
==12743== by 0x47C997B: g_object_unref (in /usr/lib/libgobject-2.0.so.0.1200.11)
==12743== by 0x805D230: layout_icon (splash-widget.c:508)
==12743== by 0x805D592: splash_widget_add_icon (splash-widget.c:573)
==12743== by 0x805D802: splash_update (splash-widget.c:687)
==12743== by 0x8052D8C: run_command_prop (manager.c:415)
==12743== by 0x8052F9F: start_client (manager.c:644)
==12743== by 0x80531EE: update_save_state (manager.c:1367)
==12743== by 0x80544DF: register_client (manager.c:928)
==12743== by 0x40F0516: _SmsProcessMessage (in /usr/lib/libSM.so.6.0.0)
==12743== by 0x4105EF0: IceProcessMessages (in /usr/lib/libICE.so.6.3.0)
==12743== by 0x40A0604: (within /usr/lib/libgnomeui-2.so.0.1788.4)
==12743== by 0x485B40C: (within /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4831DF1: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4834DCE: (within /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4835178: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.1200.11)
==12743== by 0x4260043: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.1000.11)
==12743== by 0x805638D: main (main.c:547)

Changed in gnome-session:
status: Needs Info → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you attach your .gnome2/session to the bug?

Revision history for this message
Pete Jewell (boredbypolitics) wrote :

One .gnome2/session attached.

Revision history for this message
François Montel (zerohalo) wrote :

I'm experiencing the same problem after upgrading from edgy to feisty.

.xsession-errors attached

Revision history for this message
Thiago Teixeira (tvst) wrote :

I've been getting the same error here after a clean feisty install. Well, the install was not *entirely* clean since I kept my home partition with all its hidden configuration files. Anyways, when I press the OK button on the "Your session lasted (...)" dialog box, X restarts and gives me the gdm login screen again. If I do not click OK (that is, if I leave the warning on the screen), I can use the computer normally. The only thing I cannot do is run gnome-session-properties, but that's understandable because gnome-session is probably not running.

What is really strange is that I don't have a ~/.gnome2/session file on my system. Could this be the source of the problem? Is there any way to manually make a sessions file?

Revision history for this message
Thiago Teixeira (tvst) wrote :

hmmm... apparently if i start a failsafe terminal session then run gnome-session from within the terminal, i get no error message and everything seems to work fine.

Revision history for this message
Thiago Teixeira (tvst) wrote :

scratch that. i *do* get an error message on the terminal, complaining about the malloc error still. the only thing that's different is that i don't get the "Your session lasted (...)" error.

Revision history for this message
Thiago Teixeira (tvst) wrote :

Ok, this is solved for me, but I'm not sure what did it. Browsing the Ubuntu forums I found the problem may be a permissions issue. They mentioned it could be the permissions/user/group on the .ICEauthority file, but I don't think that was the case for me. I even deleted the file (it comes back, so that's ok) but the problem persisted. So I created a new user and saw that everything worked for him. I, then, compared the everything I could (with 'ls -al') between my user and the new one and couldn't find any differences. So I moved all my hidden folders into a temporary folder with 'mkdir ~/hidden && mv .* ~/hidden'. Then I logged in and it was all good. Next I slowly started moving things back from the hidden folder. I'll let you know which folder was the problematic one, but if it's .gconf, i'm not descending into its subfolders!

Revision history for this message
Thiago Teixeira (tvst) wrote :

Well, here's how it turned out: due to a few other issues I was having I just decided to rename my home folder and reinstall feisty. After that, I moved all my files back and most of my hidden config directories. I *did not* move .gconf, .gnome, and .gnome2 back. At that point, everything worked perfectly. Then I started apt-getting my favorite software. At some point, yesterday, after I thought the problem was finally dealt with, I got the same "Your session lasted (...)" message. It was happening every time I logged in after that. Since I had just installed the mail notification sys-tray applet, I decided to go into its preferences and unselect "autostart mail notification upon session opening". It worked. The problem went away. Every time I re-select that option, the problem comes back. This is very strange because the .xsession-errors file does not mention that program at all. In any case, I just thought someone else may want to know that, at least in my case, it seems the mail notification applet is the culprit.

Revision history for this message
Dean Loros (autocrosser) wrote :

I am having a similar problem with the testing Gusty (current updates--06-10-2007) I tried to add a gksudo to my start-up programs & now even after reverting to a older copy from my Feisty install, I get a gksudo error if I change anything in my start-up apps. Please contact me if more info is needed. I have not tried with another user as of yet.

Revision history for this message
Dean Loros (autocrosser) wrote :

I just tried with a testing user & managed to "lock-up" the system completely--xsessons-errors as follows:

Revision history for this message
Sebastien Bacher (seb128) wrote :

That might be http://bugzilla.gnome.org/show_bug.cgi?id=446558 which has been fixed upstream. Do you have enough icons to reach the border of the splash image?

Revision history for this message
Stéphane Grimal (mirmidon) wrote :

Hello, I have the same problem.

I use my browser (Firefox) when the system crash.

At reboot, gnome-session crash during launch.

See my .xsession-errors.

Revision history for this message
Thiago Teixeira (tvst) wrote :

Apparently, my issue with the mail-notification applet was due to what Sebastian said above: my splash screen was too small for all its icons. I just changed it to a larger one and everything works quite peachy!

Revision history for this message
Sebastien Bacher (seb128) wrote :

closing the bug considering that's the splash screen issue which has been fixed in gutsy, feel free to reopen if you still get the issue with the new version though

Changed in gnome-session:
status: Confirmed → Fix Released
Revision history for this message
RobertZenz (robert-zenz) wrote :

I get the same problem. Upgrade from Edgy to Feisty.

But I think tvst is on the right way. I haven't installed the mail-notification applet, but sometimes I get an error message in the .xsession-errors that there was an error during the loading of an applet (height -23, width 24) instead of the malloc, and sometimes it's only telling me that there was an error during connecting to the session-manager (you find that as attachment). But I couldn't figure out which applet it could be, 'cause all work fine.

Maybe that's the problem, that gnome is trying to load an applet which is corrupted or does not exist ('cause all applets and the panel loads fine behind the message of the ten seconds session). But then there's the question, why only the 'normal' session dies, and not the save session too.

My little opinion,
Robert

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.