Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231775 - app-shells/bash-3.2 tty session leader (tcsetpgrp) race condition
Summary: app-shells/bash-3.2 tty session leader (tcsetpgrp) race condition
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-14 15:52 UTC by Joe Peterson (RETIRED)
Modified: 2009-02-09 01:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix the race condition (stop parent from stealing child session leader status) (chet_tty_pgrp.patch,1.58 KB, patch)
2008-07-14 15:54 UTC, Joe Peterson (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Peterson (RETIRED) gentoo-dev 2008-07-14 15:52:54 UTC
A parent bash shell sometimes will set the session leader tty (using tcsetpgrp) back to itself, taking control away from a child bash shell, due to a race condition.  A result is that the child can then not then execute some commands (like stty) from its init script (e.g. .bashrc).  The result I (and others) have seen is that the bash shell will hang while reading the init script.

As far as I know (from some old posts I've seen), this is a long-standing intermittent issue.  I reported this on the bash bug list, and I received a patch from upstream that fixes it.  Upstream says this will likely make it into bash-4.0.  I will attach the patch, in case we want to apply it in Gentoo to fix the issue in current builds.

More info is here:

http://www.nabble.com/stty-sometimes-hangs-(ERESTARTSYS-error)-when-called-from-.bashrc-td18047733.html#a18305346
Comment 1 Joe Peterson (RETIRED) gentoo-dev 2008-07-14 15:54:18 UTC
Created attachment 160351 [details, diff]
Patch to fix the race condition (stop parent from stealing child session leader status)
Comment 2 SpanKY gentoo-dev 2009-02-09 01:07:42 UTC
added to bash-3.2_p48-r1