YAML bug

H

haldane

YAML seems to have a problem with stings over 8k in length.

require 'yaml'
x = "Z" * 8193
y x

/usr/local/lib/ruby/1.8/yaml/rubytypes.rb:315: [BUG] Segmentation fault
ruby 1.8.1 (2003-12-25) [i686-linux]

Aborted

Hmm... any ideas?

Stephen.
 
H

haldane

ts said:
h> ruby 1.8.1 (2003-12-25) [i686-linux]

use a more recent version of ruby


Guy Decoux

Thank you, updating to 1.8.2 fixes the 8k bug, but now I have another problem:

require 'yaml'
class B
def initialize
@a = String # any class name
end
end
x = B.new
y x
ArgumentError: can't dump anonymous class Class
from c:/ruby/lib/ruby/1.8/yaml/rubytypes.rb:9:in `to_yaml'
from c:/ruby/lib/ruby/1.8/yaml/baseemitter.rb:175:in `map'
from c:/ruby/lib/ruby/1.8/yaml/baseemitter.rb:164:in `each'
from c:/ruby/lib/ruby/1.8/yaml/baseemitter.rb:164:in `map'
from c:/ruby/lib/ruby/1.8/yaml/rubytypes.rb:25:in `to_yaml'
from c:/ruby/lib/ruby/1.8/yaml/rubytypes.rb:24:in `call'
from c:/ruby/lib/ruby/1.8/yaml.rb:188:in `quick_emit'
from c:/ruby/lib/ruby/1.8/yaml/rubytypes.rb:24:in `to_yaml'
from c:/ruby/lib/ruby/1.8/yaml.rb:218:in `y'
from (irb):40

It would be nice if yaml could dump classname constants - Marshal does this fine.

Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top