#251 external_parsers doesn't report execv failure

htdig (103)

There is a bug in the external_parsers handling of
htdig (versions 3.1.6 and 3.2.0b6). htdig does a fork()
and execv() to call the script, and if the execv()
fails the child process exits, as it should. But, the
child process exits using the exit() function, rather
than _exit(), which is a no-no in a child process. The
problem is that the fork() makes a duplicate of
everything in the parent process, including all the
parent's I/O buffers. If the child process calls
exit(), it flushes its copy of the parent's stdout
buffer, so a copy of much of the parent's verbose
output gets flushed out into the child's pipe, which
the parent reads and parses. The fix is to change
htdig/ExternalParser.cc to put out an error message and
call _exit() if the execv() fails. See


for details and a patch. The patch needs to be tested,
and if it works correctly, be committed to CVS.


  • Gilles Detillieux

    • milestone: --> Include_in_3.2
    • status: open --> pending-fixed
  • Gilles Detillieux

    Logged In: YES

    Just fixed in CVS for next 3.2 release. Needs to be done in
    3.1.x too.

  • SourceForge Robot

    Logged In: YES

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

  • SourceForge Robot

    • status: pending-fixed --> closed-fixed

Log in to post a comment.