[27140] in Athena Bugs
sun4 9.3.18: mhstore
daemon@ATHENA.MIT.EDU (Eric Mumpower)
Fri Nov  9 11:49:41 2007
Message-Id: <200711091648.lA9GmMlV020118@dragons-lair.mit.edu>
To: bugs@mit.edu
Date: Fri, 09 Nov 2007 11:48:22 -0500
From: Eric Mumpower <nocturne@mit.edu>
X-Spam-Score: 0.00
X-Spam-Flag: NO
Errors-To: bugs-bounces@mit.edu
System name:		dragons-lair.mit.edu
Type and version:	Sun-Blade-100 9.3.18 (with mkserv)
Display type:		unknown
Shell:			/bin/athena/tcsh
Window manager:		/mit/windowmanagers/sun4bin/ctwm
What were you trying to do?
Use mhstore to extract a large number of MIME attachments from emails
stored in MH. In particular, I have five messages containing a total
of 70 MIME parts, and ran:
> athena% mhstore 1333-1337
> storing message 1333 part 1 as file 1333.1.txt
> storing message 1333 part 2 as file 1333.2.jpeg
> storing message 1333 part 3 as file 1333.3.jpeg
[...
  lots of normal output
 ...]
> storing message 1337 part 8 as file 1337.8.jpeg
> mhstore: unable to open for reading 1337: Too many open files
>          (content image/jpeg in message 1337, part 9)
> mhstore: unable to fopen for reading/writing
> /afs/sipb.mit.edu/user/nocturne/www-lib/r/f/1337.10.jpeg: Too many
> open files
>          (content image/jpeg in message 1337, part 10)
> mhstore: unable to fopen for reading/writing
> /afs/sipb.mit.edu/user/nocturne/www-lib/r/f/1337.11.jpeg: Too many
> open files
>          (content image/jpeg in message 1337, part 11)
> mhstore: unable to fopen for reading/writing
> /afs/sipb.mit.edu/user/nocturne/www-lib/r/f/1337.12.jpeg: Too many
> open files
>          (content image/jpeg in message 1337, part 12)
In tcsh on Solaris, you can trigger this bug in a situation with fewer
attachments simply by issuing the command "limit descriptors 6" and
running mhstore on a message containing at least 3 MIME parts. The
first few will be correctly stored, and the rest will fail.
What's wrong:
It runs out of file descriptors.
What should have happened:
mhstore should recycle its file descriptors, rather than requiring a
number of file descriptors proportional to the total number of
attachments being stored.
Please describe any relevant documentation references:
	[Please replace this line with your information.]