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

Unsafe code calling setenv after fork

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 7.10.0
    • eclccserver, JLib
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: