[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49525] popen2 segfaults if command doesn't ex
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #49525] popen2 segfaults if command doesn't exist |
Date: |
Thu, 3 Nov 2016 22:22:55 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 |
Follow-up Comment #1, bug #49525 (project octave):
I tested and got
[in,out,pid] = popen2 ('abc')
in = 6
out = 7
pid = 10709
popen2 (child): No such file or directory
octave:6> Inconsistency detected by ld.so: dl-close.c: 764: _dl_close:
Assertion `map->l_init_called' failed!
So there is an inconsistency, but I don't get a segfault. From the
documentation, I would expect pid to be -1 if the command failed, but it is
the valid id of the forked child (although the child is defunct immediately
because the shell throws an error for 'abc').
This situation isn't handled well even in C according to the man page for
popen . I don't know what to do here, but it would be nice to have something
better than a segfault.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49525>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/