Coda File System

Re: venus dying with a SIGBUS

From: Brett Lymn <blymn_at_baesystems.com.au>
Date: Thu, 28 Jun 2007 10:17:48 +0930
On Wed, Jun 27, 2007 at 12:04:15PM -0400, Jan Harkes wrote:
> 
> That is some good digging, but it may still be Coda's fault as we
> allocate our own stacks for the LWP threads.
> 

Yes, it does look like it is a problem with the lwp.

> 
> Either the stack is misaligned,

The stack is misaligned, the program counter is pointing at a xmm
instruction when the bus error occurs.  A bit of googling dug up an
old FreeBSD posting describing exactly what I am seeing.

I had another look at the lwp process.S code and I can see a couple of
problems.  1) the fp registers are not being saved on switch, 2) the
stack is not 16 byte aligned.

The alignment is the real problem at the moment, moving data to/from
the xmm registers apart from a few special instrcutions must be
aligned on a 16 byte boundary.

I will have a look at fixing lwp though I am wondering if it is not
time to just layer lwp on top of pthreads (yes, I know this can be
done - last time I looked I had problems) - I don't believe there is
any modern OS that does not have a threading implementation these days.

-- 
Brett Lymn
Received on 2007-06-27 20:51:06