Race condition in mailto-mutt
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mutt (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mutt
How to reproduce: Either setup /usr/lib/
Result: Most of the time (more than 90%) a window pops up and disappears immediately. When running it in Bash/GNOME Terminal it returns exit code zero and no error message.
Cause: It looks like there's a race condition: x-terminal-emulator forks a GNOME Terminal so the `rm -f $TMPFILE` command two lines down gets executed before mutt has a chance to read it. As such, it will exit immediately.
Workaround: Add a line with `sleep 1` above the `rm -f $TMPFILE` line.
Suggestions:
1. Make sure the `rm` command is only run after mutt has actually finished (or at least has had time to read it. I don't know whether mutt clears up temp files passed with -i by default).
2. Try to retrieve the exit code of mutt itself for the `exit` statement. I guess this would necessitate a change in gnome-terminal, to return the exit code of the commend executed with -e.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: mutt 1.5.20-9ubuntu2 [modified: usr/lib/
ProcVersionSign
Uname: Linux 2.6.35-28-generic x86_64
NonfreeKernelMo
Architecture: amd64
Date: Mon Jun 20 09:52:38 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64+mac (20101008)
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: mutt
Turns out this is caused by bug #666418 - "gnome- terminal. wrapper doesn't wait until program finishes".