Problem using YAML/SYCK on Solaris 8

A

andi

I'm using ruby 1.8.2 (2004-06-28) [sparc-solaris2.8] and yaml/syck
in a daemon script to write alive messages every 10 seconds.
Sooner or later the loop/thread/script ends with one of the following
error messages:

....
9179
9180
9181
/usr/local/lib/ruby/1.8/yaml.rb:340: [BUG] Segmentation fault
ruby 1.8.2 (2004-06-28) [sparc-solaris2.8]

Abort (core dumped)

OR

....
1709
1710
1711
Exception `NotImplementedError' at /usr/local/lib/ruby/1.8/yaml.rb:340
- method `write' called on terminated object (0xd3088)
/usr/local/lib/ruby/1.8/yaml.rb:340:in `end_object': method `write'
called on terminated object (0xd3088) (NotImplementedError)
from /usr/local/lib/ruby/1.8/yaml.rb:340:in `quick_emit'
from /usr/local/lib/ruby/1.8/yaml/rubytypes.rb:307:in
`to_yaml'
from to_yaml_test.rb:7
from to_yaml_test.rb:6:in `loop'
from to_yaml_test.rb:6


Here is the simplified source code ...
------------------------
require 'yaml'

i = 0
loop{
"HelloWorld".to_yaml
i+=1
STDERR.puts i
}
------------------------

uname -a
SunOS tb-sun-1 5.8 Generic_108528-12 sun4u sparc SUNW,Sun-Blade-1000

gcc -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.0/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.0

On Linux there is no problem ;-)


Any suggestions or hints??
Thanks--

Andi
 
T

ts

a> /usr/local/lib/ruby/1.8/yaml.rb:340: [BUG] Segmentation fault

Probably a problem in syck_emitter_new()

bonus and ignore_id must be affected *after* the call to
Data_Wrap_Struct() because if the GC run when Data_Wrap_Struct() is called
it can remove emitter->bonus

a> Exception `NotImplementedError' at /usr/local/lib/ruby/1.8/yaml.rb:340
a> - method `write' called on terminated object (0xd3088)

emitter->bonus was GC'ed

Guy Decoux
 
W

why the lucky stiff

ts said:
bonus and ignore_id must be affected *after* the call to
Data_Wrap_Struct() because if the GC run when Data_Wrap_Struct() is called
it can remove emitter->bonus
Understood. Fixed in CVS and Ruby 1.8 branch.

Andi, can you try again for me? Wonderful.

_why
 
N

nobu.nokada

Hi,

At Wed, 30 Jun 2004 02:43:11 +0900,
why the lucky stiff wrote in [ruby-talk:104858]:
Understood. Fixed in CVS and Ruby 1.8 branch.

I think instance initialization should be in #initialize,
apart from the allocator.
 

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
474,262
Messages
2,571,052
Members
48,769
Latest member
Clifft

Latest Threads

Top