[Date Prev][Date Next] [Chronological] [Thread] [Top]

memory alignment errors (ITS#2760)

Full_Name: Aaron Richton
Version: HEAD, 2.1.22
OS: sparc64-solaris
Submission from: (NULL) (

When compiling under the Sun Studio compilers for Solaris 9/sparc64 (64 bit
code), slapd dies with a SIGBUS. You can easily reproduce this with a run of
test000 (see below, run under HEAD) eg:

CC='/opt/SUNWspro/bin/cc' CFLAGS='-xarch=v9' ./configure
make depend;make;make test

last 6 lines from test000 master.log:
=> access_allowed: search access to "" "objectClass" requested
=> access_allowed: backend default search access granted to "(anonymous)"
<= test_filter 6
=> send_search_entry: dn=""
=> access_allowed: read access to "" "entry" requested
=> access_allowed: backend default read access granted to "(anonymous)"

dbx stack trace from test000:
t@3 (l@3) signal BUS (invalid address alignment) in ber_init2 at line 307 in
file "io.c"
  307           ber->ber_tag = LBER_DEFAULT;
=>[1] ber_init2(ber = 0xffffffff7cbff5bc, bv = 0xffffffff7cbfe568, options = 1),
line 307 in "io.c"
  [2] slap_send_search_entry(op = 0x100386bb0, rs = 0xffffffff7cbffae0), line
674 in "result.c"
  [3] do_search(op = 0x100386bb0, rs = 0xffffffff7cbffae0), line 309 in
  [4] connection_operation(ctx = 0xffffffff7cbffc30, arg_v = 0x100386bb0), line
997 in "connection.c"
  [5] ldap_int_thread_pool_wrapper(xpool = 0x1002dabc0), line 463 in "tpool.c"

cc -V output: cc: Sun C 5.5 2003/03/12
(Studio 8. This also occurred under Studio 7.)

Workaround: Binaries produced with "-misalign" flag to cc pass the test, but
this necessarily implies a performance cost (it enables trapping and 1 byte