Re: [Qemu-devel] [PATCH] linux-user: fix segfault deadlock

2012-01-15 Thread Fabio Erculiani
I confirm the patch fixes the deadlock I was seeing here. -- Fabio Erculiani

[Qemu-devel] [PATCH v3 2/2] linux-user: target_argv is placed on ts->bprm->argv and can't be freed()

2012-01-03 Thread Fabio Erculiani
TaskState contains linux_bprm struct which encapsulates argv among other things. argv might be used around the code and is expected to contain valid data. Before this patch, ts->bprm->argv was NULL due to it being freed right after loader_exec(). Signed-off-by: Fabio Erculiani --- linu

[Qemu-devel] [PATCH v3 1/2] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
-off-by: Fabio Erculiani --- linux-user/syscall.c | 19 +++ 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9ba51bf..3e8e3dd 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4678,11 +4678,22 @@ static

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
Done, it all works now ;-) ! -- Fabio Erculiani

[Qemu-devel] [PATCH v2 2/2] linux-user: target_argv is placed on ts->bprm->argv and can't be freed()

2012-01-03 Thread Fabio Erculiani
--- linux-user/main.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 788ff98..513d583 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3492,11 +3492,6 @@ int main(int argc, char **argv, char **envp) _exit(

[Qemu-devel] [PATCH v2 1/2] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
-off-by: Fabio Erculiani --- linux-user/syscall.c | 21 - 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9ba51bf..e563c00 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4678,14 +4678,25

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
d to do it or the TaskState lifecycle matches the executable (so there is no need to free() it) ? -- Fabio Erculiani

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
Yeah, debugging. Moreover we have this scenario: $ /bin/cat /proc/self/stat 32297 (cat) .. I guess we should use basename() anyway...? -- Fabio Erculiani

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
Mumble, that is what happens already... Let me see why I get NULL here... -- Fabio Erculiani

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
How about setting ts->bprm->argv = target_argv; ? I'm not a qemu codebase expert, but if it's always NULL (why is it NULL?) or can be NULL... It looks like can be done easily from main.c... without making a variable global. -- Fabio Erculiani

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
Or just using linux_binprm->filename with basename() -- Fabio Erculiani

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
On Tue, Jan 3, 2012 at 6:41 PM, Alexander Graf wrote: > > On 03.01.2012, at 17:07, Fabio Erculiani wrote: > >> ts->bprm->argv seems NULL here. >> Isn't it supposed to be set? > > Good question. Maybe we need some other way to fetch argv0 then? or we co

[Qemu-devel] [PATCH] linux-user: use uint64_t for getpid()

2012-01-03 Thread Fabio Erculiani
This fixes -Wformat warning introduced by 983da8bec44fd1ab5e9730f01e719b3849aa0a35 Signed-off-by: Fabio Erculiani --- linux-user/syscall.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f2af5d5..e563c00 100644 --- a

Re: [Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
ts->bprm->argv seems NULL here. Isn't it supposed to be set? -- Fabio Erculiani

[Qemu-devel] [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.

2012-01-03 Thread Fabio Erculiani
-off-by: Fabio Erculiani --- linux-user/syscall.c | 20 +++- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9ba51bf..f2af5d5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4678,14 +4678,24

Re: [Qemu-devel] linux-user: improved fake /proc/self/stat

2012-01-03 Thread Fabio Erculiani
hints. > > And thanks a lot for fixing this! whoops, yeah this is my first contribution to qemu ;) > > On 03.01.2012, at 08:25, Fabio Erculiani wrote: > >> Hi all, >> this is a patch on top of "[PATCH 4/5] linux-user: fake >> /proc/self/stat" (sorry I co

[Qemu-devel] linux-user: improved fake /proc/self/stat

2012-01-02 Thread Fabio Erculiani
d64 " ", val); + } + else { + /* for the rest, write zeros */ + snprintf(buf, sizeof(buf), "0%c", i == 43 ? '\n' : ' '); } - snprintf(buf, sizeof(buf), "%"PRId64 "%c", val, i == 43 ? '\n' : ' '); len = strlen(buf); if (write(fd, buf, len) != len) { return -1; -- Fabio Erculiani