GLib-ERROR **: Cannot create pipe main loop wake-up: Too many open files

Bug #808752 reported by Dave Walker on 2011-07-11
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
thunderbird (Ubuntu)
Medium
Unassigned

Bug Description

Since the weekend, thunderbird has become very unstable. Crashing within a minute of every startup.

$ thunderbird
enigmail.js: Registered components

(thunderbird-bin:4807): Gtk-WARNING **: Error loading theme icon 'dialog-warning' for stock: Error opening file: Too many open files

(thunderbird-bin:4807): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

** (thunderbird-bin:4807): CRITICAL **: murrine_style_draw_render_icon: assertion `base_pixbuf != NULL' failed

(thunderbird-bin:4807): Gtk-CRITICAL **: IA__gtk_style_render_icon: assertion `pixbuf != NULL' failed

(thunderbird-bin:4807): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

GLib-ERROR **: Cannot create pipe main loop wake-up: Too many open files
Trace/breakpoint trap (core dumped)

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: thunderbird 5.0+build1+nobinonly-0ubuntu5
ProcVersionSignature: Ubuntu 3.0-3.4-generic 3.0.0-rc5
Uname: Linux 3.0-3-generic x86_64
NonfreeKernelModules: wl
Architecture: amd64
Date: Mon Jul 11 13:12:18 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64+mac (20101218)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: thunderbird
UpgradeStatus: No upgrade log present (probably fresh install)

Dave Walker (davewalker) wrote :
Dave Walker (davewalker) wrote :

dave@voodoo:~$ thunderbird
enigmail.js: Registered components
shm_open() failed: Too many open files
shm_open() failed: Too many open files
shm_open() failed: Too many open files
shm_open() failed: Too many open files
shm_open() failed: Too many open files
shm_open() failed: Too many open files

GLib-ERROR **: Cannot create pipe main loop wake-up: Too many open files
Trace/breakpoint trap (core dumped)

Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

Could you please attach the output of:
$ ulimit -n

Start thunderbird and run the following command:
$ lsof -p $(pgrep thunderbird) > /tmp/lsof-p_thunderbird.out
and attach the file /tmp/lsof-p_thunderbird.out

And describe your thunderbird setup.

Thanks in advance.

Changed in thunderbird (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
Dave Walker (davewalker) wrote :

$ ulimit -n
1024

$ wc -l /tmp/lsof-p_thunderbird.out
1201 /tmp/lsof-p_thunderbird.out

(apologies, I cannot attach the file as it leaks too much personal information - which would be a pain to redact)

Changed in thunderbird (Ubuntu):
status: Incomplete → New
Dave Walker (davewalker) wrote :

Description of mail setup:
2 x IMAP servers

A - has many cascading IMAP folders with a total volume of >10GB

B - a few IMAP folders, and a large top level INBOX with ~15000 emails.

Jean-Baptiste Lallement (jibel) wrote :

I let thunderbird run for some time, monitoring the number of open files, and it doesn't seem to leak file descriptors. But it opens 1fd per imap directory accessed, then release it after some time.

Just a supposition, if you have many imap folders with mail filters, thunderbird can quickly reach the limit of 1024 open files.
For example, locally if I only count files which are not mail folders, there are already 280 descriptors used, that leaves only ~740 free descriptors for mail directories. Is 'many cascading IMAP folders' of that order ?

Could you increase the hard limit of open files and see if it improves the situation ?

You can change the max number of open files by adding the following lines to /etc/security/limits.conf
@your_username hard nofile 4096
@your_username soft nofile 4096

and logout/in

Changed in thunderbird (Ubuntu):
status: New → Incomplete
Dave Walker (davewalker) wrote :

I can confirm that raising the ulimit for my user does stop thunderbird crashing.

However, this seems to be a very poor work around for an issue that did not seem to exist on 5.0+build1+nobinonly-0ubuntu3 and prior.

Thunderbird is now chewing an entire CPU core constantly.

Thanks.

Changed in thunderbird (Ubuntu):
status: Incomplete → Confirmed
Dave Walker (davewalker) wrote :

(Hmm, not quite constantly - but significantly.)

Chelmite (steve-kelem) wrote :

I tried #6, upping the hard & soft files to 4096, rebooted and then looked at the lsof | wc -l output every 5 seconds. Some of the numbers are much larger than 4096!

26660
26660
30890
5428
4783
5421
5421
5244
5244
5067

but...it's working again!

Vseerror (vseerror) wrote :

Dave,
1. You wrote "A - has many cascading IMAP folders with a total volume of >10GB". Roughly how many folders, and do what depth?
2. Have you determined what cause the high open file usage?
3. Does it still happen when using a current version of Thunderbird?

Chelmite (steve-kelem) wrote :

Every so often, thunderbird asks to compact my folders. Is it keeping them open after compacting? It shouldn't.

Chelmite (steve-kelem) wrote :

I'm still getting truncated messages when they are moved to folders by my message filters.
security/limits.conf contains:
@skelem hard nofile 16384
@skelem soft nofile 16384

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

Other bug subscribers