#Error spawning artifact arg with execveZ

1 messages · Page 1 of 1 (latest)

bright hawk
#

I am trying to spawn an artifact argument from the build system but it fails with EFAULT. Can anyone help me?

        switch (std.os.execveZ(arguments[0].?, &arguments, std.c.environ)) {
            else => |err| log.err("Error happened: {}", .{err}),
        }
#
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 }```
bright hawk
visual harbor
#

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)) {

polar current
#
  1. EFAULT pathname or one of the pointers in the vectors argv or envp points outside your accessible address space.
  2. Provide the complete cli arguments and/or how you spawn things (-lc I guess)?
  3. Provide a minimal example.
  4. my first guess is that you did not 0-terminate your string, but I dont know your input