Eval Lockup

S

stevetuckner

Hello all,

I am currently modifying Instiki to allow code to be put on wiki pages
between <% %> tags. It seems to work fine, but now I have run into an
issue that I am not sure what to do about. With particular Wiki
contents, if the eval causes an exception, the exception object that is
caught is broken somehow. When it do e.message, ruby locks up by going
into some infiniite loop and sucks all my computer's resources down with
it (it is worse on Linux than on Windows). I have tried it with the
latest CVS version of ruby and it still occurs. Does any one have any
ideas on how to debug this problem. If anyone is interested in trying
it, I can send them a tar of the instiki directory with my data and code
mods.

Thanks in advance,

Steve Tuckner
 
R

Robert Klemme

stevetuckner said:
Hello all,

I am currently modifying Instiki to allow code to be put on wiki pages
between <% %> tags. It seems to work fine, but now I have run into an
issue that I am not sure what to do about. With particular Wiki
contents, if the eval causes an exception, the exception object that is
caught is broken somehow. When it do e.message, ruby locks up by going
into some infiniite loop and sucks all my computer's resources down with
it (it is worse on Linux than on Windows). I have tried it with the
latest CVS version of ruby and it still occurs. Does any one have any
ideas on how to debug this problem. If anyone is interested in trying
it, I can send them a tar of the instiki directory with my data and code
mods.

Maybe you get into an infinite loop. Tracing via #set_trace_func could
help. You can put something like this into a module that you require:

$trace = File.open("/c/temp/ruby/trace.log", "w")
$trace.sync = true

set_trace_func proc {|*args|
if /(call|return)$/ =~ args[0]
$trace.puts args.inspect
end
}

Note: performance will be awful.... :)

robert
 

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,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top