#615: macruby segfaults when generating large random numbers -------------------------------+-------------------------------------------- Reporter: ahob...@… | Owner: lsansone...@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: rand bignum -------------------------------+--------------------------------------------
Comment(by ahob...@…): I just noticed that assigning to a variable seems to affect the behavior if I generate a smaller number. {{{ # notice no crash! % macruby -e 'x=rand(2**1024)' # but this does crash % macruby -e 'x=rand(2**1024);puts x' unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macruby -e 'x=rand(2**1024);puts x' # maybe we just got lucky before? % macruby -e 'x=rand(2**1024)' % macruby -e 'x=rand(2**1024)' % macruby -e 'x=rand(2**1024)' # doesn't seem like it. But generating a larger random number always seems to crash % macruby -e 'x=rand(2**2048)' unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macruby -e 'x=rand(2**2048)' % macruby -e 'x=rand(2**2048)' unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macruby -e 'x=rand(2**2048)' # hmm, where does the problem seem to occur between 1024 and 2048? # 2**1472 seems to be reliably ok % macruby -e 'x=rand(2**1472)' % macruby -e 'x=rand(2**1472)' % macruby -e 'x=rand(2**1472)' # but 2**1473 seems to reliably crash % macruby -e 'x=rand(2**1473)' unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macruby -e 'x=rand(2**1473)' }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/615#comment:3> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel