[egenix-users] SIGBUS from mx/BeeBase/mxBeeBase/btr.c on HP-UX, Alpha, IRIX, Solaris

Albert Chin egenix-users at mlists.thewrittenword.com
Wed Jan 11 13:43:29 CET 2006


On Wed, Jan 11, 2006 at 08:27:17PM +0100, M.-A. Lemburg wrote:
> Albert Chin wrote:
> > On Wed, Jan 11, 2006 at 10:20:19AM -0600, Albert Chin wrote:
> >> On Wed, Jan 11, 2006 at 05:00:25PM +0100, M.-A. Lemburg wrote:
> >>> Are you compiling this on a 64-bit machine ?
> >> They are all 64-bit CPUs but we are building 32-bit objects.
> >>
> >>> FWIW: When trying the test.py script on an AMD64 machine it
> >>> runs through fine.
> >> Yeah, we tried on RHEL 3/AMD64 and 4/AMD64 with success.
> >>
> >>> It's been ages since I last looked at the code, so it's hard
> >>> to tell what the problem could be.
> >> What I don't understand is why this doesn't work:
> >>   *mkey1 = 0;
> >>   *(mkey1 + 1) = 0;
> >>   *(mkey1 + 2) = 0;
> >>   *(mkey1 + 3) = 1;
> >>   val = *mkey2;
> >>   ^^^^^^^^^^^^^ SIGBUS
> > 
> > I think it's a memory-alignment issue. Maybe unsigned longs on the
> > problematic platforms need to be aligned to an even address, or
> > something like that. If so, how to fix?
> 
> The above does hint at that yes.
> 
> Where exactly in test.py do you get the bus error ?

#0  0xfee7a410 in bInsertKey (h=0x179088, key=0x188c14, rec=1)
    at mx/BeeBase/mxBeeBase/btr.c:1037
1037                rec(mkey) = rec;

Passing this through the preprocessor:
  *(bRecAddr *)((char *)(mkey) + h->keySize) = rec;
where bRecAddr is an 'unsigned long'.

> It's possible that on your platforms, a keysize of 10 (which
> is used in test.py) is not allowed. Perhaps you could try 16
> instead.

Same error at the same place. I tried 32 but got:
  Building integer index without duplicates... done.
  Checking integer index without duplicates... done.
  Building string index without duplicates...
  Traceback (most recent call last):
    File "test.py", line 35, in ?
      idx = BeeStringIndex(testfile, keysize=32, dupkeys=0, filemode=2)
  ValueError: illegal sector size (too small or not 0 mod 4)

-- 
albert chin (china at thewrittenword.com)



More information about the egenix-users mailing list