Opened 9 years ago

Last modified 9 years ago

#483 assigned bug

omalloc alignment wrong on 32-bit SPARC

Reported by: jdemeyer@… Owned by: hannes
Priority: minor Milestone: 3-2-0 and higher
Component: omalloc Version: 3-1-5
Keywords: Cc:

Description

When building Singular on the following system (relevant is the 32-bit SPARC processor)

$ uname -a
SunOS mark 5.10 Generic_127111-01 sun4u sparc SUNW,Sun-Blade-2500

accesses to 64-bit integers must be aligned to 8 bytes, otherwise Singular crashes with a Bus Error signal. However, omalloc/configure fails to detect this problem. gdb session (Singular running within Sage):

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0xf9f743ac in add_to_basis_ideal_quotient (h=0x4f170dc, c=0x4f16b38, ip=0x0) at tgb.cc:1518
1518      c->weighted_lengths[i] = pQuality (h, c, c->lengths[i]);
(gdb) list
1513      }
1514      else
1515        pNorm (h);
1516      pNormalize (h);
1517
1518      c->weighted_lengths[i] = pQuality (h, c, c->lengths[i]);
1519      c->gcd_of_terms[i] = got;
1520    #ifdef HAVE_BOOST
1521      c->states.push_back (dynamic_bitset <> (i));
1522
(gdb) print c->weighted_lengths
$5 = (wlen_type *) 0x4f4659c

Here, wlen_type is a 64-bit integer at a non-8-byte aligned address.

Configuring with --with-align=8 fixes the issue. This should probably be handled in omalloc/configure. I am unable to provide a patch since I don't understand what the various alignment options (8 vs. strict vs. sloppy) mean and this doesn't seem to be documented.

Change History (2)

comment:1 Changed 9 years ago by hannes

Owner: changed from somebody to hannes
Status: newassigned

http://www.singular.uni-kl.de:8002/trac/changeset/15737 should fix this - please try with your example.

alignment rules in omalloc: 8: every allocation is 8-byte-aligned sloppy: every allocation is 4-byte-aligned strict: omAllocAligned is 8-byte-aligned, omAlloc is 4-byte-aligned

comment:2 in reply to:  1 Changed 9 years ago by jdemeyer@…

Replying to hannes:

alignment rules in omalloc: 8: every allocation is 8-byte-aligned sloppy: every allocation is 4-byte-aligned strict: omAllocAligned is 8-byte-aligned, omAlloc is 4-byte-aligned

Could this be documented somewhere?

Note: See TracTickets for help on using tickets.