[forkserver] Send the whole environment to the child process
Categories
(Core :: IPC, enhancement)
Tracking
()
People
(Reporter: jld, Assigned: jld)
References
Details
Currently, the fork server protocol sends a set of environment variable assignments (LaunchOptions::env_map), which are applied to relative to the fork server's environment. This is a difference from direct process launching if the parent process' and forkserver process' environments have diverged in a way that matters. It caused bug 1876056 in the case of setenv calls by test code intended to be inherited by child processes, but it could be problem more generally.
I think it makes sense to just send the whole environment, with the changes from env_map applied, and have the fork server's child process assign a new array to environ. This also means that LaunchOptions::full_env could be supported (although it was added for use by Subprocess.jsm and isn't currently used with Gecko IPC child processes, but it's one less thing for someone to maybe trip over later).
One complication: MiniTransciever currently assumes that each message will fit inside a single 8kB buffer; the environment is typically relatively small (about 4kB on my system) but could potentially be very large (Linux's man page says ¼ the stack rlimit, which is 2MB on this system), so it would be necessary to be more flexible about the buffer size or to use a segmented BufferList. I'll look into that after bug 1858272, which rearranges how the protocol sends the argv/env data.
Description
•