Thursday, September 01, 2005

Most of my day today was tracking down a problem with our app when we obfuscated it.  We were getting a System.EntryPointNotFoundException in the obfuscated version, while the normal one worked fine. The stack trace contained the following on the top of the stack trace:

at System.Collections.Generic.IEnumerable`1.GetEnumerator() +0

No concrete class, and an assembly code offset of 0. Weird, eh? After tweaking with lots of settings and digging through the IL of several iterations of differing obfuscation techniques, I finally determined the problem.

I had three overloads of a method that each took a different parametrization of IEnumerable<T>.  For the sake of example, we'll say IEnumerable<A>, IEnumerable<B>, and IEnumerable<C>.  In the obfuscation process, calls to any of the three were being changed to the IEnumerable<A> overload.  Sure enough, PEVerify was giving errors about the wrong type being on the stack. (I was going to show the IL before and after, but I just realized that I deleted the non-working one after fixing it. I'll post it if I can find it again)  It seems that Dotfuscator was not distinguishing properly between overloads if they only differ by parameterization types. I have not verified it, but this may have been aggravated by iterator methods.

We're working up some sample code to send to Preemptive so they can address the problem, but debugging it was frustrating enough to post a synopsis of the account for Google to find.

posted on Thursday, September 01, 2005 12:13:07 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
Related posts:
Random fun book thing and CLR In-Proc SxS
LinqToStdf now on CodePlex
Image Slicer for Deep Zoom in Silverlight 2
Silverlight limitations and Constrained Callvirt in IL
What are the generic Delegates in the framework for?
What is System.__Canon and why is it on my stack?
Tracked by:
"Another Crazy Dotfuscator Bug" (marklio) [Trackback]
http://www.marklio.com/marklio/PermaLink,guid,6c9ece30-cff2-444c-90ee-49a68695e2... [Pingback]
"shoes and boots search" (shoes and boots search) [Trackback]
"boston table tennis online" (boston table tennis online) [Trackback]
"paid to take surveys" (paid to take surveys) [Trackback]
"random house publishers" (random house publishers) [Trackback]
"braless in a tight shirt" (braless in a tight shirt) [Trackback]
"candida albicans die off symptoms" (candida albicans die off symptoms) [Trackback]
"rock identification" (rock identification) [Trackback]
"Publishers Wanting Unsolicited Manuscripts" (Publishers Wanting Unsolicited Man... [Trackback]
"NY Jets" (NY Jets) [Trackback]
"olap report" (olap report) [Trackback]
"laredo community college distance learning" (laredo community college distance ... [Trackback]
"dhea overactive thyroid" (dhea overactive thyroid) [Trackback]
"dorm twink" (dorm twink) [Trackback]
"california phantom planet" (california phantom planet) [Trackback]
"x box 360 release date" (x box 360 release date) [Trackback]
"cheap solar blankets" (cheap solar blankets) [Trackback]
"sports illustrated swimsuit edition gallery" (sports illustrated swimsuit editi... [Trackback]
"montana resorts" (montana resorts) [Trackback]
"diaper" (diaper) [Trackback]
"protonix knee brace" (protonix knee brace) [Trackback]
"gallery magazine" (gallery magazine) [Trackback]
"long term effects of diovan hct" (long term effects of diovan hct) [Trackback]
"tune belt" (tune belt) [Trackback]
"rustic couch" (rustic couch) [Trackback]
"south puget sound community college" (south puget sound community college) [Trackback]
"AMBIEN BLACKOUT SIDE EFFECTS" (AMBIEN BLACKOUT SIDE EFFECTS) [Trackback]
"ionic cleanse foot bath" (ionic cleanse foot bath) [Trackback]
"scion accessories" (scion accessories) [Trackback]
"american wire gauge" (american wire gauge) [Trackback]
"southern ca new homes" (southern ca new homes) [Trackback]
"Best Search Engine" (Best Search Engine) [Trackback]
"Condo Developer" (Condo Developer) [Trackback]
"amy grant mp3" (amy grant mp3) [Trackback]
"slutty latin whores" (slutty latin whores) [Trackback]
"elephant list xxx" (elephant list xxx) [Trackback]
"Louisiana Lotronex attorneys" (Louisiana Lotronex attorneys) [Trackback]