Bug 70076 - freopen/fseek/fgets problem in mutt for checking new mail
freopen/fseek/fgets problem in mutt for checking new mail
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks: 67217
  Show dependency treegraph
 
Reported: 2002-07-29 21:30 EDT by Olivier Baudron
Modified: 2016-11-24 10:08 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Olivier Baudron 2002-07-29 21:30:30 EDT
When mutt checks for new mail, it sometimes fails with error message:
"Mailbox was externally modified.  Flags may be wrong."
This happens about 10% of the times, but is deterministic for a given mailbox.
My config is quite simple: sendmail puts mail in /var/spool/mail/$USER (a mbox
mailbox) and mutt deals with this unique mailbox.

Downgrading to glibc-2.2.5-37 fixes the bug, which is present with
glibc-2.2.90-14 and -15 (I could not test any intermediate version).

In mutt-1.4i the problem occurs at:
mbox.c:
           /*
            * 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, fseek works, but fgets fails with errno==2 (no such
file or directory). Also note, that there is freopen calls on this file. So in
fact, this is very similar to bug 67552 which caused another problem in mutt.

I could not extract a testcase to reproduce this bug outside mutt, so please ssh
on my rawhide box:

$ ssh -l rhguest baud.truffe.org
password: rhguest
$ cp foomail /var/spool/mail/rhguest
$ mutt
compose a new message to rhguest@localhost
send the message
10 sec later, mutt checks for new mail and ...error!
Comment 1 Olivier Baudron 2002-07-30 13:14:08 EDT
Bug still present in glibc-2.2.90-17 (limbo release).
Comment 2 Olivier Baudron 2002-08-15 09:50:03 EDT
Fixed in -21.

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