Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Disabling .xsession-errors
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Sun Nov 11, 2012 10:39 am    Post subject: Disabling .xsession-errors Reply with quote

Hi!

I have problems with .xsession-errors (This is on KDE4). It gets really large at times! Firstly, it gets spammed by this line:

Code:
HistoryFile::add.seek: Virheellinen argumentti


until it is around 5GB large or so (actually, that's not too large according to what I've found by Google).

But it gets worse - if I leave a wine application running, at some point the file will be spammed with this line:

Code:
fixme:iphlpapi:NotifyAddrChange (Handle (nil), overlapped (nil)): stub


- in to the terabytes! (I've literally had my whole hard disk - 1.5TB - filled with this line several times now). Of course it will take hours to get to TB log file - nevertheless this behavior can (and has caused) data loss! In my case, I have a MythTV setup also on the same computer, and the recordings can't be made of course, if the hard disk is full.

I have no idea which program is causing the first line, I believe it might be nepomuk (although I have that peace of nice software disabled) or Clementine's Spotify plugin.

Via Google, I can find several users looking for a way to disable the file - but none of the workaround I've found apply for Gentoo, mainly because of different layout in /etx/X11 - I just don't know which file to edit and how! (most of the problems arise from the file being re-created at login). Has anyone disabled .xsession-errors, and if, how did you do it? Or does anyone know how to disable it - i.e. redirect the spam into /dev/null?.

Also, IMNSHO, I think the file should be disabled by default! I've used differen't Linux distributions for years, and didn't even know about the file until now. Now, that I look into the file - there's no way of telling, which line is caused by which program. Also, just googling it tells that the file is causing problems (the same problem I'm facing) but no solutions to any one!

Of course, one could find the program that is causing the spamming of the file, but that won't solve the underlaying problem. Also, in my case, the two lines above are the most common ones - even without them, the file would be in the hundreds of megabytes range just after a few hours of use.

Cheers!
_________________
- Ville
Back to top
View user's profile Send private message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Sun Nov 11, 2012 12:40 pm    Post subject: Re: Disabling .xsession-errors Reply with quote

About data loss: Actually, the situation with MythTV recordings was worse than I thought - MythTV has deleted all my recordings! 8O .

It has automatic deleting on (if hard disk is filled) of old recordings according to priority! I guess I have to adjust my MythTV settings, or set up quotas for the regular user(s), or something... for not allowing this to happen again.

Never though my whole hard disk (or /home partition) would get filled (at least not in this manner).
_________________
- Ville
Back to top
View user's profile Send private message
publiosulpicio
Apprentice
Apprentice


Joined: 31 Aug 2008
Posts: 150

PostPosted: Sun Nov 11, 2012 8:35 pm    Post subject: Reply with quote

You can try
Code:

chattr +i .xsession-errors

in this way nobody (even root) can write in the file. Note that you have to do this being root, even if the file belongs to your normal account.
Back to top
View user's profile Send private message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Sun Nov 11, 2012 8:47 pm    Post subject: Reply with quote

Hi,
publiosulpicio wrote:

Code:

chattr +i .xsession-errors



From what I've read on other forums, I believe that doing the above causes all the error messages being diverted into one of the files in /var/tmp instead - which is even worse, since /var/tmp is often tmpfs (as it is in my case). So, instead of hard disk, memory will get filled up 8O.

The behaviour is, I believe, if one of the possible error files (seems tha alternatives are: "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" - from /etc/X11/Sessions/Xsession or KDE-4) - is not writeable and re-creatable by root, one of the other is used, until a writeable one is found.

I will however, try your suggestion and report what happens. Thanks in any case!
_________________
- Ville
Back to top
View user's profile Send private message
publiosulpicio
Apprentice
Apprentice


Joined: 31 Aug 2008
Posts: 150

PostPosted: Sun Nov 11, 2012 8:53 pm    Post subject: Reply with quote

I see. What about
Code:

ln -sf /dev/null ~/.xsession-errors

?
Back to top
View user's profile Send private message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Sun Nov 11, 2012 9:09 pm    Post subject: Reply with quote

That one I already tried (wll, without the -f switch and first deleting .xsession-errors); the symlink will get deleted at the next login to X, and re-created...
_________________
- Ville
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3920
Location: Hamburg

PostPosted: Sun Nov 11, 2012 9:10 pm    Post subject: Reply with quote

something like
Code:
export WINEDEBUG=-all
might help a little bit ?
Back to top
View user's profile Send private message
publiosulpicio
Apprentice
Apprentice


Joined: 31 Aug 2008
Posts: 150

PostPosted: Sun Nov 11, 2012 9:12 pm    Post subject: Reply with quote

You can always create a script that delete the file every, say, 30 seconds, and make it run automatically at each login. Not very elegant, but I am pretty sure it will work.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3920
Location: Hamburg

PostPosted: Sun Nov 11, 2012 9:16 pm    Post subject: Reply with quote

publiosulpicio wrote:
You can always create a script that delete the file every, say, 30 seconds, and make it run automatically at each login. Not very elegant, but I am pretty sure it will work.
better :
Code:
cp /dev/null ~/.xsession-errors
within /etc/cron.hourly/ or so - or you could use logrotate for that job
Back to top
View user's profile Send private message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Sun Nov 11, 2012 9:29 pm    Post subject: Reply with quote

Chattr +1 causes the file size to stay at 0 (or whatever it is), but instead the errors will be directed to /tmp/xerr-[LOGIN]-:0 - which is bad indeed ! :cry:

toralf wrote:
something like
Code:
export WINEDEBUG=-all
might help a little bit ?


I moved .wine out of the way (well, it was about time since that one dated years back from another Gentoo computer, and had become quite convoluted I believe) and now I don't get the error anymore (at least for time being). But I will try to remember the WINEDEBUG trick.

As for deleting the file - it will disappear from the directory, sure, but it will still be using the disk space as long as any process has the file open. So the space won't be freed up unless one logs out (or, restarts X to be more specific) - and, in my case I even needed to kill nepomukserver (which I have disabled, why is it running?) and gam_server by hand, since the processes just wouldn't stop even if I stopped xdm (or kdm in my case) - if I had run out of disk space. The processes do stop if the log file had not had time to fill the entire hard disk.

I'm not sure how the writing of the .xsession-errors is handled, if every process opens it individually, I believe deleting it at login will prevent new processes from writing to it. But if there's some kind of log relaying (not sure what's the right word here) in use, and the writing process has already started, it won't work. I'm afraid the latter is the case - since, IIRC deleting it at login was already tried at some other discussion I found - but I will try it anyways. Also, there's no point - and no way - in deleting it repeatedly since it is only created once (at every login). It is not re-created during an X session.

Will be busy for the next day or two so I will get back to you later. Thanks anyways!
_________________
- Ville
Back to top
View user's profile Send private message
publiosulpicio
Apprentice
Apprentice


Joined: 31 Aug 2008
Posts: 150

PostPosted: Sun Nov 11, 2012 9:44 pm    Post subject: Reply with quote

Instead of a simple rm you can try
Code:

truncate --size=0 ~/.xsession-errors

this should free the disk space even if the file if open by some process.
Back to top
View user's profile Send private message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Sun Dec 02, 2012 12:03 pm    Post subject: Reply with quote

Cleaning .wine seems to make .xsession-errors behave, it does not grow to ridiculous sizes anymore (however, the file is still useless! I guess it is just a matter of time until some other application starts to misbehave...).

Thanks for the truncate tip, publiosulpicio. I will remember it if(or when) this problem re-surfaces again :D.
_________________
- Ville
Back to top
View user's profile Send private message
gmt
n00b
n00b


Joined: 15 Feb 2013
Posts: 11
Location: meatspace

PostPosted: Thu Jan 30, 2014 10:19 am    Post subject: an old, but timeless topic Reply with quote

Mine was filling up a 500GB volume.

Finally resorted to making it owned by root and chmod a-rw

I suppose nothing but a kernel-level hack could rescue root from this file.

I've tried all sorts of less aggressive approaches but it always came back like a bad penny. But a really, really big one...
_________________
-gmt
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3920
Location: Hamburg

PostPosted: Thu Jan 30, 2014 4:26 pm    Post subject: Re: an old, but timeless topic Reply with quote

gmt wrote:
Finally resorted to making it owned by root and chmod a-rw
What's about
Code:
ln -s ~/.xsession-errors /dev/null
?
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2551
Location: Here and Away Again

PostPosted: Thu Jan 30, 2014 9:32 pm    Post subject: ><)))°€ Reply with quote

What exactly is filling up the file is what should be most interesting, methinks.

With regards to Wine, it certainly can produce a lot of fixme-messages, but those normally go to stderr, so it looks like something must be redirecting it to ~/.xsession-errors, I think. The 'fix' for that in particular can indeed be something like what mentioned above (making use of the WINEDEBUG environment variable).

I often wondered why I never had this particular file myself, and as I was looking into this now, I discerned that it's probably because I do not run any display/log-in mangers, such as gnome-base/gdm, which I think might be a plausible culprit here (see for example: Comment 45 for bug 60448 bugs.launchpad.net, originally reported in 2006).

Beyond that, it's up to the particular application, I maybe guess.
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Jan 30, 2014 11:48 pm    Post subject: Reply with quote

This is a problem that come from the use of a display manager to open an X session. The $HOME/.xsession-errors is the file used by the user applications to 'throw' their log messages. My little contribution is that
Code:
echo "" > $HOME/.xsession-errors

will empty the file. There is an xorg.conf option
Code:
Option "Log" "string"
              This option controls whether the log is flushed and/or synced to disk after each message.  Possible values are flush or sync.  Unset by default.

Is this option apply only to Xorg itself and not to Xorg clients? This is what I think, but you can allow it a try.
Code:
Section "ServerFlags"
...
Option "Log "flush"
...
EndSection

There are several ways to control the size of that file. One is to create a file system with a fixed size in $HOME/.xsession-errors and mount it.

My last idea is to propose to open a user session in a virtual character terminal and use startx to open an X session. All logs go to the virtual character terminal.
_________________
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum