From: "MSP-Greg (Greg L)" Date: 2022-06-30T21:20:04+00:00 Subject: [ruby-core:109107] [Ruby master Bug#18794] Windows ucrt - intermittent SEGV TestObjSpace#test_reachable_objects_during_iteration Issue #18794 has been updated by MSP-Greg (Greg L). This test is still causing intermittent failures. I tried it locally, and (of course) it did not SEGV. I modified the test as below: test/objspacetest_objspace.rb Original: ```ruby def test_reachable_objects_during_iteration opts = %w[--disable=gems,frozen-string-literal -robjspace] assert_separately opts, "#{<<-"begin;"}\n#{<<-'end;'}" begin; ObjectSpace.each_object{|o| o.inspect ObjectSpace.reachable_objects_from(Class) } end; end ``` Modified: ```ruby def test_reachable_objects_during_iteration opts = %w[--disable=gems,frozen-string-literal -robjspace] assert_separately opts, "#{<<-"begin;"}\n#{<<-'end;'}" begin; ObjectSpace.each_object{|o| STDOUT.syswrite "\n#{o.class}" # added this line o.inspect ObjectSpace.reachable_objects_from(Class) } end; end ``` All three Windows builds failed with the following error: ``` 1) Error: TestObjSpace#test_reachable_objects_during_iteration: NoMethodError: undefined method `unpack1' for nil:NilClass C:/Greg/GitHub/ruby/test/objspace/test_objspace.rb:145:in `test_reachable_objects_during_iteration' ``` ruby -v: ruby 3.2.0dev (2022-06-30T16:45:39Z master 5df20a5da5) [x64-mingw32] ruby 3.2.0dev (2022-06-30T16:45:39Z master 5df20a5da5) [x64-mswin64_140] ruby 3.2.0dev (2022-06-30T16:45:39Z master 5df20a5da5) [x64-mingw-ucrt] But, using WLS2/Ubuntu 22.04, about 7k object classes were logged. ruby 3.2.0dev (2022-06-30T16:45:39Z master 5df20a5da5) [x86_64-linux] Not sure if this helps, but it seems odd... ---------------------------------------- Bug #18794: Windows ucrt - intermittent SEGV TestObjSpace#test_reachable_objects_during_iteration https://bugs.ruby-lang.org/issues/18794#change-98253 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0dev (2022-05-20T15:42:07Z master 11336c7ddb) [x64-mingw-ucrt] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Test runs in retry, generates the following (removed path from x64-ucrt-ruby320.dll). mswin build runs it as a single test, I don't believe it's failed. ``` 1) Failure: TestObjSpace#test_reachable_objects_during_iteration Line: 145 assert_separately failed with error message pid 70572 exit 3 | -:8: [BUG] Unnormalized Fixnum value 0x0000023f8eeb2119 | ruby 3.2.0dev (2022-05-20T15:42:07Z master 11336c7ddb) [x64-mingw-ucrt] | | -- Control frame information ----------------------------------------------- | c:0006 p:---- s:0021 e:000020 CFUNC :to_s | c:0005 p:---- s:0018 e:000017 CFUNC :inspect | c:0004 p:0004 s:0014 e:000013 BLOCK -:8 [FINISH] | c:0003 p:---- s:0010 e:000009 CFUNC :each_object | c:0002 p:0073 s:0006 e:000005 EVAL -:7 [FINISH] | c:0001 p:0000 s:0003 E:002060 (none) [FINISH] | | -- Ruby level backtrace information ---------------------------------------- | -:7:in `
' | -:7:in `each_object' | -:8:in `block in
' | -:8:in `inspect' | -:8:in `to_s' | | -- C level backtrace information ------------------------------------------- | C:\Windows\SYSTEM32\ntdll.dll(NtWaitForSingleObject+0x14) [0x00007ffbdb40ef74] | C:\Windows\System32\KERNELBASE.dll(WaitForSingleObjectEx+0x8e) [0x00007ffbd89fe7ae] | x64-ucrt-ruby320.dll(rb_vm_bugreport+0x313) [0x00007ffba62417c3] | x64-ucrt-ruby320.dll(rb_bug_without_die+0x75) [0x00007ffba6039d15] | x64-ucrt-ruby320.dll(rb_bug+0x33) [0x00007ffba626e014] | x64-ucrt-ruby320.dll(rb_out_of_int+0x42) [0x00007ffba626f81b] | x64-ucrt-ruby320.dll(rb_vm_invoke_proc+0x22c) [0x00007ffba622c34c] | x64-ucrt-ruby320.dll(rb_eval_cmd_kw+0x5ea) [0x00007ffba6230e7a] | x64-ucrt-ruby320.dll(rb_funcallv+0x11) [0x00007ffba62310c1] | x64-ucrt-ruby320.dll(rb_inspect+0x17) [0x00007ffba60f9417] | x64-ucrt-ruby320.dll(rb_hash_values+0xfc1) [0x00007ffba606e791] | x64-ucrt-ruby320.dll(rb_hash_values+0x102c) [0x00007ffba606e7fc] | x64-ucrt-ruby320.dll(rb_st_foreach_check+0x77) [0x00007ffba61a1637] | x64-ucrt-ruby320.dll(rb_hash_set_default_proc+0x1e19) [0x00007ffba60724a9] | x64-ucrt-ruby320.dll(rb_ensure+0x18f) [0x00007ffba60453af] | x64-ucrt-ruby320.dll(rb_hash_set_default_proc+0x2272) [0x00007ffba6072902] | x64-ucrt-ruby320.dll(rb_hash_aset+0x1d1f) [0x00007ffba6077c2f] | x64-ucrt-ruby320.dll(rb_mutex_trylock+0x51c) [0x00007ffba61d864c] | x64-ucrt-ruby320.dll(rb_exec_recursive+0x17) [0x00007ffba61e0217] | x64-ucrt-ruby320.dll(rb_error_arity+0x26e) [0x00007ffba62182ee] | x64-ucrt-ruby320.dll(rb_vm_call_with_refinements+0x47d) [0x00007ffba6233fed] | x64-ucrt-ruby320.dll(rb_vm_exec+0x255) [0x00007ffba62252a5] | x64-ucrt-ruby320.dll(rb_yield+0x1e8) [0x00007ffba622ac88] | x64-ucrt-ruby320.dll(rb_obj_id+0x1c94) [0x00007ffba6057024] | x64-ucrt-ruby320.dll(rb_size_mul_or_raise+0x154) [0x00007ffba605c464] | x64-ucrt-ruby320.dll(rb_ensure+0x18f) [0x00007ffba60453af] | x64-ucrt-ruby320.dll(rb_objspace_each_objects_without_setup+0x1ac) [0x00007ffba606562c] | x64-ucrt-ruby320.dll(rb_error_arity+0x26e) [0x00007ffba62182ee] | x64-ucrt-ruby320.dll(rb_vm_search_method_slowpath+0x723) [0x00007ffba621ce33] | x64-ucrt-ruby320.dll(rb_vm_call_with_refinements+0x4e8) [0x00007ffba6234058] | x64-ucrt-ruby320.dll(rb_vm_exec+0x255) [0x00007ffba62252a5] | x64-ucrt-ruby320.dll(rb_call_end_proc+0x130) [0x00007ffba603e400] | x64-ucrt-ruby320.dll(ruby_run_node+0xa5) [0x00007ffba6044145] | [0x00007ff62fcc15a8] | [0x00007ff62fcc13b1] | [0x00007ff62fcc14e6] | C:\Windows\System32\KERNEL32.DLL(BaseThreadInitThunk+0x10) [0x00007ffbd93c4ed0] ``` -- https://bugs.ruby-lang.org/ Unsubscribe: