I am using guest.RunProgram() and it crashes immediately after the guest executes the command. Looks like it is dying after C.VixVM_RunProgramInGuest() completes but during the C.get_program_output().
Here is the stack trace when it crashes:
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x7f579b6da7dd]
runtime stack:
runtime.gothrow(0x589e30, 0x2a)
/usr/local/go/src/runtime/panic.go:503 +0x8e
runtime.sigpanic()
/usr/local/go/src/runtime/sigpanic_unix.go:14 +0x5e
goroutine 1 [syscall, locked to thread]:
runtime.cgocall_errno(0x40430a, 0xc20807fcd0, 0x0)
/usr/local/go/src/runtime/cgocall.go:130 +0xf5 fp=0xc20807fcb0 sp=0xc20807fc88
github.com/hooklift/govix._Cfunc_get_program_output(0x230003a, 0x0, 0x0, 0x0, 0x0)
github.com/hooklift/govix/_obj/_cgo_gotypes.go:536 +0x44 fp=0xc20807fcd0 sp=0xc20807fcb0
github.com/hooklift/govix.(*Guest).RunProgram(0xc20802a604, 0x7fffe62c8287, 0x8, 0x7fffe62c829b, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/test/blah/src/github.com/hooklift/govix/guest.go:729 +0x1ac fp=0xc20807fd60 sp=0xc20807fcd0
main.cmdOneShot(0xc20802a560, 0x0, 0x0)
/home/test/blah/src/test/test/test.go:139 +0x3b4 fp=0xc20807fe70 sp=0xc20807fd60
main.main()
/home/test/blah/src/test/test/test.go:94 +0x3a3 fp=0xc20807ff98 sp=0xc20807fe70
runtime.main()
/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc20807ffe0 sp=0xc20807ff98
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20807ffe8 sp=0xc20807ffe0
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
goroutine 18 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
I suspect the issue is while it is trying to fill in the pid, duration, and exit code. I have not used VIX before, but can it be that pid/duration/exitcode need to be uint64, int, ... (not uint64 *, int *, ..) and then we just pass their address to get_program_output?
I am using guest.RunProgram() and it crashes immediately after the guest executes the command. Looks like it is dying after C.VixVM_RunProgramInGuest() completes but during the C.get_program_output().
Here is the stack trace when it crashes:
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x7f579b6da7dd]
runtime stack:
runtime.gothrow(0x589e30, 0x2a)
/usr/local/go/src/runtime/panic.go:503 +0x8e
runtime.sigpanic()
/usr/local/go/src/runtime/sigpanic_unix.go:14 +0x5e
goroutine 1 [syscall, locked to thread]:
runtime.cgocall_errno(0x40430a, 0xc20807fcd0, 0x0)
/usr/local/go/src/runtime/cgocall.go:130 +0xf5 fp=0xc20807fcb0 sp=0xc20807fc88
github.com/hooklift/govix._Cfunc_get_program_output(0x230003a, 0x0, 0x0, 0x0, 0x0)
github.com/hooklift/govix/_obj/_cgo_gotypes.go:536 +0x44 fp=0xc20807fcd0 sp=0xc20807fcb0
github.com/hooklift/govix.(*Guest).RunProgram(0xc20802a604, 0x7fffe62c8287, 0x8, 0x7fffe62c829b, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/test/blah/src/github.com/hooklift/govix/guest.go:729 +0x1ac fp=0xc20807fd60 sp=0xc20807fcd0
main.cmdOneShot(0xc20802a560, 0x0, 0x0)
/home/test/blah/src/test/test/test.go:139 +0x3b4 fp=0xc20807fe70 sp=0xc20807fd60
main.main()
/home/test/blah/src/test/test/test.go:94 +0x3a3 fp=0xc20807ff98 sp=0xc20807fe70
runtime.main()
/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc20807ffe0 sp=0xc20807ff98
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20807ffe8 sp=0xc20807ffe0
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
goroutine 18 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
I suspect the issue is while it is trying to fill in the pid, duration, and exit code. I have not used VIX before, but can it be that pid/duration/exitcode need to be uint64, int, ... (not uint64 *, int *, ..) and then we just pass their address to get_program_output?