NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cannot start detached sessions (with -m -d) back to back



On Fri, Dec 31, 2021 at 02:08:02 +0000, RVP wrote:

> On Fri, 31 Dec 2021, Valery Ushakov wrote:
> 
> > I think screen is racing against the child process in MakeWindow.
> 
> I think something else might also be going on:

Ouch.  That probably also explains why I was getting corrupt
ktrace.out files sometimes, there was still that ghost shell that was
being traced.

That most likely is a contributing factor.  If the stuck program is
still holding onto the slave side, the parent screen process gets
select return earlier, I guess.

When the pty that still has the ghost shell attached to the slave side
is reallocated, the ghost shell returns from read with

 16982  16982 sh       RET   read RESTART

reissues read and gets EOF.  So if the new child wins the race, the
new shell gets the pty and the new screen session is started.


> 2. For some reason, on NetBSD, closing the master PTY-fd in screen does not
>    cause programs on the slave side to exit (on EOF).

This seems like a bug to me, but I don't know much about tty driver.


> Hope this helps...

Thanks!


-uwe


Home | Main Index | Thread Index | Old Index