0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Andrew Kelley 3f9588ca29 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.
History 2020-12-26 13:50:26 -07:00
..
atomic std: Validate the atomic ordering parameter in atomic.Int 2020-12-10 09:23:48 +01:00
build Return encoded slice from base64 encode 2020-12-24 01:27:21 +02:00
c openbsd: add commonly used libc wrappers for pledge(2) and unveil(2) 2020-12-25 16:43:14 +02:00
compress small fixes and zig fmt 2020-12-09 13:54:26 +02:00
crypto Fix Gimli hash on 16n byte inputs 2020-12-23 10:59:14 +02:00
event linuxWaitFd: make NetworkSubsystemFailed error unreachable 2020-11-16 14:03:19 -08:00
fmt std: Implement more useful approxEq semantics 2020-11-05 16:08:49 +01:00
fs std: fix compile errors introduced in previous commit 2020-12-23 20:49:38 -07:00
hash std: Don't hash undefined bits 2020-12-17 12:00:48 +01:00
heap small fixes and zig fmt 2020-12-09 13:54:26 +02:00
io std: clenup, fixes, fmt 2020-12-24 00:23:29 +02:00
json std.json: unreachable -> expect in tests 2020-12-08 19:16:17 -05:00
math std: explicitly cast indices to usize 2020-12-09 16:48:41 +01:00
mem use Allocator.allocSentinel now that the stage1 bug is fixed 2020-09-29 12:06:35 -07:00
meta std: Bool has no definite representation too 2020-12-14 20:06:46 +01:00
net More fixups for Windows targets 2020-10-28 10:03:23 +01:00
os Merge pull request #7531 from Vexu/orphanage 2020-12-24 10:59:37 +02:00
rand std: introduce a thread-local CSPRNG for general use 2020-12-18 12:22:46 -07:00
special Add sincosf function (#7267) 2020-12-23 11:18:15 +02:00
target Use correct names for generic SPARC targets 2020-10-24 20:03:41 +07:00
testing add license header to all std lib files 2020-08-20 16:07:04 -04:00
time add license header to all std lib files 2020-08-20 16:07:04 -04:00
unicode std: Make utf8CountCodepoints much faster 2020-11-05 16:10:34 +01:00
valgrind add license header to all std lib files 2020-08-20 16:07:04 -04:00
zig std.CrossTarget: add isNativeAbi() 2020-12-13 00:40:35 +01:00
array_hash_map.zig std: Re-enable ArrayHashMap test for mips targets 2020-11-02 11:46:07 +01:00
array_list.zig std: clenup, fixes, fmt 2020-12-24 00:23:29 +02:00
ascii.zig std: Add a few helpers for matching ascii strings (#7300) 2020-12-04 15:27:28 -05:00
atomic.zig std: add std.atomic.Bool 2020-11-19 00:58:13 +11:00
auto_reset_event.zig std: fix compile errors introduced in previous commit 2020-12-23 20:49:38 -07:00
base64.zig Return encoded slice from base64 encode 2020-12-24 01:27:21 +02:00
buf_map.zig fix memory leak in BufMap 2020-11-30 10:40:16 -08:00
buf_set.zig hash_map: rename to ArrayHashMap and add new HashMap implementation 2020-09-02 00:17:50 +02:00
build.zig builder: implement float options 2020-12-20 01:24:59 +02:00
builtin.zig stage1: Initial implementation of @extern 2020-11-20 22:32:43 +01:00
c.zig restore std.ResetEvent.isSet functionality 2020-12-23 13:36:21 -08:00
child_process.zig std: do not call malloc() between fork() and execv() 2020-12-26 13:50:26 -07:00
coff.zig remove deprecated uses of ArrayList.span 2020-11-07 11:15:44 +00:00
compress.zig std: Add a gzip decoder 2020-09-11 20:02:41 -04:00
comptime_string_map.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
crypto.zig std: introduce a thread-local CSPRNG for general use 2020-12-18 12:22:46 -07:00
cstr.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
debug.zig rework std.ResetEvent, improve std lib Darwin integration 2020-12-23 16:57:18 -08:00
dwarf.zig Merge pull request #7005 from jshholland/deprecate-span 2020-11-18 13:14:48 +02:00
dwarf_bits.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
dynamic_library.zig Fix WindowsDynLib.openW trying to strip the \??\ prefix when it does not exist 2020-11-30 11:12:33 -08:00
elf.zig Merge branch 'piepiepie' of https://github.com/LemonBoy/zig into pie 2020-11-22 12:39:44 -07:00
event.zig std/event: Fix import path for WaitGroup 2020-12-03 12:43:55 -08:00
fifo.zig Merge pull request #6434 from daurnimator/fifo.pump 2020-11-18 16:35:13 +02:00
fmt.zig std: Fix formatting of type values 2020-12-13 23:21:23 -05:00
fs.zig Return encoded slice from base64 encode 2020-12-24 01:27:21 +02:00
hash.zig Promote hash/siphash to crypto/siphash 2020-08-22 02:47:50 -04:00
hash_map.zig small fixes and zig fmt 2020-12-09 13:54:26 +02:00
heap.zig Fix StackFallbackAllocator 2020-12-17 19:09:29 +02:00
io.zig std: clenup, fixes, fmt 2020-12-24 00:23:29 +02:00
json.zig std: clenup, fixes, fmt 2020-12-24 00:23:29 +02:00
leb128.zig Add builtin.Signedness, use it instead of is_signed 2020-11-19 18:59:21 +02:00
linked_list.zig std: remove init functions from linked list nodes 2020-08-22 02:47:39 -04:00
log.zig fix another round of regressions in this branch 2020-09-26 21:03:38 -07:00
macho.zig lld+macho: lld xcomp to x86_64 macos now works 2020-12-17 10:04:53 +01:00
math.zig Fix typo in math.order 2020-12-16 12:14:44 +02:00
mem.zig Merge pull request #7084 from xackus/mem-volatile 2020-11-18 13:06:35 +02:00
meta.zig std.crypto.random: introduce fork safety 2020-12-18 15:54:01 -07:00
mutex.zig std: fix compile errors introduced in previous commit 2020-12-23 20:49:38 -07:00
net.zig move ArrayListSentineled to std lib orphanage 2020-12-23 16:24:22 +02:00
once.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
os.zig std: do not call malloc() between fork() and execv() 2020-12-26 13:50:26 -07:00
packed_int_array.zig Add builtin.Signedness, use it instead of is_signed 2020-11-19 18:59:21 +02:00
pdb.zig remove deprecated uses of ArrayList.span 2020-11-07 11:15:44 +00:00
priority_queue.zig small fixes and zig fmt 2020-12-09 13:54:26 +02:00
process.zig std: do not call malloc() between fork() and execv() 2020-12-26 13:50:26 -07:00
Progress.zig std.Progress: work around time going backwards 2020-12-23 13:36:21 -08:00
rand.zig std: introduce a thread-local CSPRNG for general use 2020-12-18 12:22:46 -07:00
ResetEvent.zig rework std.ResetEvent, improve std lib Darwin integration 2020-12-23 16:57:18 -08:00
SemanticVersion.zig std: Introduce SemanticVersion data structure 2020-11-06 15:07:48 -05:00
sort.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
spinlock.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
start.zig std.crypto.random: introduce fork safety 2020-12-18 15:54:01 -07:00
start_windows_tls.zig add license header to all std lib files 2020-08-20 16:07:04 -04:00
StaticResetEvent.zig std: fix compile errors introduced in previous commit 2020-12-23 20:49:38 -07:00
std.zig Merge pull request #7531 from Vexu/orphanage 2020-12-24 10:59:37 +02:00
target.zig stage2: Use correct ppc generic feature set 2020-11-20 08:38:10 +01:00
testing.zig Return encoded slice from base64 encode 2020-12-24 01:27:21 +02:00
thread.zig std: make the use of pthread_join POSIX-compliant 2020-12-02 10:59:35 +01:00
time.zig std: Fix early overflow in time calculation 2020-11-01 17:06:14 -05:00
unicode.zig Switch to using unicode when parsing the command line on windows (#7241) 2020-11-30 13:47:01 -05:00
valgrind.zig Revert "std.valgrind: add helgrind functions" 2020-12-24 01:14:41 -07:00
zig.zig std: remove renderStringLiteral in favor of std.fmt specifier 2020-10-17 23:20:38 +03:00