Pidgin randomly crashes

Bug #298820 reported by Lukáš Chmela
40
This bug affects 5 people
Affects Status Importance Assigned to Milestone
gst-plugins-good
Fix Released
Medium
gst-plugins-good0.10 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

After a new Intrepid installation, containing the new Pidgin, the Pidgin sometimes randomly crashes - usually after a long time.
I started it manually from terminal, using the `pidgin` command and after whole day, when Pidgin crashed again, I got this output in terminal:

E: client-conf-x11.c: XOpenDisplay() failed
E: authkey.c: Failed to open cookie file '/home/desktop/.pulse-cookie': Too many open files
E: authkey.c: Failed to load authorization key '/home/desktop/.pulse-cookie': Too many open files
E: shm.c: shm_open() failed: Too many open files
E: shm.c: shm_open() failed: Too many open files
W: context.c: No cookie loaded. Attempting to connect without.
E: client-conf-x11.c: XOpenDisplay() failed
W: core-util.c: Failed to open configuration file '/home/desktop/.pulse/client.conf': Too many open files
W: client-conf.c: Failed to open configuration file '/etc/pulse/client.conf': Too many open files
W: shm.c: Failed to read /dev/shm/: Too many open files
*** glibc detected *** pidgin: free(): invalid pointer: 0x0000000009c07990 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f36a2584938]
/lib/libc.so.6(cfree+0x76)[0x7f36a2586f86]
/usr/lib/libglib-2.0.so.0(g_string_free+0x4a)[0x7f36a2e0f5fa]
/usr/lib/pidgin/nautilus.so[0x7f369c74a827]
/usr/lib/libpurple.so.0(purple_marshal_VOID__POINTER+0x7c)[0x7f36a2b2119e]
/usr/lib/libpurple.so.0(purple_signal_emit_vargs+0x166)[0x7f36a2b20b87]
/usr/lib/libpurple.so.0(purple_signal_emit+0x12e)[0x7f36a2b20a1f]
/usr/lib/libpurple.so.0(purple_blist_update_buddy_status+0x15a)[0x7f36a2adbf0d]
/usr/lib/libpurple.so.0(purple_prpl_got_user_status+0x23f)[0x7f36a2b170ad]
/usr/lib/purple-2/liboscar.so.0[0x7f36922f61de]
/usr/lib/purple-2/liboscar.so.0[0x7f36922d8f34]
/usr/lib/purple-2/liboscar.so.0[0x7f36922d903e]
/usr/lib/purple-2/liboscar.so.0[0x7f36922ece27]
/usr/lib/purple-2/liboscar.so.0[0x7f36922ed08a]
/usr/lib/purple-2/liboscar.so.0(flap_connection_recv_cb+0x2d8)[0x7f36922ed382]
pidgin[0x46ded1]
/usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x23b)[0x7f36a2debd3b]
/usr/lib/libglib-2.0.so.0[0x7f36a2def50d]
/usr/lib/libglib-2.0.so.0(g_main_loop_run+0x1cd)[0x7f36a2defa3d]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xa7)[0x7f36a3f957a7]
pidgin(main+0xb71)[0x48a9f5]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f36a2529466]
pidgin[0x4306a9]
======= Memory map: ========
Aborted

description: updated
Revision history for this message
James (jbertelson) wrote :

It looks like the cause is that it's running into your user limit of (by default) 1024 files open at a time. It's possible that another application you're running is leaving file handles open, or legitimately using a lot (torrent clients are notorious for this.) You can increase this limit by adding the following lines in /etc/security/limits.conf:

* hard nofile 4096
* soft nofile 4096

You'll need to reboot for the change to take effect. There's a brainstorm open to increase this setting by default, however, this can cause performance issues on slower machines: http://brainstorm.ubuntu.com/idea/15276/

Revision history for this message
Lukáš Chmela (lukaschmela) wrote :

James, thanks for your reply.

However, everything, I usually run under my user is nautilus, firefox (with about 35 tabs), totem with some music and pidgin of course, without any torrent downloader etc. I also use compiz.

I'll try what you said and I will post results here, but, if it's so, shouldn't the limit be greater by default?

Revision history for this message
Rockwalrus (rockwalrus) wrote :

I periodically experience this bug, and can verify using ls /proc/`pidof pidgin`/fd that there are about 1000 files opened by pidgin at the time it crashes.

Revision history for this message
Rockwalrus (rockwalrus) wrote :

I attached the output from ls -l /proc/`pidof pidgin`/fd.

Revision history for this message
Winckler (winckler) wrote :

I'm also experiencing this bug. The most important thing to notice is that my "applications pattern" is the same, and I had never experienced this bug before.

Is there anything I could do to help trace this bug?

Revision history for this message
Winckler (winckler) wrote :

I think I found the root of this bug (at least for me).

It's related to sound. I noticed that the increase number of the FD happens when the sound is not working. The pipes listed in lsof are to the sound system.

I think it's related to flash-plugin (always the closed source!).

I'll take a deeper look.

Revision history for this message
Lukáš Chmela (lukaschmela) wrote :

I can confirm, that, as Rockwalrus said, I have exactly 1024 opened file descriptors in the "/proc/.../fd/" folder, by pidgin process ~2 minutes before it crashes and from the same time it stops playing sounds (for incomming/outcomming messages etc.) and after clicking on the pidgin icon in notification area by right mouse button, there are no icons in the menu. Then, after I choose "Exit" in the menu, I can hear the sound like when a message comes and then pidgin terminates.

Revision history for this message
bass (ciphered) wrote :

I know this bug hasn't been posted to in over a month, but I think I have this problem going on with pidgin 2.5.2 and Ubuntu Intrepid 32-bit. I've been running pidgin with the debug flag and this is the last line that came up before it just randomly disappeared:

Beginning at 01:35:29, errors such as these began to fill the log:

(01:35:29) util: Error opening file /home/bass/.purple/blist.xml.save for writing: Too many open files
...
(01:57:11) nautilus: couldn't save '/home/bass/.gnome2/nautilus-sendto/pidgin_buddies_online': Failed to create file '/home/bass/.gnome2/nautilus-sendto/pidgin_buddies_online.HZPHNU': Too many open files

The log also filled with errors such as this at 3 second intervals::

(01:32:25) nautilus: Can't open the spool dir
....
(01:57:09) nautilus: Can't open the spool dir

There are no occurrences of these errors before the given times.

After reading the above posts, I investigated the proc folder for pidgins pid and watched the list of open files. It seems that when sending and receiving messages, the number of open files just goes up, and never back down again. I disabled sounds, and repeated the testing... and the number of open files while sending and receiving messages remained constant. Just to be sure, I re-enabled the sound, and the number of files again begins to climb. Now for the interesting part... I tried other Sound options in the settings. First I tried ESD, which did not play any sounds and caused the open files to stop accumulating much as it did with disabled sound. Then I tried ALSA... sound worked as normal, and the number of open files did not climb. Back on Automatic... again the open files begin to increase again.

Setting the sound mode to ALSA may be a temporary work around for this problem, but there is definitely something wrong going on here that needs attention. I will continue running Pidgin with debug flag and with ALSA set for my sound to see if I get anymore crashes. I suggest some other people do the same and see if it helps.

Revision history for this message
Lukáš Chmela (lukaschmela) wrote :

Thanks bass, setting it to ALSA really solved the problem.

However, I have more problems with sound in Intrepid.
In DOOM3 and Hydrogen, I had to manually set to OSS sound driver, becouse the automatic choice (ALSA) had rattly sound in both applications.

This never happened in Hardy or any even older distribution, I have ever used.
So I think, there is really something wrong with a sound driver in Intrepid.

Magnus S (magnuss)
Changed in pidgin:
status: New → Confirmed
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Hi,

Could someone experiencing this bug please open it on the upstream Pidgin bug tracker (http://developer.pidgin.im/), and then paste the link here.

Thanks

Changed in pidgin:
status: Confirmed → Incomplete
importance: Undecided → Low
Revision history for this message
bass (ciphered) wrote :

Here's the pidgin bug ticket:
http://developer.pidgin.im/ticket/7743

See the post here dated 1/29/2009:
http://bugzilla.gnome.org/show_bug.cgi?id=537540

I suppose that Ubuntu should consider pulling the fixed pulseaudio into Intrepid to fix pidgin and anything else that might have been affected by it?

Revision history for this message
Lukáš Chmela (lukaschmela) wrote :

Hm, after reading that I totally agree.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Is that issue related to this bug? This bug reports a crash because Pidgin runs out of file descriptors. That upstream bug is about clients freezing up when the audio stream is terminated

Revision history for this message
bass (ciphered) wrote :

Well, the reason pidgin is running out of file descriptors is because pipes to play sound files not being released after the sounds are played, so they end up accumulating until the limit is hit. Supposedly according to the guys on the pidgin bug forum, this problem is not of pidgin itself but of pulseaudio gstreamer... a problem which is supposedly fixed as of a more recent version. Only one way to find out I guess, someone needs to patch it and test this.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Ok then, I'll reassign this to gst-plugins-good0.10. Could someone try running the version of gst-plugins-good from GIT and seeing if it fixes the issue experienced here?

Thanks

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

could you try on jaunty?

Changed in gst-plugins-good:
status: Unknown → Fix Released
Revision history for this message
bass (ciphered) wrote :

This is probably easier to test in Jaunty because it uses gstreamer 0.10.22 which is required by the git version of gst-plugins-good. I have Intrepid w/ gstreamer 0.10.21 and the gst-plugins-good from the git repository won't compile b/c of that.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Thanks in advance.

Revision history for this message
Lukáš Chmela (lukaschmela) wrote :

No, I can confirm that the bug is now solved for me. Thanks

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Thanks for your quick reply. Closing the bug then.

Changed in gst-plugins-good0.10 (Ubuntu):
status: Incomplete → Fix Released
Changed in gst-plugins-good:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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