The issue with 2!:2 certainly is(was) not only with the memory management. If I remember correctly, there is a table (may be the 1!:20) which tracks files in use and their descriptors ( FDs or FILE*s - again not sure now) and the supporting 2!:2 implementation is inconsistent when filling it
http://jsoftware.com/pipermail/beta/2017-April/008773.html regards, Danil 2018-03-07 18:43 GMT+03:00 Chris Double <chris.dou...@double.co.nz>: > If I comment out the call to "fa(c)" in 'jtadd2' then the segfault > goes away. Is there some memory management issue related to the > allocation and freeing of the cmd string that is going on? > > On Thu, Mar 8, 2018 at 4:31 AM, Raul Miller <rauldmil...@gmail.com> wrote: > > Huh... > > > > I wonder if there's something uninitialized in libedit (or perhaps > > some other supporting library) that needs to be initialized? > > > > -- > > Raul > > > > > > On Wed, Mar 7, 2018 at 10:26 AM, Chris Double <chris.dou...@double.co.nz> > wrote: > >> On Thu, Mar 8, 2018 at 3:29 AM, Chris Double <chris.dou...@double.co.nz> > wrote: > >>> I will investigate more though why the instability occurs. > >> > >> On closer debugging, it seems to be the add2 call, not the 'fdopen'. > >> With no changes this errors: > >> > >> 2!:2 '/bin/ls' > >> 10554 93976423924960 93976423925520 > >> 1 2 > >> Segmentation fault (core dumped) > >> > >> Note that I have to actually type in the "1 2" and it needs to have > >> the space. I can't "up arrow" in jconsole to get the previous history > >> value - it doesn't crash if I do that. > >> > >> If I comment out the 'fdopen' calls and put in dummy file pointers > >> then I still get the crash. > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm