Actions
Bug #10088
closedBus Error on Sparc Solaris since r46884
Description
Since r46884, bus error occurred on Sparc64.
PACKED_STRUCT_UNALIGNED generally should always be used, and PACKED_STRUCT generally should never be used unless it is really needed.
I think existence of both PACKED_STRUCT and PACKED_STRUCT_UNALIGNED is confusable and can always be a potential source of bugs.
dtrace -G -C -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -s ./probes.d -o probes.o array.o eval.o gc.o hash.o load.o object.o parse.o string.o symbol.o vm.o
cc -g3 -xO1 -xtarget=sparc64viiplus -m64 -L. -L/usr/local/64/lib -R/usr/local/64/lib main.o dmydln.o miniinit.o miniprelude.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o encoding.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o symbol.o time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o vm_backtrace.o vm_trace.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o sparc.o flock.o isinf.o setproctitle.o addr2line.o dmyext.o probes.o -lpthread -lrt -lgmp -lsocket -l
dl -lcrypt -lm -o miniruby
./miniruby -I./lib -I. -I.ext/common ./tool/mkconfig.rb -timestamp=.rbconfig.time \
-install_name=ruby \
-so_name=ruby rbconfig.rb
make: *** [.rbconfig.time] Bus Error
Updated by ngoto (Naohisa Goto) over 10 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r46925.
- include/ruby/io.h (struct rb_io_buffer_t): PACKED_STRUCT should not
be used for platform-specific optimization. PACKED_STRUCT_UNALIGNED
should be used. [ruby-core:63988] [Bug #10088]
Updated by normalperson (Eric Wong) over 10 years ago
Thank you for the catch and explanation!
I mistakenly believed it was safe with 32-bit types :x
Updated by ngoto (Naohisa Goto) over 10 years ago
- Related to Feature #10050: [PATCH 0/2] reduce rb_io_t to 192 bytes (from 216) on 64-bit added
Actions
Like0
Like0Like0Like0