Skip to content
This repository

Critical bug in IronRuby makes web hosting impossible! #87

Open
cglessner opened this Issue October 14, 2012 · 0 comments

1 participant

Christian Glessner
Christian Glessner

I've a project called "IronSP" where I host the DLR (.net 2.0) and IronRuby in SharePoint/ASP.NET. During a load test I found a critical bug. I always got the following error while load testing (yout have to use arrays to cause the error):
"System.IndexOutOfRangeException: Index was outside the bounds of the array"
Wow, to hunt this bug has almost taken two weeks. The issue is that in the _infiniteTracker field in IronRuby.Runtime.RecursionTracker is missing the static keyword and without this keyword the [ThreadStatic] attribute is useless. Hosting the engine in ASP.NET means many threads will access the infiniteTracker dictionary and when two hits the _infiniteTracker in parallel the dictionary will be corrupted an every access to it throws a IndexOutOfRangeException. The static keyword in combination with [ThreadStatic] avoids this issue, because the dictionary will be created per Request/Thead. Please fix that in original IronRuby source. It affects the current version and IronRuby 1.0. Would be awesome if some one coud fixes in 1.0. I did the fix already, but can't sign the assemblies with the original MS keys.

class IronRuby.Runtime.RecursionTracker

[ThreadStatic]
private static Dictionary _infiniteTracker;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.