Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jun 2007 23:42:54 +0200 (MEST)
From:      Michiel Boland <michiel@boland.org>
To:        freebsd-current@freebsd.org
Subject:   truss(1) gets confused after execve
Message-ID:  <Pine.GSO.4.64.0706192328380.5197@neerbosch.nijmegen.internl.net>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0706192328380.5197>