Skype on Linux: Startup Crash Fix

I’ve been using Skype recently and it kept crashing randomly a few seconds after startup. I managed to salvage the error message, which states as follows:

skype: pcm.c:2811: snd_pcm_areas_copy: Assertion `src_areas' failed.

Apparently, I’m not the first to notice this problem. I learned from that link that Microsoft is in no hurry to fix this longstanding, horrible bug that is a simple 1-liner fix. The fix is as follows:

mkdir ~/.Skype/Logs

Shame on the current Skype developers.

Update May 31, 2012: Apparently, Skype automatically creates huge logfiles in the ~/.Skype/Logs directory, and there is no way to turn off this useless feature (the logfiles are written in a proprietary Skype-only format, and is only designed to help Skype fix bugs if anything goes wrong; no personal data (chat history, etc.) is written in those logs according to online sources). I was bitten by this problem earlier this evening when I realized that my home partition (a meager 9GB) filled up with a 2GB Skype logfile, which prevented me from downloading a file online. The solution is simple: make the logfile a symlink into /dev/null — this way, you don’t have to periodically delete the logfiles — they are automatically “deleted” as they are being written! I knew I could take advantage of /dev/null someday and this is the perfect time for it! EDIT June 1, 2012: Actually, Skype did crash once mysteriously because of this, so just make a symlink to some partition with more space available, and then run a script upon boot up/power off to delete all files in that directory. Sorry about the bad advice!

There you go — happy Skyping!

Update June 3, 2012: OK, so apparently there is a way to create a “blackhole” directory, much in the same spirit of the special /dev/null file. This stackexchange page addresses the same concern, and led me to nullfs, which is a FUSE program that allows you to mount /dev/null-like filesystems from userspace (as regular programs, without root privileges). The code for these programs are just a few hundred lines long and compile very quickly. There are three flavors (nul1fs, nullfs, and nulnfs) and I’ve tested out nullfs to great success. You can create a “blackhole” like directory where files can be created into, but which does not take up any disk space. I just ran Skype again right now and the output of “lsof | grep skype” looks very normal (the log files in ~/.Skype/Logs are indeed created in Logs). So here’s how to do it: compile nullfs with

g++ -o nullfs -lfuse nullfs

and then create a regular directory anywhere with

mkdir blackhole

and then mount the nullfs filesystem on that directory with

path-to-nullfs-binary path-to-blackhole-directory 

and you’re good to go. For our use case, the blackhole directory would just be ~/.Skype/Logs. The nullfs binary backgrounds itself so you don’t need to worry about backgrounding/disowning the process. You can put the one-liner nullfs invocation into your startup script of choice, and you’re all set! I haven’t tried out the nul1fs or nulnfs flavors, because I didn’t need to. Hooray for FUSE!


6 thoughts on “Skype on Linux: Startup Crash Fix

  1. Ah 2012, when every vendor assumes you have a spare 2GB lying around for them…

    I like the /dev/null solution; very simple and elegant. Doesn’t this make ~/.Skype/Logs look like a file, rather than a directory, to the application though? It doesn’t mind?

  2. Yes, it doesn’t mind at all (although I see your concerns about file vs. directory). Maybe /dev/null is a very special file and Linux tells Skype that it’s also a directory — I am not sure.

    You are right, it does crash in the same manner (random crash upon startup). I’ve updated the post to reflect this.

  3. @gcbenison: I’ve fixed the problem about using /dev/null by making use of the very, very cool nullfs FUSE program. See the updated post for details.

  4. Today I was also wondering what was eating my hard drive space. I have now 30 GB of those logfiles from Skype. 30GB!!!!! Shit, what the hell is Skype storing there? Once you know the problem is easy to solve it, but I wonder why this is happening in the first place. Stupid Skype…

Comments are closed.