Bugs: Browse | Submit New | Admin

[#14629] u("a").to_yaml hangs indefinitely, until terminated with signal -9 (traced back to Encoding::Character::UTF8.count)

Date:
2007-10-11 07:44
Priority:
3
Submitted By:
Hannes Wyss (hwyss)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
u("a").to_yaml hangs indefinitely, until terminated with signal -9 (traced back to Encoding::Character::UTF8.count)

Detailed description
Nikolai

thanks again for your brilliant library. I seem to hit a snag when trying to serialize some objects to yaml, some of
which contain UTF8-Strings.
I've reduced the problem down to the following:

hwyss@doubledog ~ $ irb -Ku -rencoding/character/utf-8
irb(main):001:0> "a".to_yaml
=> "--- a\n"
irb(main):002:0> u("a").to_yaml
Killed

-> I had to `kill -KILL` irb, no other signal worked.

Further reduction (deduced from yaml/rubytypes.rb:146)

hwyss@doubledog ~ $ irb -Ku -rencoding/character/utf-8
irb(main):001:0> u("\x00").include?("\x00")
=> true
irb(main):002:0> u("\x00").count("\x00")
Killed


My C-fu wasn't sufficient to pinpoint the Bug, but I'm guessing it's somewhere in
character-encodings-0.2.0/ext/encoding/character/utf-8/rb_utf_internal_tr.c

Thanks in advance for looking into this

cheers
Hannes



VERSION INFO:
hwyss@doubledog ~ $ gem list --local character-encodings

*** LOCAL GEMS ***

character-encodings (0.2.0)
    A pluggable character-encoding library
hwyss@doubledog ~ $ ruby --version
ruby 1.8.6 (2007-06-07 patchlevel 36) [x86_64-linux]

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-11-22 15:32
Sender: Nikolai Weibull

I can't actually reproduce this error.  I get the right answer.
Maybe this has been resolved by some other change I've done recently.
Should work in 0.3.0.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
summaryu("a").to_yaml hangs indefinitely, until terminated with signal -9 (traced back to Encoding::Character::UTF8.count)2007-11-22 15:32pcp