Closed apjanke closed 5 years ago
Thanks for the bug report. This bug happened on Linux and Windows as well - different cures though. The betas for Shoes 3.3.8 now throw an exception.
I can confirm the fix. In 3.3.8 beta r3371, I now get this error when loading an invalid font file:
Error in <unknown> line 0 | 2019-05-27 17:57:05 -0400
Font "media/fonts/LICENSE.md" not found
/Users/janke/local/repos/peaksprints/lib/setup.rb:148:in `font'
/Users/janke/local/repos/peaksprints/lib/setup.rb:148:in `block in <top (required)>'
/Users/janke/local/repos/peaksprints/lib/setup.rb:146:in `each'
/Users/janke/local/repos/peaksprints/lib/setup.rb:146:in `<top (required)>'
/Applications/Shoes-3.3.8-beta-r3371.app/Contents/MacOS/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Applications/Shoes-3.3.8-beta-r3371.app/Contents/MacOS/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
opensprints.rb:127:in `<main>'
/Applications/Shoes-3.3.8-beta-r3371.app/Contents/MacOS/lib/shoes.rb:358:in `eval'
/Applications/Shoes-3.3.8-beta-r3371.app/Contents/MacOS/lib/shoes.rb:358:in `visit'
/Applications/Shoes-3.3.8-beta-r3371.app/Contents/MacOS/lib/shoes/setup.rb:100:in `block (2 levels) in setup_app'
Closing as fixed.
In Shoes 3.7 on macOS 10.14.5 (system
ruby
2.3.7p456), when I callfont()
and its argument is not a valid font file, Shoes will segfault instead of raise an error. This happens when I try to load a directory or a plain text file as a font.Here's a minimal repro. Run either of the
*.rb
files under Shoes to reproduce it.shoes-font-segfault.zip
The stack trace for the crash looks like this in the "Problem Report for Shoes" dialog that pops up.
Seems like this action should result in raising a normal Ruby exception instead of segfaulting.