Ruby windows 下简单的 cglm 测试,有时正常有时异常,这让程序员如何对 ruby 有信心啊!

yxmmrwx · 2025年03月07日 · 最后由 davidgao 回复于 2025年03月10日 · 230 次阅读

求解

require "cglm" p CGLM::Mat4.new.transpose.to_a

正常时会输出:[0.0, 0.0, 0.0, 0.0]

异常时:

C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb:20: [BUG] Segmentation fault ruby 3.3.7 (2025-01-15 revision be31f993d7) [x64-mingw-ucrt]

-- Control frame information ----------------------------------------------- c:0006 p:---- s:0024 e:000023 CFUNC :initialize c:0005 p:---- s:0021 e:000020 CFUNC :new c:0004 p:0012 s:0016 E:002158 METHOD C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb:20 c:0003 p:0003 s:0011 e:000010 METHOD C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb:33 c:0002 p:0015 s:0007 e:000005 EVAL d:/DFTanRepository/Master/Tests/Ruby/CGLM/test2.rb:6 [FINISH] c:0001 p:0000 s:0003 E:0013e0 DUMMY [FINISH]

-- Ruby level backtrace information ---------------------------------------- d:/DFTanRepository/Master/Tests/Ruby/CGLM/test2.rb:6:in <main>' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb:33:into_a' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb:20:in to_enum' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb:20:innew' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb:20:in `initialize'

-- Threading information --------------------------------------------------- Total ractor count: 1 Ruby thread count for this ractor: 1

-- C level backtrace information ------------------------------------------- C:\Windows\SYSTEM32\ntdll.dll(NtWaitForSingleObject+0x14) [0x00007ff8e7e0cdf4] C:\Windows\System32\KERNELBASE.dll(WaitForSingleObjectEx+0x8e) [0x00007ff8e5b21a5e] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_vm_bugreport+0x1ce) [0x00007ff8a4d299de] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_bug_for_fatal_signal+0x91) [0x00007ff8a4b05df1] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_shape_memsize+0xab2) [0x00007ff8a4c6cef2] [0x00007ff6f0b51ee2] C:\Windows\System32\ucrtbase.dll(_C_specific_handler+0xa0) [0x00007ff8e5950e10] C:\Windows\SYSTEM32\ntdll.dll(_chkstk+0x11f) [0x00007ff8e7e120cf] C:\Windows\SYSTEM32\ntdll.dll(RtlRaiseException+0x434) [0x00007ff8e7dc1454] C:\Windows\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x2e) [0x00007ff8e7e10bfe] C:\Windows\SYSTEM32\ntdll.dll(RtlSizeHeap+0x10b) [0x00007ff8e7d9426b] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(ruby_xcalloc_body+0x7a) [0x00007ff8a4b3951a] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_data_typed_object_zalloc+0xc4) [0x00007ff8a4b39904] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_vm_make_proc_lambda+0x42) [0x00007ff8a4d059b2] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_nmin_run+0x45e7) [0x00007ff8a4afc217] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_vm_invoke_proc+0x1e5) [0x00007ff8a4d0fbe5] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_vm_invoke_proc+0x10b6) [0x00007ff8a4d10ab6] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_funcallv_kw+0x59) [0x00007ff8a4d12a69] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_obj_call_init_kw+0x5e) [0x00007ff8a4b11fce] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_class_new_instance_pass_kw+0x84) [0x00007ff8a4bb7df4] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_error_arity+0xe20) [0x00007ff8a4cfb470] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_vm_search_method_slowpath+0x5e7) [0x00007ff8a4d02037] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_ec_obj_respond_to+0x185c) [0x00007ff8a4d1a70c] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_vm_exec+0x223) [0x00007ff8a4d0b033] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(rb_call_end_proc+0x329) [0x00007ff8a4b0aba9] C:\Ruby33-x64\bin\x64-ucrt-ruby330.dll(ruby_run_node+0x90) [0x00007ff8a4b109d0] [0x00007ff6f0b514d3] [0x00007ff6f0b5131a] [0x00007ff6f0b51426] C:\Windows\System32\KERNEL32.DLL(BaseThreadInitThunk+0x14) [0x00007ff8e7927034]

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

  • Loaded script: d:/DFTanRepository/Master/Tests/Ruby/CGLM/test2.rb

  • Loaded features:

    0 enumerator.so 1 thread.rb 2 fiber.so 3 rational.so 4 complex.so 5 ruby2_keywords.rb 6 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/enc/encdb.so 7 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/enc/trans/transdb.so 8 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/enc/gbk.so 9 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/rbconfig.rb 10 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/compatibility.rb 11 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/defaults.rb 12 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/deprecate.rb 13 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/errors.rb 14 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/target_rbconfig.rb 15 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/unknown_command_spell_checker.rb 16 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/exceptions.rb 17 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/basic_specification.rb 18 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/stub_specification.rb 19 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/platform.rb 20 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/specification_record.rb 21 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/util/list.rb 22 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/version.rb 23 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/requirement.rb 24 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/specification.rb 25 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/ruby_installer/runtime/singleton.rb 26 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/ruby_installer/runtime.rb 27 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/ruby_installer/runtime/msys2_installation.rb 28 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/win32/dll_directory.so 29 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/ruby_installer/runtime/dll_directory.rb 30 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/enc/utf_16le.so 31 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/enc/trans/single_byte.so 32 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/enc/trans/utf_16_32.so 33 C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/defaults/operating_system.rb 34 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/util.rb 35 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/dependency.rb 36 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_gem.rb 37 C:/Ruby33-x64/lib/ruby/3.3.0/x64-mingw-ucrt/monitor.so 38 C:/Ruby33-x64/lib/ruby/3.3.0/monitor.rb 39 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems.rb 40 C:/Ruby33-x64/lib/ruby/3.3.0/bundled_gems.rb 41 C:/Ruby33-x64/lib/ruby/site_ruby/3.3.0/rubygems/path_support.rb 42 C:/Ruby33-x64/lib/ruby/3.3.0/error_highlight/version.rb 43 C:/Ruby33-x64/lib/ruby/3.3.0/error_highlight/base.rb 44 C:/Ruby33-x64/lib/ruby/3.3.0/error_highlight/formatter.rb 45 C:/Ruby33-x64/lib/ruby/3.3.0/error_highlight/core_ext.rb 46 C:/Ruby33-x64/lib/ruby/3.3.0/error_highlight.rb 47 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/version.rb 48 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/core_ext/name_error.rb 49 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/levenshtein.rb 50 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/jaro_winkler.rb 51 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checker.rb 52 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb 53 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb 54 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/name_error_checkers.rb 55 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/method_name_checker.rb 56 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/key_error_checker.rb 57 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/null_checker.rb 58 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/tree_spell_checker.rb 59 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/require_path_checker.rb 60 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/spell_checkers/pattern_key_name_checker.rb 61 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean/formatter.rb 62 C:/Ruby33-x64/lib/ruby/3.3.0/did_you_mean.rb 63 C:/Ruby33-x64/lib/ruby/3.3.0/syntax_suggest/core_ext.rb 64 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/version.rb 65 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/fiddle-1.1.6/lib/fiddle.so 66 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/fiddle-1.1.6/lib/fiddle/closure.rb 67 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/fiddle-1.1.6/lib/fiddle/function.rb 68 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/fiddle-1.1.6/lib/fiddle/version.rb 69 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/fiddle-1.1.6/lib/fiddle.rb 70 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/base.rb 71 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vector_type.rb 72 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/matrix_type.rb 73 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/aabb.rb 74 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vec3.rb 75 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/vec4.rb 76 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/mat3.rb 77 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/mat4.rb 78 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/quat.rb 79 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/frustum.rb 80 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/plane.rb 81 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm/cglm.so 82 C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/cglm-0.1.4/lib/cglm.rb

https://github.com/sinisterchipmunk/cglm-ruby/commits/master/

换 ruby 3.2 试试,看了一眼这个 gem 2022 年的时候可能适配的是 ruby 3.2,后面一直没更新,库的问题不用牵涉到语言。

再次回到了 Ruby 来写 Ruby on Rails,实实在在的感受到了社区的缩水,好多库都已经好久没更新了。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号