#Error spawning artifact arg with execveZ
1 messages · Page 1 of 1 (latest)
steps [6/10] zig build-exe debugger Debug native... LLVM Emit Object... thread 8127 panic: reached unreachable code
/home/david/dev/zig/lib/std/os.zig:1797:19: 0xb7b08b in execveZ (debugger)
.FAULT => unreachable,
^
/home/david/dev/debugger/src/main.zig:91:31: 0xb7908d in main (debugger)
switch (std.os.execveZ(arguments[0].?, &arguments, std.c.environ)) {
^
/home/david/dev/zig/lib/std/start.zig:588:37: 0xb7b5de in main (debugger)
const result = root.main() catch |err| {
^
???:?:?: 0x7f6541423ccf in ??? (libc.so.6)
Unwind information for `libc.so.6:0x7f6541423ccf` was not available, trace may be incomplete
error: Wait pid: os.WaitPidResult{ .pid = 8128, .status = 1663 }```
if I print program arguments this doesn't happen... wtf. Code: https://github.com/birth-software/debugger/blob/06c06ab53939ee58c4d8d7843d6d4082d4b0fb9d/src/main.zig#L87
it is indeed weird, but have you tried
const arguments = &[_:null]?[*:0]const u8{executable};
switch (std.os.execveZ(arguments[0].?, arguments, std.c.environ)) {
- EFAULT pathname or one of the pointers in the vectors argv or envp points outside your accessible address space.
- Provide the complete cli arguments and/or how you spawn things (-lc I guess)?
- Provide a minimal example.
- my first guess is that you did not 0-terminate your string, but I dont know your input