aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-26 13:50:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-26 13:50:26 -0700
commit3f9588ca29c721f11eb9dae8f6de8ebd1155c7bf (patch)
treecef7fd69c3dc20dabdda4f90d3a7fc5b2c46d13f /src/stage1/codegen.cpp
parented39ff202baf5bb73e54f7ecc20df63d9c190dc9 (diff)
downloadzig-3f9588ca29c721f11eb9dae8f6de8ebd1155c7bf.tar.gz
zig-3f9588ca29c721f11eb9dae8f6de8ebd1155c7bf.zip
std: do not call malloc() between fork() and execv()
We were violating the POSIX standard which resulted in a deadlock on musl v1.1.24 on aarch64 alpine linux, uncovered with the new ThreadPool usage in the stage2 compiler. std.os execv functions that accept an Allocator parameter are removed because they are footguns. The POSIX standard does not allow calls to malloc() between fork() and execv() and since it is common to both (1) call execv() after fork() and (2) use std.heap.c_allocator, Programmers are encouraged to go through the `std.process` API instead, causing some dissonance when combined with `std.os` APIs. I also slapped a big warning message on all the relevant doc comments.
Diffstat (limited to 'src/stage1/codegen.cpp')
0 files changed, 0 insertions, 0 deletions