[BUG] rb_gc_mark(): unknown data type 0x34(0x8a69570) non object

R

Ruben

I get the following error:

perm.rb:17: [BUG] rb_gc_mark(): unknown data type 0x34(0x8a69570) non object
ruby 1.8.1 (2004-04-24) [i686-linux-gnu]

Ruben


===================================================================

class GeneratingPermutationWithState

attr_accessor :eek:rig_str, :value

def initialize(str)
@orig_str = str
@cont = nil
@value = nil
@found = false
end

def recursive_each(chars_left,chars_built)
if chars_left.empty?
@value = chars_built.pack("c*")
@found = true
callcc {|@cont|} <============== error happens on this line
else
(0..(chars_left.length-1)).each { |index|
return if @found
new_char = chars_left[index]
new_chars_left = chars_left.clone
new_chars_left.delete_at(index)
new_chars_built = chars_built.clone
new_chars_built << new_char
recursive_each(new_chars_left,new_chars_built)
}
end
end

def start
arr = @orig_str.unpack('c*')
recursive_each(arr,Array.new())
end

def get_value
if (@value == nil) then
start
if @found then
return @value
else
return nil
end
else
@found = false
@cont.call
end
end

end

b = GeneratingPermutationWithState.new("abcdefghij")
while (b.get_value != nil)
end
 
T

ts

R> perm.rb:17: [BUG] rb_gc_mark(): unknown data type 0x34(0x8a69570) non object
R> ruby 1.8.1 (2004-04-24) [i686-linux-gnu]

In rb_callcc(), th->thread is assigned too late (and not set to zero in
THREAD_ALLOC())

If ruby call the GC when it's in scope_dup() it will give the error
`unknown data type' when it try to mark th->thread


Guy Decoux
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: [BUG] rb_gc_mark(): unknown data type 0x34(0x8a69570) non object"

|
|R> perm.rb:17: [BUG] rb_gc_mark(): unknown data type 0x34(0x8a69570) non object
|R> ruby 1.8.1 (2004-04-24) [i686-linux-gnu]
|
| In rb_callcc(), th->thread is assigned too late (and not set to zero in
| THREAD_ALLOC())
|
| If ruby call the GC when it's in scope_dup() it will give the error
| `unknown data type' when it try to mark th->thread

Thank you.

matz.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top