4 ms·
Ah, yes. BUS ERROR: http://blog.jgc.org/2007/04/debugging-solaris-bus-error-caused-by.html http://blog.jgc.org/2007/04/debugging-solaris-bus-error-caus...
by jgrahamc 10y ago
Ah, yes. BUS ERROR: http://blog.jgc.org/2007/04/debugging-solaris-bus-error-caused-by.html http://blog.jgc.org/2007/04/debugging-solaris-bus-error-caus...
- bogomipz 10y agoJohn Graham-Cumming that blog's author seems like an interesting guy, he's started something called 'Plan 28' to faithfully build Charles Babbage's Analytical Engine. He also wrote the Geek Atlas. Blast form the past, I remember Bus Errors from Solaris days.
- jgrahamc 10y agoThat would be me.
- Roboprog 10y agoUsing a byte array and manually marshalling stuff in and out is tedious, but it does avoid alignment issues. There's a certain amount of irony that dynamic languages (e.g. Perl) make it easier to implement something like "pack" and "unpack" to move values in and out of such a byte array, due to the variable type arguments/results of the "unpacked" values.
- Roboprog 10y agoOtherwise, I assume that avoiding this problem is a matter of putting the larger elements at the start of the struct, and the smaller elements at the end (with the exception that for a nested array, you consider the element size, not the total array) 8 byte entries, then 4 byte entries, 2 byte entries, chars/bytes, bits.