Subject: Re: Process exiting but still running
To: R. Braun <syn@sceen.net>
From: Andrey Petrov <petrov@netbsd.org>
List: port-sparc64
Date: 12/18/2003 11:19:29
On Thu, Dec 18, 2003 at 05:45:28PM +0100, R. Braun wrote:
> Hi,
> 
> One of the users of my sparc64 shell server has tested some sparc64 assembly
> code. He created a process which keeps running in RE+ state :
> 
>  9138 p2- RE+   6:03.52 (h)
> 
> Later, the process moved to the RNE state (nobody niced it) :
> 
>  9138 p2- RNE  13:03.16 (h)
> 
> here is the source code :
> 
> .global main
> main:
>  sub %sp,4,%sp
>  mov 42,%o0    // exit(42)
>  mov 1,%g1     // 1 = SYS_exit
>  ta  9         // get the syscall
> 
> I guess the problem comes from the sub %sp,4,%sp line. Though it is a
> programming error (in this case it was used to see how the machine would handle
> such a programming error), is there no way to prevent this ? And is it related
> to the architecture or can NetBSD handle it ?
> 

It should but it not always does it properly. Thanks for test.
And yes, it is sparc specific problem due to register windows lazy save
operations.

	Andrey