Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-75

Bug in Perl 5.8.0 causes exit status to be reported incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.1
    • vcld (backend)
    • None
    • Perl 5.8.0

    Description

      This isn't a VCL bug but improvements can be made to avoid the following. There is a bug in Perl 5.8.0 which causes the exit statuses of forked processes to be reported incorrectly. This happens sporadically. It has to do with the way Perl 5.8.0 handles CHLD signals. The problem does not occur with Perl 5.8.5.

      The vcld::REAPER subroutine handles dead processes and should set the exit status to the value returned by the forked process. This is actually contained in the special $? variable. The exit status is $? >> 8.

      When the problem occurs, REAPER seems to correctly handle (reap) the dead process and correctly sets $? before returning. When control is returned to the calling subroutine, the $? gets changed to -1. The calling subroutine then shifts by 8 bits and the exit status is 16777215.

      The problem occurs randomly. The same command can be correctly run many times. The exit status will be 0 for some executions and 16777215 for others.

      This causes problems if subroutines expect a certain value to be returned meaning success – usually 0.

      Attachments

        Activity

          People

            arkurth Andrew Kurth
            arkurth Andrew Kurth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: