Project

General

Profile

Actions

Bug #5170

closed

Date.strptime Segmentation Fault

Added by cfis (Charlie Savage) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]
Backport:
[ruby-core:38855]

Description

require 'date'
Date.strptime('01-31-2011', '%m/%d/%Y')

This happens on Mingw:

ruby 1.9.3dev (2011-07-28 revision 32716) [i386-mingw32]

It also happens on Linux:

ruby 1.9.3dev (2011-07-31 revision 32789) [x86_64-linux]

This is pretty high priority for us because we need to now use Date.strptime since Date.parse no longer handles US style dates correctly.


D:/zerista/app.git/test_dates.rb:3: [BUG] Segmentation fault
ruby 1.9.3dev (2011-07-28 revision 32716) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :strptime
c:0003 p:0031 s:0006 b:0006 l:0026d4 d:0016a4 EVAL D:/zerista/app.git/test_dates.rb:3
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0026d4 d:0026d4 TOP

-- Ruby level backtrace information ----------------------------------------
D:/zerista/app.git/test_dates.rb:3:in <main>' D:/zerista/app.git/test_dates.rb:3:in strptime'

-- C level backtrace information -------------------------------------------
C:\Windows\SysWOW64\ntdll.dll(NtWaitForSingleObject+0x15) [0x776bf861]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObjectEx+0x43) [0x76361184]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObject+0x12) [0x76361138]
C:\MinGW\local\ruby193\bin\msvcrt-ruby191.dll(rb_vm_bugreport+0xef) [0x62e7156f]
C:\MinGW\local\ruby193\bin\msvcrt-ruby191.dll(rb_warning+0x1d0) [0x62d3c570]
C:\MinGW\local\ruby193\bin\msvcrt-ruby191.dll(rb_bug+0x29) [0x62d3c5b9]
C:\MinGW\local\ruby193\bin\msvcrt-ruby191.dll(rb_get_next_signal+0xaf) [0x62dfadcf]
[0x00401262]
C:\Windows\syswow64\kernel32.dll(CheckForReadOnlyResource+0x3bf) [0x76389d77]
C:\Windows\SysWOW64\ntdll.dll(RtlKnownExceptionFilter+0xb7) [0x77710df7]

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

  • Loaded script: D:/zerista/app.git/test_dates.rb

  • Loaded features:

    0 enumerator.so
    1 C:/MinGW/local/ruby193/lib/ruby/1.9.1/i386-mingw32/enc/encdb.so
    2 C:/MinGW/local/ruby193/lib/ruby/1.9.1/i386-mingw32/enc/iso_8859_1.so
    3 C:/MinGW/local/ruby193/lib/ruby/1.9.1/i386-mingw32/enc/trans/transdb.so
    4 C:/MinGW/local/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb
    5 C:/MinGW/local/ruby193/lib/ruby/1.9.1/i386-mingw32/rbconfig.rb
    6 C:/MinGW/local/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb
    7 C:/MinGW/local/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb
    8 C:/MinGW/local/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
    9 C:/MinGW/local/ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb
    10 C:/Users/cfis/.netbeans/6.9/sync-stdio.rb
    11 C:/MinGW/local/ruby193/lib/ruby/site_ruby/1.9.1/ubygems.rb
    12 C:/MinGW/local/ruby193/lib/ruby/1.9.1/i386-mingw32/date_core.so
    13 C:/MinGW/local/ruby193/lib/ruby/1.9.1/date/format.rb
    14 C:/MinGW/local/ruby193/lib/ruby/1.9.1/date.rb

[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.


Files

Updated by normalperson (Eric Wong) over 13 years ago

I can reproduce this on trunk with x86_64, too. The attached patch should fix it.

For git users against trunk (trivial cherry-pick applies to the 1.9.3 branch, too):
git pull git://bogomips.org/ruby date-segfault-bug-5170

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

  • Assignee set to tadf (tadayoshi funaba)

DateTime also seems have same issue.

Updated by tadf (tadayoshi funaba) over 13 years ago

  • Status changed from Open to Closed
  • Priority changed from 5 to Normal
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0