[Pkg-db-devel] Bug#247655: svnadmin crashes with "unaligned access"

David Kimdon David Kimdon <david@kimdon.org>, 247655@bugs.debian.org
Fri, 7 May 2004 22:19:55 +0200


> I compiled the Debian sources of db4.2 on my machine.  This
> did not fix the problem.  I tought, the problem maybe is
> there because the packages got compiled on a parisc64
> machine.

That is a start, I think that resolving this problem may require
patching the db4.2 or subversion source.  Based on my understanding of
the problem db4.2 is performing as 'ldcw' instruction [1] and the operand
is not 16 byte aligned.  This causes the exception.  db4.2 goes to
some effort to ensure 16 byte alignment (mutex/mut_tas.c:42) so
perhaps something is currupting the memory where the address of the
mutex is stored.

> > > valinor:~# svnadmin create /d1/svn
> > > svnadmin(12467): unaligned access to 0x4082be8c at
> > 
> > 0x4082be8c is 4 byte aligned, what sort of access is the cpu trying to
> > make?
> 
> How can I find that out?  I'm not very familar with such
> things.

I was actually talking to myself out loud.  I tried to answer the
question later in my message.  

A question whose answer might bring us closer to a solution is:

Why is the CPU trying to access the mutex at a bad address?

To answer this someone could build libdb4.2 (and subversion as well
perhaps) with debugging symbols on hppa and examine it in the debugger
around the exception.

It might help putting a watch point wherever the mutex adddress is
stored (after the call to __db_tas_mutex_init()) has returned to see
if anyone modifies it (that could be causing our exception).

Some code to browse to better see what is going on looks like
dbinc/mutex.h and mutex/mutex_tas.c, specifically MUTEX_SET().  

-David

[1] : This describes 'ldcw'
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,958!56!253,00.html#MARKER-2-71