You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original user comment can be found here:
http://blog.famzah.net/2009/11/20/a-much-faster-popen-and-system-implementation-
for-linux/#comment-2078
The referred page (http://www.unixguide.net/unix/programming/1.1.3.shtml) says
that _exit() must be used, instead of exit(), in situations like ours. All this
sounds reasonable, but there are a few more things to consider:
* we use exit() only for error termination -- testing will require that we manage to fail in the respective code blocks
* we also use err() to exit on errors -- it must be tested whether it uses exit() or _exit(), and be replaced with a custom macro if exit() is used
* this needs testing -- I've never had a test scenario where this has caused a problem
Resolution for now is 'do-nothing' until a practical test is shown, where
exit() gives problems.
Original issue reported on code.google.com by ivan.zah...@gmail.com on 12 Mar 2011 at 11:38
The text was updated successfully, but these errors were encountered:
Hi, I was the one posting on this issue on your blog.
I managed to get a crash when I compile popen_noshell.c in c++ (just a few
malloc conversions are needed).
See attached files for details, and
"g++ mytest.cpp popen_noshell.cpp -o mytest && ./mytest"
should lead to a segfault.
Note that if you compile popen_noshell.c as a pure C library and link it with
mytests.cpp, there is no problem. Obviously there is no such thing as "call
global object's destructors" in the C version of exit().
Original comment by devoud....@gmail.com on 13 Mar 2011 at 9:07
Thank you for the attached examples. I've fixed the exit() vs. _exit() issue.
It turned out that err() and errx() are using exit() too, so they needed to be
wrapped.
Reference: Committed revision 5.
Original comment by ivan.zah...@gmail.com on 18 Mar 2011 at 9:40
Original issue reported on code.google.com by
ivan.zah...@gmail.com
on 12 Mar 2011 at 11:38The text was updated successfully, but these errors were encountered: