Bug 70076 - freopen/fseek/fgets problem in mutt for checking new mail
Summary: freopen/fseek/fgets problem in mutt for checking new mail
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc (Show other bugs)
(Show other bugs)
Version: 1.0
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
Blocks: 67217
TreeView+ depends on / blocked
Reported: 2002-07-30 01:30 UTC by Olivier Baudron
Modified: 2016-11-24 15:08 UTC (History)
1 user (show)

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

Attachments (Terms of Use)

Description Olivier Baudron 2002-07-30 01:30:30 UTC
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:
            * 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 17:14:08 UTC
Bug still present in glibc-2.2.90-17 (limbo release).

Comment 2 Olivier Baudron 2002-08-15 13:50:03 UTC
Fixed in -21.

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