Hello,

I am facing a problem when using qemu-arm, when the target code uses the SYS_GET_CMDLINE semi-hosting call.

Indeed, in arm-semi.c (line ~376), args are read from ts->info->host_argv, which in turn has been initialised much earlier in linuxload.c:load_exec with the value of target_argv.

The problem is that target_argv is freed in main() target code execution.

A quick and dirty fix is not to free target_argv, a better one would be to re-construct it again from the allocated target memory.

I am surprised to face such an obvious bug, am I missing something?
(The corresponding commit took place in Nov 2006, how could it go unnoticed for so long?)

Thanks.

Christophe.


Reply via email to