Bug #4310

String#% cause Segmentation fault on Windows

Added by Heesob Park almost 5 years ago. Updated over 4 years ago.

Assignee:Nobuyoshi Nakada
ruby -v:ruby 1.9.3dev (2011-01-23 trunk 30640) [i386-mswin32_90] Backport:


String#% cause Segmentation fault on Windows with trunk version in case of long string.

C:\work>ruby -ve 'p "%f"%("a"*10000000)'
ruby 1.9.3dev (2011-01-23 trunk 30640) [i386-mswin32_90]
-e:1: [BUG] Segmentation fault
ruby 1.9.3dev (2011-01-23 trunk 30640) [i386-mswin32_90]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :%
c:0003 p:0015 s:0007 b:0006 l:00065c d:001af4 EVAL -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00065c d:00065c TOP

-- Ruby level backtrace information ----------------------------------------
-e:1:in <main>'

-- C level backtrace information -------------------------------------------
C:\WINDOWS\system32\ntdll.dll(KiFastSystemCallRet+0x0) [0x7C93E514]
C:\WINDOWS\system32\kernel32.dll(WaitForSingleObject+0x12) [0x7C7D2542]
c:\usr\bin\msvcr90-ruby191.dll(rb_vm_bugreport+0x95) [0x100919BB] c:\work\snapsh
c:\usr\bin\msvcr90-ruby191.dll(report_bug+0xcb) [0x10029F67] c:\work\snapshot\er
c:\usr\bin\msvcr90-ruby191.dll(rb_bug+0x1c) [0x10029F9D] c:\work\snapshot\error.
c:\usr\bin\msvcr90-ruby191.dll(sigsegv+0x3f) [0x1004F7A8] c:\work\snapshot\signa
89290f\MSVCR90.dll(XcptFilter+0x151) [0x7858D0B9]
c:\usr\bin\ruby.exe(_tmainCRTStartup+0x137) [0x004011D6] f:\dd\vctools\crt_bld\
89290f\MSVCR90.dll(seh_longjmp_unwind4+0x2e) [0x7858F8F4]

-- Other runtime information -----------------------------------------------

  • Loaded script: -e

  • Loaded features:

    0 enumerator.so
    1 c:/usr/lib/ruby/1.9.1/i386-mswin32_90/enc/encdb.so
    2 c:/usr/lib/ruby/1.9.1/i386-mswin32_90/enc/cp949.so
    3 c:/usr/lib/ruby/1.9.1/i386-mswin32_90/enc/trans/transdb.so
    4 c:/usr/lib/ruby/1.9.1/rubygems/defaults.rb
    5 c:/usr/lib/ruby/1.9.1/i386-mswin32_90/rbconfig.rb
    6 c:/usr/lib/ruby/1.9.1/thread.rb
    7 c:/usr/lib/ruby/1.9.1/rubygems/exceptions.rb
    8 c:/usr/lib/ruby/1.9.1/rubygems/custom_require.rb
    9 c:/usr/lib/ruby/1.9.1/rubygems.rb
    10 c:/usr/lib/ruby/1.9.1/ubygems.rb

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.


#1 Updated by Yuki Sonoda almost 5 years ago

  • Assignee set to Nobuyoshi Nakada



#2 Updated by Nobuyoshi Nakada almost 5 years ago

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

This issue was solved with changeset r30641.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

  • error.c (rb_invalid_str): prevent intermediate variable from GC. =end

Also available in: Atom PDF