Sometimes tty is in weird state after mpg123 exits

Bug #1667506 reported by Thorsten Glaser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mksh
Triaged
Low
Unassigned

Bug Description

Sometimes, when I exit mpg123 (by pressing ^C to send SIGINT to it, which is the normal way to do so…) the prompt is in such state as pressing Cur↑ shows ^[[A, which can be fixed by then pressing ^U (invisible) and Enter, so that the cleanup that happens on every Enter fixes it. (I could also blindly type another command or use it from history. It also works, but this is annoying.)

I have absolutely no idea where that comes from, or how to debug it. I suspect mpg123 lives for a bit longer after the ^C and messes up tty state after the shell tried to restore it. Or, there is a race condition in the shell making it not restore this properly after the signal (which, after all, the shell does get).

Help welcome!

Tags: help-wanted
Revision history for this message
Thorsten Glaser (mirabilos) wrote : Re: [Bug 1667506] [NEW] Sometimes ^C leaves tty in weird state

Seb dixit:

>I can't reproduce it, mksh R54 with mpg123 1.23.4 work well.

I have this one:

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version mpg123-0.59r-MirPorts-8 (1999/Jun/15). Written and copyrights by Michael Hipp.

It doesn’t happen every time, only sometimes.

>Have you tried to switch the output module with the '-o' option?

     -o s, --speaker
          Direct audio output to the speaker.

     -o h, --headphones
          Direct audio output to the headphone connector.

     -o l, --lineout
          Direct audio output to the line-out connector.

Unlikely to change anything.

>The default is likely to be pulseaudio

Nothing of that name is ever coming even close to any system I have.

No, the audio output is sunaudio of course. Or, maybe, the OSS emulation
that us BSD people have.

But, again, this is a tty issue, most likely.

bye,
//mirabilos
--
[00:02] <Vutral> gecko: benutzt du emacs ?
[00:03] <gecko> nö [00:03] <gecko> nur n normalen mac
[00:04] <Vutral> argl [00:04] <Vutral> ne den editor
 -- Vutral und gecko2 in #deutsch (NB: Editor? Betriebssystem.)

Revision history for this message
Thorsten Glaser (mirabilos) wrote : Re: Sometimes ^C leaves tty in weird state

This also occasionally but not reproducibly occurs when mpg123 exits by itself.

summary: - Sometimes ^C leaves tty in weird state
+ Sometimes tty is in weird state after mpg123 exits
Revision history for this message
Thorsten Glaser (mirabilos) wrote :

I have another reproducer.

tg@caas:/etc$ sudo git show e5a6dcb8bfeef9b30f4ef844ebddd422c8f4d296 | wc
     87 247 2112
tg@caas:/etc$ sudo git show e5a6dcb8bfeef9b30f4ef844ebddd422c8f4d296
^Z

This triggers this bug… in mksh *and* in GNU bash. So this is most likely not an mksh bug.

I’d still be curious as to the reason, and consequently, whether mksh could do something to avoid this.

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.