Discussion:
Work to be done
Kailash Sethuraman
2006-05-05 09:48:48 UTC
Permalink
Hi all,
From the current codebase please run the code with --trace-syscalls=yes.
This will show you that the point where vg4nbsd fails is in PRE()
calls of the syscall wrappers.
This was a little difficult to spot because the wrappers in
syswrap-generic were assumed to work.
This of course doesnt, due to the ever irritating pass by register vs
pass by stack issues with linux and nbsd.
Fixing PRE() POST() wrappers and possibly also stub code around it
should fix our existing problems.
When loading dynamic binaries, sys_write()s wrappers which do not have
the I_die_here stubs in them, fail. These are in syswrap-generic. As
this fails, the client within valgrind calls sys_exit which succeeds.

THe problem can be spotted more clearly when running static binaries,
it brarfs that a syscall is unimplemented.
The --trace-syscalls=yes enables the PRINT statements within the PRE
wrappers. This results in us getting more info about the parameters
going into the syscall before it fails, and is key to debugging this
issue.

Hopefully fixing these wrappers should be all it takes.
Fixing the first wrapper would give us a template on how to do
wrappers for netbsd as well!

Regards,
Kailash

Loading...