linux-mips-fnet
[Top] [All Lists]

Re: Problems w/ 2.1.131 on r3k

To: "Gleb O. Raiko" <raiko@niisi.msk.ru>, "linux-mips@fnet.fr" <linux-mips@fnet.fr>
Subject: Re: Problems w/ 2.1.131 on r3k
From: ralf@uni-koblenz.de
Date: Tue, 26 Jan 1999 01:41:09 +0100
In-reply-to: <36AC8C20.F3225338@niisi.msk.ru>; from Gleb O. Raiko on Mon, Jan 25, 1999 at 06:22:08PM +0300
References: <36AC8C20.F3225338@niisi.msk.ru>
On Mon, Jan 25, 1999 at 06:22:08PM +0300, Gleb O. Raiko wrote:

> The problem I have is that 'make' dies with error 'wait: Bad address"
> after Ctrl+Z is pressed. (The test is to compile something, e.g. gdb
> from sources.) Children of make (e.g. gcc) die too. The problem affects
> other utilities, e.g. man, but doesn't affect small tests I wrote. The
> kernel log contains '<process name>: Exception at ...'. Futher
> investigation showed that getrusage is called with bad user address.

Syscall restarting for syscalls with four or more arguments won't work, the
fourth argument will be corrupted before return from kernel mode.  The
following changes to arch/mips/kernel/{signal.c,scall_o32.S} should fix
that:

[...]
        case ERESTARTNOINTR:            /* Userland will reload $v0.  */
                regs->regs[7] = regs->regs[26];
                regs->cp0_epc -= 8;
        }
[...]
stack_done:
        sw      a3, PT_R26($28)         # save for syscall restart
        lw      t0, TASK_FLAGS($28)     # syscall tracing enabled?
        andi    t0, PF_TRACESYS
[...]

I assume that the erroneous arguments to getrusage(2) are were indirectly
caused by this.

> I had to apply the patch which is attached here. Without this patch,
> user process will never leave the kernel mode. (Harald, with the patch
> the kernel should be 'more stable').

Looks correct but won't work on R4000, so I don't put it into my
sources.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>