Closed catap closed 7 years ago
Based implementation here: https://github.com/riboseinc/retrace/commit/63e25e0528fb3f09e6e132bcc75a5638d7990a37
Missed: OS specifed stuff :)
Indeed @catap and great start! I think we need to fix the formatting to adhere to the repo's rules though (checkpatch.pl
).
@riataman , @drystone what do you think? Maybe you're interested in growing this to a full implementation.
@ronaldtse it is a proof of concept and I doesn't like this design because it depends of supported commands and if we don't support one of command, the syscall doesn't work :(
Got it. I'm sure @riataman , @drystone or @jjr840430 would have a good solution!
I think you could get away with void * maybe_parameter = va_arg(ap void *)
for the default case just to pass the parameter (or not) through. You've already logged it as unsupported, so essentially you're making sure unsupported calls are still honoured.
default:
void * maybe_parameter = va_arg(ap void *);
r = real_fnctl(filedes, cmd, maybe_parameter);
@drystone good idea! Thanks!
Created https://github.com/riboseinc/retrace/pull/176.
Meanwhile it is a real-world example of using retrace
.
I can trace valgrind on my macOS only by retrace
for solve this bug, because dtruss
doesn't inherits limits :)
That's awesome @catap ! Thank you for being user 0 👍
@ronaldtse but I'm blocking by #169 / #104 :(
@riataman or @drystone have you got any progress?
@catap no, I haven't had a look. I'm surprised because my understanding of fork is that a child inherits the entire memory map of the parent as is. I know there is a problem with some of the execs because some copy the environment and some don't - so I suppose what you might be seeing is fork-exec pattern. I can look into this but it won't be until this time tomorrow.
@drystone no rush :) I can wait
I took a good while a bit ago and fork does inherit LD_PRELOAD, but the exec stuff wasn't.
We have fcntl now.
Hey,
I think retrace has missed one of very useful (and very complicated to implementation) syscall —
fcntl
.