> Have you looked at the documentation?
>
http://docs.hp.com/en/14487/pragmas.htm#pragma-pack-ex3Yes, some of it. And I have tried a couple of #pragma variants, but it did not work ( still getting "Bus error"/BUS_ADRALN ).
Maybe I used the wrong byte-alignment, or maybe I used the #pragma pack directive in the wrong way.
However, a #pragma pack directive can affect the size and mapping of a structure that is declared after the directive, in the same source code. But that is something that I do not have any control over in this case, since the SIGBUS signal is received when the program is running a function ( wcstombs() ) from libc.
Here is the output from gdb:
HP gdb 5.4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.4.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `sudosh'.
Program terminated with signal 10, Bus error.
BUS_ADRALN - Invalid address alignment
#0 0xc0000000002e4790:0 in wcstombs+0x790 () from /usr/lib/hpux64/libc.so.1
(gdb) bt
#0 0xc0000000002e4790:0 in wcstombs+0x790 () from /usr/lib/hpux64/libc.so.1
#1 0xc000000000333a20:0 in T_19_462b_cl___doprnt_main+0x4b20 ()
from /usr/lib/hpux64/libc.so.1
#2 0xc000000000326bd0:0 in _doprnt+0x30 () from /usr/lib/hpux64/libc.so.1
#3 0xc00000000034c2f0:0 in vsnprintf+0x90 () from /usr/lib/hpux64/libc.so.1
#4 0xc0000000002d4fb0:0 in syslog+0x3d0 () from /usr/lib/hpux64/libc.so.1
#5 0x400000000000a320:0 in log_master_data (
tty=0x87ffffffffffe820 "/dev/pts/10", ufrom=0x6000000000004a50 "andrin",
uto=0x6000000000004650 "andrin",
iobuf_p=0x87ffffffffffec10 "\r\e[A {\e[B\n\b\e[Amess \"Kan ej h\344mta in tidsuppgifter.\";\e[B\n\r\e[A ERR=1;\e[B\n\r\e[A }\e[B\n\r\e[Aexport YEAR MON MDAY HOUR MIN SEC YDAY IMON WDAY WNO\e[B\n\r\e[A#\e[B\n\b\e[A# Sista arbetsdagen i m\345naden.\e[B\n\r\e[A#\e[B\n\b\e["..., num=849) at sudosh.c:679
#6 0x4000000000006bb0:0 in main (argc=1, argv=0x87fffffffffff7c0,
environ=0x87fffffffffff7d0) at sudosh.c:380
(gdb) q
The program calls syslog(), but as you can see, there a few calls within libc after that.
I have tried building the program as a 32-bit binary, as well as a 64-bit binary, but it still receives SIGBUS/BUS_ADRALN when running wcstombs().