Project

General

Profile

Actions

Bug #18392

closed

ObjectSpace::WeakMap#inspect causes BUG

Added by ko1 (Koichi Sasada) 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-11-05T14:20:50Z master 907aa47527) [x64-mswin64_140]
[ruby-core:106528]

Description

wmap = ObjectSpace::WeakMap.new

(2**32).times do |i|
  wmap[i] = "foo"
  wmap.inspect
end
t.rb:6: [BUG] Segmentation fault
ruby 3.1.0dev (2021-11-05T14:20:50Z master 907aa47527) [x64-mswin64_140]

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0019 e:000018 CFUNC  :inspect
c:0004 p:0013 s:0015 e:000014 BLOCK  t.rb:6 [FINISH]
c:0003 p:---- s:0011 e:000010 CFUNC  :times
c:000 __ 2 p:0026 s:0007 E:000a58 EVAL   t.rb:4 [FINISH]
c:0001 p:0000 s:0003 E:0010f0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
t.rb:4:in `<main>'
t.rb:4:in `times'
t.rb:6:in `block in <main>'
t.rb:6:in `inspect'

-- C level backtrace information -------------------------------------------
C:\WINDOWS\SYSTEM32\ntdll.dll(NtWaitForSingleObject+0x14) [0x00007FFB4A4CCDF4]
C:\WINDOWS\System32\KERNELBASE.dll(WaitForSingleObjectEx+0x8e) [0x00007FFB47E11A5E]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_print_backtrace+0x34) [0x00007FFAFE6EBEE4]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_vm_bugreport+0x12a) [0x00007FFAFE6EC016]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_bug_for_fatal_signal+0x65) [0x00007FFAFE612C41]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_signal_name+0x7c2) [0x00007FFAFE71F3FA]
C:\WINDOWS\System32\ucrtbase.dll(seh_filter_exe+0x235) [0x00007FFB483C0EF5]
 [0x00007FF65F501BAC]
C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll(_C_specific_handler+0xa0) [0x00007FFAEB11ECD0]
C:\WINDOWS\SYSTEM32\ntdll.dll(_chkstk+0x11f) [0x00007FFB4A4D20CF]
C:\WINDOWS\SYSTEM32\ntdll.dll(RtlRaiseException+0x434) [0x00007FFB4A481454]
C:\WINDOWS\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x2e) [0x00007FFB4A4D0BFE]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_to_symbol_type+0xaec) [0x00007FFAFE666880]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_set_class_path_string+0xc5) [0x00007FFAFE66B395]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_class_path+0x15) [0x00007FFAFE6685C1]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_any_to_s+0x6e) [0x00007FFAFE6068A2]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(vfprintf+0x8d8) [0x00007FFAFE5F44DC]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_st_values_check+0x469) [0x00007FFAFE64D851]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_st_foreach+0x26) [0x00007FFAFE64C406]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(vfprintf+0x747) [0x00007FFAFE5F434B]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0x27e6) [0x00007FFAFE62753E]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0xc3fb) [0x00007FFAFE631153]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0x7466) [0x00007FFAFE62C1BE]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_vm_exec+0x152) [0x00007FFAFE622D4A]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_eval_string+0xe35) [0x00007FFAFE61A845]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_yield+0x99) [0x00007FFAFE624161]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_yield+0x24) [0x00007FFAFE6240EC]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_strtoul+0x4863) [0x00007FFAFE6BD827]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0x27e6) [0x00007FFAFE62753E]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0x37c2) [0x00007FFAFE62851A]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0x32fc) [0x00007FFAFE628054]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0xc3fb) [0x00007FFAFE631153]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_vm_special_exception_copy+0x7466) [0x00007FFAFE62C1BE]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_vm_exec+0x152) [0x00007FFAFE622D4A]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(rb_ec_error_print+0x50f) [0x00007FFAFE60C523]
c:\ko1\ruby\v3\install\master\bin\x64-vcruntime140-ruby310.dll(ruby_run_node+0x4b) [0x00007FFAFE60EC5B]
 [0x00007FF65F501056]
 [0x00007FF65F501270]
C:\WINDOWS\System32\KERNEL32.DLL(BaseThreadInitThunk+0x14) [0x00007FFB4A2E7034]
Actions #1

Updated by nobu (Nobuyoshi Nakada) 5 months ago

  • Backport changed from 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN to 2.6: DONTNEED, 2.7: REQUIRED, 3.0: REQUIRED
Actions #2

Updated by nobu (Nobuyoshi Nakada) 5 months ago

  • Status changed from Assigned to Closed

Applied in changeset git|d6c5a30cfdf658280338dbb8c8b17fab3190b928.


ObjectSpace::WeakMap#inspect: check if living object [Bug #18392]

Updated by usa (Usaku NAKAMURA) 5 months ago

  • Backport changed from 2.6: DONTNEED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: DONTNEED, 2.7: DONE, 3.0: REQUIRED

ruby_2_7 836aca4fee4d27a55d56044620a00866a2c279ef merged revision(s) a2d4e1cda68a49980a4f9f353f400efbde7e7884,d6c5a30cfdf658280338dbb8c8b17fab3190b928.

Updated by nagachika (Tomoyuki Chikanaga) 2 months ago

  • Backport changed from 2.6: DONTNEED, 2.7: DONE, 3.0: REQUIRED to 2.6: DONTNEED, 2.7: DONE, 3.0: DONE

ruby_3_0 f2d996dcff56057b48ae41ab6f23e7654848ea4b merged revision(s) d6c5a30cfdf658280338dbb8c8b17fab3190b928,a2d4e1cda68a49980a4f9f353f400efbde7e7884.

Actions

Also available in: Atom PDF