The nix os_handler() needs be declared extern “C” since it is being called from libc. The current signature expects the rust calling convention, but it is being called with the C calling convention. This doesn’t crash on x64 or ARM where both C and rust pass the first arguments in registries, but will probably crash on x86 where C passes all arguments on the stack. Also, the register order is probably different, so the sig argument is probably invalid.
The nix
os_handler()
needs be declaredextern “C”
since it is being called from libc. The current signature expects the rust calling convention, but it is being called with the C calling convention. This doesn’t crash on x64 or ARM where both C and rust pass the first arguments in registries, but will probably crash on x86 where C passes all arguments on the stack. Also, the register order is probably different, so thesig
argument is probably invalid.