Closed carlocab closed 1 year ago
I tried this with Ruby installed by Homebrew but I couldn't reproduce this:
$ $(brew --prefix ruby)/bin/ruby -v /tmp/a.rb
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin20]
/usr/local/lib/Qt3DCore.framework/Qt3DCore
/usr/local/lib/Qt3DQuickAnimation.framework/Qt3DQuickAnimation
/usr/local/lib/Qt3DQuickExtras.framework/Qt3DQuickExtras
Could you also try with Ruby installed by Homebrew not rbenv?
This seems to affect some builds of Ruby 2.6 but is fixed in Ruby 3.0.
❯ ruby -v crash.rb
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin21]
/usr/local/lib/Qt3DCore.framework/Qt3DCore
/usr/local/lib/Qt3DQuickAnimation.framework/Qt3DQuickAnimation
/usr/local/lib/Qt3DQuickExtras.framework/Qt3DQuickExtras
I get the above output for Homebrew Ruby 3.0 and Ruby 3.0 installed via rbenv
.
This doesn't affect Homebrew Ruby 2.6:
❯ /usr/local/opt/ruby@2.6/bin/ruby -v crash.rb
ruby 2.6.8p205 (2021-07-07 revision 67951) [x86_64-darwin21]
/usr/local/Cellar/ruby@2.6/2.6.8/lib/ruby/2.6.0/rubygems/defaults/operating_system.rb:64: warning: method redefined; discarding old default_specifications_dir
/usr/local/Cellar/ruby@2.6/2.6.8/lib/ruby/2.6.0/rubygems/basic_specification.rb:37: warning: previous definition of default_specifications_dir was here
/usr/local/lib/Qt3DCore.framework/Qt3DCore
/usr/local/lib/Qt3DQuickAnimation.framework/Qt3DQuickAnimation
/usr/local/lib/Qt3DQuickExtras.framework/Qt3DQuickExtras
It does affect the Ruby provided with macOS, which comes with Fiddle.
Thanks for confirming this.
I can also confirmed that the system Ruby crashes:
$ ruby -v -r fiddle /tmp/a.rb
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
/usr/local/lib/Qt3DCore.framework/Qt3DCore
/usr/local/lib/Qt3DQuickAnimation.framework/Qt3DQuickAnimation
/usr/local/lib/Qt3DQuickExtras.framework/Qt3DQuickExtras
dyld: Assertion failed: (0 && "LoadedImage not found by num"), function findLoadedImage, file /System/Volumes/Data/SWE/macOS/BuildRoots/d7e177bcf5/Library/Caches/com.apple.xbs/Sources/libdyld/dyld-852.2/dyld3/ClosureBuilder.cpp, line 713.
[1] 25767 abort ruby -v -r fiddle /tmp/a.rb
I think that system trace log (strace
on Linux) will be useful to confirm difference with Ruby 3.0 and Ruby 2.6. It seems that we can use dtruss
for it on macOS (I'm not familiar with macOS) but I couldn't get it...:
$ sudo dtruss ruby /tmp/a.rb
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to execute ruby: (os/kern) failure
Could you get system trace logs for Ruby 2.6 and Ruby 3.0?
Stale.
I have Qt installed via Homebrew on macOS 12 (x86_64), and running the following script causes a segmentation fault (
ruby 2.6.8p205 (2021-07-07 revision 67951) [x86_64-darwin21]
installed viarbenv
, Fiddle 1.1.0 installed viagem
):Running
ruby crash.rb
produces the following output (truncated for brevity):The full output can be found here: output.txt The log referenced in the error message: crash.log.tar.gz
I can only produce the segfault when the
dylibs
array isdlopen
ed in the order given. Dropping one of them or reversing the array allows the script to run correctly.As a sanity check, I wrote what I think should be the equivalent program in C:
This runs without any problems: