knu / ruby-unf

A wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
BSD 2-Clause "Simplified" License
75 stars 12 forks source link

Segmentation fault in normalize on Windown (Ruby 1.9.2p180) #8

Open duerst opened 10 years ago

duerst commented 10 years ago

I got a segmentation fault with the following two-line program:

require 'unf' UNF::Normalizer.normalize "\u00FC", :nfd

This is on Windows 7, Japanese version, with ruby 1.9.2p180 (2011-02-18) [i386-mingw32] using RubyInstaller for Windows. The error messages are as follows:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/unf-0.1.3/lib/unf/normalizer.rb:25: [BUG] Segmentation fault ruby 1.9.2p180 (2011-02-18) [i386-mingw32]

-- control frame ---------- c:0005 p:---- s:0016 b:0016 l:000015 d:000015 CFUNC :normalize c:0004 p:0021 s:0011 b:0011 l:000010 d:000010 METHOD C:/Ruby192/lib/ruby/gems/1.9.1/gems/u nf-0.1.3/lib/unf/normalizer.rb:25 c:0003 p:0033 s:0006 b:0006 l:001a94 d:001984 EVAL test_unf.rb:3 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH

c:0001 p:0000 s:0002 b:0002 l:001a94 d:001a94 TOP

-- Ruby level backtrace information ---------------------------------------- test_unf.rb:3:in <main>' C:/Ruby192/lib/ruby/gems/1.9.1/gems/unf-0.1.3/lib/unf/normalizer.rb:25:innormalize' C:/Ruby192/lib/ruby/gems/1.9.1/gems/unf-0.1.3/lib/unf/normalizer.rb:25:in `normalize'

[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html

This may be a bug in the Ruby interpreter itself, but it only appears when using unf, so my current guess is that it's some problem in unf itself.