[Bug #3459] test_regexp.rb Segmentation fault on x64-mswin64

Bug #3459: test_regexp.rb Segmentation fault on x64-mswin64
http://redmine.ruby-lang.org/issues/show/3459

e$B5/I<<Te(B: sakiyama shin
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: core, Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2010-06-20 trunk 28366) [x64-mswin64_90]

x64-mswin64 trunke$B$Ne(Btest_regexp.rbe$B$Ge(BSegmentation fault
e$B$7$^$9!#e(B
e$B:,K\E*$J860x$Oe(B/^()(?>\g<1>)*$/e$B$N%a%b%j3NJ]$K<:GT$9$k$?$a$N$h$&$G$9!#e(B
Segfaulte$B<+BN$O0J2<$N=$@5$G=P$J$/$J$j$^$9!#e(B

Z:\ruby-trunk>svn diff re.c
Index: re.c

— re.c (e$B%j%S%8%g%se(B 28367)
+++ re.c (e$B:n6H%3%T!<e(B)
@@ -1391,7 +1391,7 @@
else {
onig_errmsg_buffer err = “”;
onig_error_code_to_str((UChar*)err, (int)result);

  •       rb_reg_raise(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), err, 
    

0);

  •       rb_reg_raise(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), err, 
    

re);
}
}

e$B=$@5A0$N%(%i!<%m%0$H!"=$@58e$N%(%i!<%m%0$G$9!#e(B

Z:\ruby-trunk\build>nmake test-all TESTS=ruby/test_regexp.rb

Microsoft(R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

    .\ruby.exe -I../lib -I".ext/x64-mswin64_90" "../tool/runruby.rb" 

–extou
t=“.ext” – “…/test/runner.rb” ruby/test_regexp.rb
Loaded suite …/test/runner
Started
…F…Z:/ruby-trunk/lib/minitest/unit.rb:176: [BUG] Segmentation
fault
ruby 1.9.3dev (2010-06-20 trunk 28366) [x64-mswin64_90]

– control frame ----------
c:0019 p:---- s:0075 b:0075 l:000074 d:000074 CFUNC :=~
c:0018 p:0104 s:0071 b:0070 l:0002a0 d:0002a0 METHOD
Z:/ruby-trunk/lib/minitest/
unit.rb:176
c:0017 p:0036 s:0064 b:0064 l:000053 d:000063 BLOCK
Z:/ruby-trunk/test/ruby/tes
t_regexp.rb:495
c:0016 p:---- s:0059 b:0059 l:000058 d:000058 FINISH
c:0015 p:---- s:0057 b:0057 l:000056 d:000056 CFUNC :each
c:0014 p:0077 s:0054 b:0054 l:000053 d:000053 METHOD
Z:/ruby-trunk/test/ruby/tes
t_regexp.rb:493
c:0013 p:0537 s:0048 b:0048 l:000047 d:000047 METHOD
Z:/ruby-trunk/test/ruby/tes
t_regexp.rb:564
c:0012 p:0063 s:0045 b:0045 l:000044 d:000044 METHOD
Z:/ruby-trunk/lib/minitest/
unit.rb:680
c:0011 p:0091 s:0039 b:0039 l:000020 d:000038 BLOCK
Z:/ruby-trunk/lib/minitest/
unit.rb:641
c:0010 p:---- s:0034 b:0034 l:000033 d:000033 FINISH
c:0009 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC :each
c:0008 p:0026 s:0029 b:0029 l:000020 d:000028 BLOCK
Z:/ruby-trunk/lib/minitest/
unit.rb:635
c:0007 p:---- s:0026 b:0026 l:000025 d:000025 FINISH
c:0006 p:---- s:0024 b:0024 l:000023 d:000023 CFUNC :each
c:0005 p:0082 s:0021 b:0021 l:000020 d:000020 METHOD
Z:/ruby-trunk/lib/minitest/
unit.rb:634
c:0004 p:0188 s:0016 b:0016 l:000015 d:000015 METHOD
Z:/ruby-trunk/lib/minitest/
unit.rb:594
c:0003 p:0041 s:0007 b:0007 l:001f08 d:000006 BLOCK
Z:/ruby-trunk/lib/minitest/
unit.rb:492
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001628 d:001628 TOP

– Ruby level backtrace information

Z:/ruby-trunk/lib/minitest/unit.rb:492:in block in autorun' Z:/ruby-trunk/lib/minitest/unit.rb:594:in run’
Z:/ruby-trunk/lib/minitest/unit.rb:634:in run_test_suites' Z:/ruby-trunk/lib/minitest/unit.rb:634:in each’
Z:/ruby-trunk/lib/minitest/unit.rb:635:in block in run_test_suites' Z:/ruby-trunk/lib/minitest/unit.rb:635:in each’
Z:/ruby-trunk/lib/minitest/unit.rb:641:in block (2 levels) in run_test_suites' Z:/ruby-trunk/lib/minitest/unit.rb:680:in run’
Z:/ruby-trunk/test/ruby/test_regexp.rb:564:in test_exec' Z:/ruby-trunk/test/ruby/test_regexp.rb:493:in check’
Z:/ruby-trunk/test/ruby/test_regexp.rb:493:in each' Z:/ruby-trunk/test/ruby/test_regexp.rb:495:in block in check’
Z:/ruby-trunk/lib/minitest/unit.rb:176:in assert_match' Z:/ruby-trunk/lib/minitest/unit.rb:176:in =~’

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension
libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application’s support team for more information.
NMAKE : fatal error U1077: ‘.\ruby.exe’ : e$B%j%?!<%se(B e$B%3!<%Ie(B
‘0x3’
Stop.

e$B=$@58ee(B

Z:\ruby-trunk\build>nmake test-all TESTS=ruby/test_regexp.rb

Microsoft(R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

    .\ruby.exe -I../lib -I".ext/x64-mswin64_90" "../tool/runruby.rb" 

–extou
t=“.ext” – “…/test/runner.rb” ruby/test_regexp.rb
Loaded suite …/test/runner
Started
…F…E…
Finished in 3.853200 seconds.

  1. Failure:
    test_dup_warn(TestRegexp) [Z:/ruby-trunk/test/ruby/test_regexp.rb:822]:
    Expected /\A\z/ to match "internal:gem_prelude:45: warning: assigned
    but unuse
    d variable - paths\ninternal:gem_prelude:162: warning: assigned but
    unused var
    iable - path\ninternal:gem_prelude:172: warning: assigned but unused
    variable

66 tests, 999 assertions, 1 failures, 1 errors, 0 skips

Test run options: --seed 24382
NMAKE : fatal error U1077: ‘.\ruby.exe’ : e$B%j%?!<%se(B e$B%3!<%Ie(B
‘0x1’
Stop.