Ubuntu

[12.04] [ Precise] .xsession-errors getting spammed filling up the disk.

Reported by Manoj Iyer on 2012-05-17
88
This bug affects 18 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Medium
Unassigned

Bug Description

The problem really is that .xsession-errors file in the /home/<user> directory is allowed to grow to an unlimited size. On my system this file got filled with error messages from indicator-weather and filled up my entire disk.

manjo@lazy:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 44G 42G 353M 100% /
udev 7.8G 4.0K 7.8G 1% /dev
tmpfs 3.2G 1016K 3.2G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 7.8G 604K 7.8G 1% /run/shm
/dev/sda1 95M 118K 95M 1% /boot/efi
overflow 1.0M 92K 932K 9% /tmp
manjo@lazy:~$

Of which .xsession-errors.old file accounts for 31GB

-rw------- 1 manjo manjo 5.4K May 17 09:13 .xsession-errors
-rw------- 1 manjo manjo 31G May 16 21:03 .xsession-errors.old

You might be able to solve this problem if you delete the .xsessions-errors file once it grows to say 1GB or even better create it in /tmp so that it is removed on shutdown and does not eat up my full disk space. This bug renders the system useless, I cant even file a bug with ubuntu-bug, and it is very hard to find out what is eating up the disk space since .xsession-error.old is a hidden file any normal user will have no clue what just eat up his disk.

Manoj Iyer (manjo) on 2012-05-17
Changed in xorg (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Timo Aaltonen (tjaalton)
summary: - [12.04] .xsession-errors getting spammed filling up the disk.
+ [12.04] [ Precise] .xsession-errors getting spammed filling up the disk.
Bryce Harrington (bryce) wrote :

The Xsession script already includes functionality for truncating the log:

# truncate ERRFILE if it is too big to avoid disk usage DoS
if [ "`stat -c%s \"$ERRFILE\"`" -gt 500000 ]; then
  T=`mktemp -p "$HOME"`
  tail -c 500000 "$ERRFILE" > "$T" && mv -f "$T" "$ERRFILE" || rm -f "$T"
fi

However I believe this only runs at startup.

Manoj Iyer (manjo) wrote :

As you can see clearly something is not working, its creating the .xsession-errosr.old file which in my case blew into a 31G file. Why cant we create this .xsession-errors file in /tmp ?

Manoj Iyer (manjo) wrote :

Please consider this patch to /etc/X11/Xsession command.

The attachment "patch to create .xsession-error file in /tmp" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Timo Aaltonen (tjaalton) wrote :

What does moving the file to /tmp solve? For the default install /tmp is on the same fs as root, so it would just fill root instead of /home (unless they're both the same fs..)

The best way to solve this is to move the file to the per-user runtime dir, which we'll get for 12.10.

Timo Aaltonen (tjaalton) wrote :

nope, got denied

Timo Aaltonen (tjaalton) wrote :

gdm had code to limit the number of lines to the error file, so lightdm should probably do the same. It would also mean that lightdm would have it's own Xsession startup script, which doesn't redirect stdout/stderr to ~/.xsession-errors.

affects: xorg (Ubuntu) → lightdm (Ubuntu)
Changed in lightdm (Ubuntu):
assignee: Timo Aaltonen (tjaalton) → nobody
importance: Critical → Medium
status: New → Triaged
Olle Hassel (olle-ohassel) wrote :

I just had a 261 GB .xsession-errors file myself, was weather-indicator that filled it too.

Olle Hassel (olle-ohassel) wrote :

Addition: after checking my bacups I saw that it was 92 KB 7 days ago so it seems to be a recent update that made it grow out of control.

fachex (fachex) wrote :

OMG!! This bug almost cost me my job!!! I filled out our filled server with 430GB!!! then it crashed the VMware machine and it took me hours to recover it. People could not do anything, scann, save, nothing because the drive was full!! This is a horrible bug. Please somebody point me out to a solution.

fachex (fachex) wrote :

I am sorry for my typos on the comment above. I was rushing. This is a server machine, I cannot have a script that would work when shutting down or power on the system. We need to find a solution for this. Can I at least creat some kind of report that would email me when the files gets bigger than 10Mb? It does not even have to be that big...

Hugo Venhorst (yougo) wrote :

I'm affected too.

1) I'm using Libreoffice, then for whatever reason it turns grey and my disk is writing like nuts. i kill libreoffice, destroying my document. the disk writing stops.

2) i restart libreoffice writer, recover what's left of my document and save it for good measure

3) i get a i/o error, stating i can't save the file.

4) puzzled, i free up more disk space to 1 GB free, and save my file.

5) back to 1). again libreoffice freezes, and 1GB of diskspace eaten in seconds!

i check my home folder and indeed find two files:

.xsession-errors 992.7 MB
.xsession-errors.old 611.0 MB

.xsession-errors is filled with the following line over and over:

(soffice:2993): LIBDBUSMENU-GLIB-CRITICAL **: dbusmenu_menuitem_property_set_variant: assertion `DBUSMENU_IS_MENUITEM(mi)' failed

which tells me something doesnt sit well with dbus and menu items... lo-menubar?
anyways, such errors shouldn't be able to do fill up a disk in seconds!

Hugo Venhorst (yougo) wrote :

This is not a LightDM problem! it goes deeper.

Wyatt (wyattmcbain) wrote :

I'm having the same issue and recently did a full and clean install of 12.10. I still have yet to find a solution that fully works.

Miguel Negrao (miguel-negrao) wrote :

This is still happening in 13.04. For instance rhytmbox will fill .xsession-errors with junk. Isn't it possible to limit the size of the .xsession-errors ?

Lucio (lucio-martinez) wrote :

I faced this problem using Ubuntu 12.10 but there are users of Ubuntu 13.04 with the same problem. e.g. http://askubuntu.com/q/314710/62483

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

Duplicates of this bug

Other bug subscribers