Unsafe code calling setenv after fork

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.

Conclusion

None

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Components

Assignee

Reporter

Priority

Fix versions

Created June 15, 2020 at 9:00 AM
Updated June 18, 2020 at 7:24 AM
Resolved June 18, 2020 at 7:24 AM