[win32 | ext | IE] 'stack level too deep' error

R

ruby.dev

hi,

I have a problem with this "stack level too deep" error in my extension
and I hope someone can provide some hints in solving it as I banged my
head to the wall for several days.

input:
* a program that uses embedded Ruby for scripting
* extension creates a window with an embedded IE (IWebBrowser2)
* extension extends window.external with a function that
rb_eval_string_protect the argument (after converting from WideChar to
MultiByte)

host -> ruby -> extension -> IE window -> ruby

info:
* if I test outside the host program (normal ruby) I get after several
calls - (eval):5: [BUG] cross-thread violation on rb_thread_schedule()

* inside host program if the eval uses iterators with multiple items or
string concatenation(<<) I get - (eval):128:in `method_missing': stack
level too deep

* I tried rb_gc_disable() but with no effect

* if I Init_stack on window.external invoke it works as long as I am
inside the IE window. on a second window activation I get 'stack level
too deep' and I cannot open the window anymore

versions:
* normal ruby 1.8.2 (2004-12-25) [i386-mswin32]
* hoster ruby 1.8.0 (2003-08-04) [i386-mswin32]

thanks
 
R

Ruby.Dev

I want to thank Guy Decoux for the wonderfull tip - "don't try to mix
OS thread with ruby thread"

by changing the OS CreateThread(...) with rb_thread_create(...) solved
the problem for those that encounter the same problem
 

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