Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-24238

Unsafe code calling setenv after fork

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.10.0
    • Component/s: eclccserver, JLib
    • Labels:
      None

      Description

      When passing new environment veriables to a child process, we call setenv after forking - but this is unsafe and may lock up (if some other thread holds a malloc lock at the time of forking).

      We should instead build a new envp array prior to the fork, and pass it to execvpe

      In practice this is only (currently) used from eclccserver and we have not observed it causing any issues.

        Attachments

          Activity

            People

            • Assignee:
              richardkchapman Richard Chapman
              Reporter:
              richardkchapman Richard Chapman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: