Bug 67552 - Writes to mutt mailboxes are failing
Writes to mutt mailboxes are failing
Product: Red Hat Public Beta
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
: 68272 68915 (view as bug list)
Depends On:
Blocks: 67217
  Show dependency treegraph
Reported: 2002-06-27 07:54 EDT by Jay Turner
Modified: 2016-11-24 07:26 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-07-15 18:01:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jay Turner 2002-06-27 07:54:16 EDT
Description of Problem:
With the Milan-re0626.0 tree, I'm getting the message "Write failed! Saved
partial mailbox to <path>" when attempting to purge a mailbox.  Have actually
had this happen on two different machines, but not really sure that it's a mutt
issue at all, but figured that I would log it here.

Version-Release number of selected component (if applicable):

How Reproducible:

Steps to Reproduce:
1. start up mutt
2. Save a message from one folder to another
3. Hit <shift><4> to sync the mailbox

Actual Results:

Expected Results:

Additional Information:
Comment 1 Bill Nottingham 2002-06-28 16:06:40 EDT
NFS? Local files?
Comment 2 Jay Turner 2002-07-01 13:09:02 EDT
No, these are local files that I'm seeing this behavior on.  Have a machine here
at the desk if you would like to poke at it.
Comment 3 David Sainty 2002-07-04 19:45:56 EDT
Take a look at:


(page linked from http://bugs.guug.de/db/pa/lmutt.html)
Comment 4 Jay Turner 2002-07-08 11:40:06 EDT
Making this a public bug so that people can comment on it.
Comment 5 Bill Nottingham 2002-07-08 14:29:20 EDT
Jakub, this seems related to the glibc version in use?
Comment 6 W. Michael Petullo 2002-07-09 03:59:30 EDT
Right before this bug went public, I submitted it as bug number 68272.  Here is 
what I had to say:

The problem seems to be in the file mbox.c.  Around line mbox.c:908, several
checks are made to ensure the mailbox is sane:

if (fseek (ctx->fp, offset, SEEK_SET) != 0 ||  /* seek the append location 
      /* do a sanity check to make sure the mailbox looks ok */
      fgets (buf, sizeof (buf), ctx->fp) == NULL ||
      (ctx->magic == M_MBOX && mutt_strncmp ("From ", buf, 5) != 0) ||
      (ctx->magic == M_MMDF && mutt_strcmp (MMDF_SEP, buf) != 0) ||
      (ctx->magic == M_KENDRA && mutt_strcmp (KENDRA_SEP, buf) != 0))

The fgets in this check fails on my system.  If I stick a perror in the code
following the fgets, it prints "No such file or directory."  Because this check
fails, i is set to -1, causing the error message to be printed around line

This "No such file or directory" error from fgets is strange.  None of the other
operations on ctx->fp fail, including the open operations.  Could there be a bug
in glibc?  Probably not.

I am having more trouble finding the source of this problem than I expected.  I
will update this bug report as I discover more.

And later:

I still have these problems if I downgrade the mutt rpm on my system from the
limbo version (which has never worked) to the 7.3 version (which used to work
with 7.3).  This seems to support my theory that the problem is in a library
(glibc?), not mutt.
Comment 7 Jakub Jelinek 2002-07-09 07:00:08 EDT
This looks like glibc mmap stdio problem, debugging...
Comment 8 Jakub Jelinek 2002-07-09 07:44:39 EDT
Oh yes, freopen ("...", "r+", f) on stdio mmap f is not doing the right thing,
will have a patch soonish.
Comment 10 Bill Nottingham 2002-07-09 15:35:16 EDT
*** Bug 68272 has been marked as a duplicate of this bug. ***
Comment 11 Bill Nottingham 2002-07-15 18:01:18 EDT
*** Bug 68915 has been marked as a duplicate of this bug. ***
Comment 12 Jakub Jelinek 2002-07-24 12:49:39 EDT
Fixed in glibc-2.2.90-15.
Comment 13 Jay Turner 2002-07-24 16:16:01 EDT
Fix confirmed with Milan-re0724.nightly tree.
Comment 14 Olivier Baudron 2002-07-29 16:59:14 EDT
I have a similar problem with mutt and glibc-2.2.90-15 did not fix it.
Basically, when mutt checks for new mail, it sometimes fails and prints "Mailbox
was externally modified.  Flags may be wrong.". It happens about 10% of the time
(but the problem is deterministic).

In mutt-1.4i the problem occurs at:
	   * check to see if the content-length looks valid.  we expect to
	   * to see a valid message separator at this point in the stream
	  if (fseek (ctx->fp, tmploc, SEEK_SET) != 0 ||
	      fgets (buf, sizeof (buf), ctx->fp) == NULL ||
	      mutt_strncmp ("From ", buf, 5) != 0)

In this boolean expression, fseeks works, but fgets fails with errno==2 (no such
file or directory), which makes me thinks there is still a bug in glibc.

I have tried several versions of mutt, and all of them reproduces the bug.
Comment 15 Olivier Baudron 2002-07-29 17:52:59 EDT
The problem is indeed fixed with glibc-2.2.5-37.
Should I open a new bug report?
Comment 16 Jay Turner 2002-07-29 20:49:11 EDT
If you are seeing behavior different than described above, then yes, please open
a separate bug and post details there.
Comment 17 Olivier Baudron 2002-07-29 21:32:27 EDT
Ok. So, see bug 70076 for this new problem.

Note You need to log in before you can comment on or make changes to this bug.