truss(1) gets confused after execve

From: Michiel Boland <michiel_at_boland.org>
Date: Tue, 19 Jun 2007 23:42:54 +0200 (MEST)
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
Received on Tue Jun 19 2007 - 19:42:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:12 UTC