2005-05-19 01:21:17

by Zhang, Yanmin

[permalink] [raw]
Subject: 32bit processes at compatbility mode on x86_64 machines fail to restart syscall after processing a signal

The test case at
http://cvs.sourceforge.net/viewcvs.py/posixtest/posixtestsuite/conforman
ce/interfaces/clock_nanosleep/1-5.c fails if it runs as a 32bit process
on x86_86 machines.

The root cause is the sub 32bit process fails to restart the syscall
after it is interrupted
by a signal.

The syscall number of sys_restart_syscall in table sys_call_table is
__NR_restart_syscall (219) while it's __NR_ia32_restart_syscall (0) in
ia32_sys_call_table. When regs->rax==(unsigned
long)-ERESTART_RESTARTBLOCK,
function do_signal doesn't distinguish if the process is 64bit or 32bit,
and always sets
restart syscall number as __NR_restart_syscall (219).

Here is a patch against kernel 2.6.12-rc4.

Signed-off-by: Zhang Yanmin <[email protected]>



Attachments:
32bit_process_fail_restart_syscall.patch (623.00 B)
32bit_process_fail_restart_syscall.patch

2005-05-19 01:49:15

by Andi Kleen

[permalink] [raw]
Subject: Re: 32bit processes at compatbility mode on x86_64 machines fail to restart syscall after processing a signal

"Zhang, Yanmin" <[email protected]> writes:

> The test case at
> http://cvs.sourceforge.net/viewcvs.py/posixtest/posixtestsuite/conforman
> ce/interfaces/clock_nanosleep/1-5.c fails if it runs as a 32bit process
> on x86_86 machines.
>
> The root cause is the sub 32bit process fails to restart the syscall
> after it is interrupted
> by a signal.
>
> The syscall number of sys_restart_syscall in table sys_call_table is
> __NR_restart_syscall (219) while it's __NR_ia32_restart_syscall (0) in
> ia32_sys_call_table. When regs->rax==(unsigned
> long)-ERESTART_RESTARTBLOCK,
> function do_signal doesn't distinguish if the process is 64bit or 32bit,
> and always sets
> restart syscall number as __NR_restart_syscall (219).

Thanks for tracking this down. Queued.

-Andi