truss(1) gets confused after execve

Michiel Boland michiel at boland.org
Tue Jun 19 21:42:56 UTC 2007


Hi. If i truss the following program

#include <unistd.h>

extern char **environ;

int main(int argc, char **argv)
{
         execve("/usr/bin/false", argv, environ);
         return 1;
}

then everything after the execve() call is reported as garbage.
E.g. something like
[snip]

execve("/usr/bin/false",<missing argument>,<missing argument>)
execve("/usr/bin/false",<missing argument>,<missing argument>) = 0 (0x0)
-- UNKNOWN SYSCALL -6040 --
(null)(0x0,0x7fffffffe880,0x0,0x0,0x0)           = 198 (0xc6)
-- UNKNOWN SYSCALL 5394432 --
(null)(0xc5,0x0,0x2a0,0x3,0x1000)                = 73 (0x49)
-- UNKNOWN SYSCALL 5394432 --

etc.

Something looks not quite right here.
This is -CURRENT on amd64 if that matters.

Also, truss on amd64 appears to coredump if the above program is compiled 
with -m32. Probably because it gets the size of the argv and envp 
arguments wrong.

Anyone looking into this yet? I could not find any relevant PRs with the 
word truss in the title.

Cheers
Michiel


More information about the freebsd-current mailing list