On Fri, Oct 16, 2015 at 3:08 PM, Rainer Jung <rainer.j...@kippdata.de> wrote: > Am 16.10.2015 um 14:56 schrieb Yann Ylavic: >> >> On Fri, Oct 16, 2015 at 2:48 PM, Yann Ylavic <ylavic....@gmail.com> wrote: >>> >>> On Fri, Oct 16, 2015 at 2:35 PM, Rainer Jung <rainer.j...@kippdata.de> >>> wrote: >>>> >>>> >>>> I didn't yet have the time to reproduce and test your patch, but the >>>> APR_ALIGN((size),sizeof(void *)) align approach would not work. The >>>> problem >>>> here is that even or especially when building for 32 Bits and then using >>>> a >>>> 64 Bit data type, the alignment fails. So the pointer size would be 4 >>>> here, >>>> but the requirement alignment 8 bytes. >>> >>> >>> Hm, correct, each integral type (greater than the word) needs be >>> aligned on its size! >> >> >> Though the issue here is not accessing the type as an integral, so >> aligning on 4 bytes (for 32 bit hardware) should enough for accessing >> each scoreborad entry/struct (the members of the structs themselves >> will still be aligned according to their type, so they can also be >> safely accessed). > > > Wasn't the bus error occuring in > > ws->last_used = apr_time_now(); > > and the address is > > (dbx) print &(ws->last_used) > &ws->last_used = 0xffffffff7bb00094 > > not divisible by 8 although the data type (not pointer size) is 64 Bit.
Yes but ws itself isn't aligned either: (dbx) print ws ws = 0xffffffff7bb00044 which is IMHO the issue. Align ws and everything goes well (at least I think :p ). Regards, Yann.