Breakage with .net 4.0?
- Hi all, I have been using the Phoenix compiler as a frontend for some code analysis. Then last week I decided to try out the VS 2010 beta and implement a dynamic instrumentation tool I have been wanting to build for a while. Since Phoenix is VS 2008 only my plan was to try out VS 2010 while I wrote a DLL that managed all the book-keeping and then call this from a rewritten (using Phoenix) binary.
All went well until I tried to implement my rewriter with Phoenix, then I could not read in the .exe I wanted to rewrite without errors (it seems the problem involved some dll's not resolving correctly). In fact at this point in time my previously working analysis tool was failing with the same errors. Additionally most of the sample code provided with Phoenix failed to compile (mostly with unresolved dll references) and if they did run promptly failed with strange exceptions.
I then installed a fresh copy of Win 7 (which should have .net 4.0 by default) and VS 2008. Again all the Phoenix based code failed to build and/or run. I then returned to my orig. installation of Vista, uninstalled VS 2010 and .net 4.0. Now at least my analyzer code works although some of the Phoenix samples still fail. Tomorrow I am going to do a fresh install of Vista and VS 2008 to see if this resolves all problems.
So short story, there seems to be something about .net 4.0 that completely breaks Phoenix.
Although I think I have resolved my problems I wanted to report this issue and post this so that other users are aware of it. If there is any other useful information I can provide let me know,
Mark
Answers
Yes, we know of at least one place where the Phoenix SDK is incompatible with VS2010 beta 2 (clrv4 by itself should be harmless, afaik). The Phoenix SDK has some code that looks for a very early 10.0 version of msdia.dll, via com. Subsequently, the VC team made some bigger changes to DIA but did not update the GUIDs. Phoenix will bind to the newer DIA installed by VS2010 Beta 2 and things go badly after that.
This should mainly impact PE read/write scenarios though it may also hit in some c2 scenarios. From reading your post it sounds like you are doing PE read write but if not let me know.
Unfortunately, there's no easy fix. I believe you can craft manifest entries to allow an app-local style use of the old msdia, but haven't yet worked out exactly how this works. If I find out I will post the details here.
One more thing I should point out: Win7 does not install CLRv4 and the SDK is fine with Win7 -- it's VS2010 Beta 2 that causes the problems.
Architect - Microsoft Phoenix Project- Edited byAndy Ayers - MSFTModeratorFriday, November 06, 2009 6:46 AMfixed a typo
- Marked As Answer byDefaultSteve Saturday, November 07, 2009 11:31 PM
All Replies
Yes, we know of at least one place where the Phoenix SDK is incompatible with VS2010 beta 2 (clrv4 by itself should be harmless, afaik). The Phoenix SDK has some code that looks for a very early 10.0 version of msdia.dll, via com. Subsequently, the VC team made some bigger changes to DIA but did not update the GUIDs. Phoenix will bind to the newer DIA installed by VS2010 Beta 2 and things go badly after that.
This should mainly impact PE read/write scenarios though it may also hit in some c2 scenarios. From reading your post it sounds like you are doing PE read write but if not let me know.
Unfortunately, there's no easy fix. I believe you can craft manifest entries to allow an app-local style use of the old msdia, but haven't yet worked out exactly how this works. If I find out I will post the details here.
One more thing I should point out: Win7 does not install CLRv4 and the SDK is fine with Win7 -- it's VS2010 Beta 2 that causes the problems.
Architect - Microsoft Phoenix Project- Edited byAndy Ayers - MSFTModeratorFriday, November 06, 2009 6:46 AMfixed a typo
- Marked As Answer byDefaultSteve Saturday, November 07, 2009 11:31 PM
- Hi Andy, fortunately I don't have any problems staying with VS2008 for a while longer (I was trying the VS2010 beta out for curiosity). You are right that I was working with code that did PE read/write operations. However, I did try installing the release candidate version of windows 7 (perhaps in the final version this is resolved) and pdb writes still failed with a Phx fatal exception. As I said this is not a show stopper problem for me but I wanted to make sure that the issues was known.
Thanks for your response and your work on the framework, it is very nice to have tools like this available,
Mark


