Bug #3742

failed to allocate memory: /^()(?>\g<1>)*$/ on x64-mswin64

Added by shintaro kuwamoto over 3 years ago. Updated almost 3 years ago.

[ruby-dev:42133]
Status:Closed
Priority:Normal
Assignee:Yui NARUSE
Category:core
Target version:1.9.3
ruby -v:ruby 1.9.3dev (2010-08-25 trunk 29091) [x64-mswin64_90] Backport:

Description

=begin
http://redmine.ruby-lang.org/issues/show/3459 の続きです。
SEGVするのはr29074で修正していただいたので、そもそもの原因であるメモリ確保失敗のチケットを作っておきます。

Z:\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.292000 seconds.

1) Failure:
testdupwarn(TestRegexp) [Z:/trunk/test/ruby/testregexp.rb:828]:
<[]> expected but was
<["<internal:gem
prelude>:50: warning: assigned but unused variable - paths",
"internal:gem_prelude:182: warning: assigned but unused variable - path",
"internal:gem_prelude:177: warning: assigned but unused variable - installed_
path",
"internal:gem_prelude:122: warning: assigned but unused variable - verbose",
"internal:gem_prelude:122: warning: assigned but unused variable - debug",
"internal:gem_prelude:232: warning: assigned but unused variable - e",
"internal:lib/rubygems/defaults:54: warning: assigned but unused variable - e
xecformat",
"<internal:lib/rubygems/custom
require>:30: warning: assigned but unused variab
le - load_error"]>.

2) Error:
testexec(TestRegexp):
RegexpError: failed to allocate memory: /(?>\g)*$/
Z:/trunk/test/ruby/test
regexp.rb:500:in block in check'
Z:/trunk/test/ruby/test_regexp.rb:498:in
each'
Z:/trunk/test/ruby/testregexp.rb:498:in check'
Z:/trunk/test/ruby/test_regexp.rb:569:in
test
exec'
../test/runner.rb:26:in `'

68 tests, 1005 assertions, 1 failures, 1 errors, 0 skips

Test run options: --seed 9589
NMAKE : fatal error U1077: '.\ruby.exe' : リターン コード '0x2'
Stop.
=end


Related issues

Related to ruby-trunk - Bug #3459: test_regexp.rb Segmentation fault on x64-mswin64 Closed 06/21/2010
Related to Backport92 - Backport #3743: Segmentation fault on TestRegexp#test_exec Closed 08/25/2010

History

#1 Updated by shintaro kuwamoto over 3 years ago

=begin
次のパッチでテスト通るようになりました。

Index: ../regint.h
===================================================================
--- ../regint.h (リビジョン 29091)
+++ ../regint.h (作業コピー)
@@ -720,7 +720,7 @@
BBuf* mbuf; /* multi-byte info or NULL */
} CClassNode;

-typedef long OnigStackIndex;
+typedef SIGNED_VALUE OnigStackIndex;

typedef struct _OnigStackType {
unsigned int type;

Z:\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........................................................
Finished in 0.275000 seconds.

1) Failure:
testdupwarn(TestRegexp) [Z:/trunk/test/ruby/testregexp.rb:828]:
<[]> expected but was
<["<internal:gem
prelude>:50: warning: assigned but unused variable - paths",
"internal:gem_prelude:182: warning: assigned but unused variable - path",
"internal:gem_prelude:177: warning: assigned but unused variable - installed_
path",
"internal:gem_prelude:122: warning: assigned but unused variable - verbose",
"internal:gem_prelude:122: warning: assigned but unused variable - debug",
"internal:gem_prelude:232: warning: assigned but unused variable - e",
"internal:lib/rubygems/defaults:54: warning: assigned but unused variable - e
xecformat",
"<internal:lib/rubygems/custom
require>:30: warning: assigned but unused variab
le - load_error"]>.

68 tests, 1072 assertions, 1 failures, 0 errors, 0 skips

Test run options: --seed 23864
NMAKE : fatal error U1077: '.\ruby.exe' : リターン コード '0x1'
Stop.
=end

#2 Updated by Usaku NAKAMURA over 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Yui NARUSE

=begin

=end

#3 Updated by Yui NARUSE over 3 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29102.
shintaro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

#4 Updated by Yui NARUSE over 3 years ago

=begin
追跡ありがとうございます。
regint.hはオリジナルの鬼車由来の部分だったので、intptr_t でコミットしました。

で、このバグはオリジナルの鬼車にも影響するので、うちの日記 http://d.hatena.ne.jp/nurse/あたりに
他の 5.9.2 に対する修正とともにまとめようと思っているのですが、
このパッチのライセンスは Ruby's or 鬼車のライセンスとしてよいでしょうか。
=end

#5 Updated by shintaro kuwamoto over 3 years ago

=begin

このパッチのライセンスは Ruby's or 鬼車のライセンスとしてよいでしょうか。

はい、Ruby's or 鬼車のライセンスでお願いします。
そのうちr29074含めて1.9.2にもバックポートしていただけると助かります。
=end

#6 Updated by Yui NARUSE over 3 years ago

=begin

このパッチのライセンスは Ruby's or 鬼車のライセンスとしてよいでしょうか。

はい、Ruby's or 鬼車のライセンスでお願いします。

ありがとうございます。

そのうちr29074含めて1.9.2にもバックポートしていただけると助かります。

ちょうどタイミングよく同じ問題を訴えてきた人がいたので、Backport #3743 というチケットにしています。
yugui さんよろしぅ
=end

Also available in: Atom PDF