Intermittently, launching emacs in background exits bash

Bug #185366 reported by J. Scott Berg
4
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Expired
Undecided
Unassigned
emacs22 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Very rarely (once a month or so), I will launch emacs with "emacs filename &", and not only will emacs not appear, gnome-terminal will close as well, presumably because bash exited. Normally it works fine, it is just on rare occasions that this happens. Since I've never seen another report of this behavior, I'm assuming that it must somehow be related to my bash settings; the only relevant deviation from the Ubuntu stock .bashrc is:

unset HISTFILE
bld=`/usr/bin/tput bold`
sgr=`/usr/bin/tput sgr0`
tty=`/usr/bin/tty | /bin/sed s%/dev/%%`
export PS1='\['$bld'\](\!) '$tty' [\j jobs] [rc=$?] \u@\h \d \@\['$sgr'\]\n\['$bld'\]\w\['$sgr'\]\n\['$bld'\]\$\['$sgr'\] '
unset bld sgr tty
set -b

I've never seen this happen with another program, so it seems to be some bizarre interaction between emacs and bash. I'm running Gutsy, but this is a long-standing bug, I've even seen it outside of Ubuntu (always the combination gnome-terminal/bash/emacs).

Revision history for this message
era (era) wrote : Re: [Bug 185366] Intermittently, launching emacs in background exits bash

On Wed, 23 Jan 2008 15:10:58 -0000, "J. Scott Berg" <email address hidden>
said:
> Very rarely (once a month or so), I will launch emacs with "emacs
> filename &", and not only will emacs not appear, gnome-terminal will
> close as well, presumably because bash exited.

Do you see anything in your .xsession-errors when this happens?

/* era */

--
If this were a real .signature, it would suck less. Well, maybe not.

Revision history for this message
J. Scott Berg (jsberg) wrote :

Good question, I don't know (unfortunately the .xsession-errors from the session where it died is gone). It never occurred to me to check since I've always assumed it was some tricky job control race in bash. I will check next time and post here.

Revision history for this message
era (era) wrote :

Marking as "incomplete" while waiting for word on the .xsession-errors issue.

Changed in bash:
status: New → Incomplete
Changed in emacs22:
status: New → Incomplete
Revision history for this message
J. Scott Berg (jsberg) wrote :

Nothing in .xsession-errors or Xorg.0.log

Changed in bash:
status: Incomplete → New
Changed in emacs22:
status: Incomplete → New
Revision history for this message
era (era) wrote :

Perhaps you could create a wrapper /home/you/bin/emacs to add some debugging information. Here's a quick stab at something ...

#!/bin/sh -vx
# doubtful whether the -vx adds more noise than useful information
# FIXME: insecure temp files
exec /usr/bin/emacs "$@" >/tmp/emacs.$$.out 2>/tmp/emacs.$$.err

Revision history for this message
Mika Fischer (zoop) wrote :

Scott,

did you get a chance to try era's suggestion? It could really help us figure out what's going on since nobody seems to be able to reproduce this bug.

Regards,
 Mika

Changed in bash:
status: New → Incomplete
Revision history for this message
J. Scott Berg (jsberg) wrote :

I tried what I thought would be a variation on it, which was to set gnome-terminal not to close when the shell exits. I didn't see anything for a while, then just a couple days ago I had a shell just go dead on me, as if I had exited it. I believe I backgrounded something just before that, but I'm not sure. No message in the terminal, nothing in .xsession-errors or Xorg.0.log. There was an emacs and another GUI program (grace) running in the background. I'm not sure if they were still running. I figured I just typed control-D accidentally, so I just closed the gnome-terminal window. As soon as I did that, both of the children (emacs and grace) died with it (If I had expected this I would have checked the other windows out first...)! So I'm guessing that this was the same phenomenon, and it's looking shell related. Maybe the "set -b"? I associated it with emacs probably because 90% of the times I background something it is emacs.

Revision history for this message
Phillip Susi (psusi) wrote :

Since you said it doesn't seem to be an emacs issue, I'm closing that task.

Changed in emacs22 (Ubuntu):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for bash (Ubuntu) because there has been no activity for 60 days.]

Changed in bash (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.