-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Zig Version
0.16.0-dev.1204+389368392
Steps to Reproduce and Observed Behavior
const std = @import("std");
pub fn main() !void {
var d: std.heap.DebugAllocator(.{}) = .init;
_ = try d.allocator().alloc(u8, 1);
}zig build-exe -fnew-linker main.zig
./main
Segmentation fault at address 0x208fc0
aborting due to recursive panic
Executable from New linker gets a Segfault on this line 5074:
Lines 5071 to 5074 in 2f4bca4
| const elf_base = std.process.getBaseAddress(); | |
| const ehdr: *elf.Ehdr = @ptrFromInt(elf_base); | |
| // Make sure the base address points to an ELF image. | |
| assert(mem.eql(u8, ehdr.e_ident[0..4], elf.MAGIC)); |
Old linker works fine: zig build-exe -fno-new-linker main.zig
This may be related to other issues like
#25328
#25421
Expected Behavior
No segfault
myclevorname
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.