[Jprogramming] task to ssh interactive

Chris Double chris.double at double.co.nz
Wed Mar 7 14:29:56 UTC 2018


I'll have to investigate more to work out why the instability happens.
Just a note on:

> It's the pipe that's used to communicate between the processes, the
> fdopen creates buffers which do need to be independent.

The fdopen calls are used to get a FILE* for the integer file handle
which are only used as return values in the array that is returned to
the caller - only the parent process uses it. That's why I made the
assumption it's safe to move the calls to after the fork, and
happening only in the parent process. I will investigate more though
why the instability occurs.

There's an additional bug I get where 1!:20 segfaults if 2!:2 has been
used. When generating the table of file handle and filename mappings
it appears to not like the entries added by 2!:2. Possibly something
in the jtjadd2 function or in the function that handles 1!:20 itself.
Do you see this issue on your machine? This repeats it for me:

   2!:2 '/bin/ls'
9701 94708241802784 94708241803344
   1!:20 ''
Segmentation fault (core dumped)

-- 
http://bluishcoder.co.nz


More information about the Programming mailing list