News

Microsoft VC++ load bug can haunt some DLL assemblies

[Programmers Report/March 18, 2003] - An important element of .NET hit a bump in the road this week as Microsoft disclosed a DLL assembly bug which can cause apps to terminate. [Since the familiar term ‘DLL’ is giving way in the .NET era, combined native and managed code runtimes in .NET are now being called ‘mixed DLL assemblies.’]

Visual C++ is something of a special player in the .NET Framework. While other code must run as managed code on the Common Language Runtime [CLR] execution environment, C++ can run either natively or in managed mode. But the compiler that makes that possible has some issues, Microsoft has discovered. When target systems have enough tasks running, the bug can lock up the app.

Because C++ is synonymous with high performance, this ‘dual-mode’ trait was important among those touted at the time of the .NET roll out in 2002.Existing C++ code did not have to be rewritten to run on the .NET platform. Since the familiar term ‘DLL’ is giving way in the .NET era, combined native and managed code runtimes are now being called ‘mixed DLL assemblies.’

Microsoft is making a special effort to get out in front of any publicity firestorm around the bug. Data about the flaw is available at the company’s web site.

“We’re beating the drum to get the word out,”said Nick Hodapp, Visual C++ .NET product manger. He suggested the bug effects a small portion of end users, and that it did not turn up until recently because it occurs rarely. ”There hasn’t’ been a lot of uptake on it yet,” said Hodapp. He described the root problem as a ‘classic compiler mistake,’ and as an ‘architectural flaw,’ and he admitted chagrin at having such a flaw in this important Microsoft product.

This does not appear to be something that can be fixed with a simple patch/update. The company does not have a ‘fix’ at this point. Instead it will suggest workarounds. Hodapp admitted that the company considered holding up the next release of Visual Studio .NET to deal with the problem, but is moving ahead as planned, hoping to fix the bug in a later product release.

“We felt the work-around step was really the best we could do,” said Hodapp. “It only effects C++ developers, and this would hold up all the others using .NET.”

On the DLL assembly bug he said: “It happens when a user system is heavily loaded - when processor cycles are taxed – when the system is under duress.”

It locks the app, but like any truly classic bug, it doesn’t happen every time.

Some links
Tuning into .NET -ADT
Finding bugs the hard way -Semicolon Newsletter Online
Mixed DLL Loading Problem -MSDN

About the Author

Jack Vaughan is former Editor-at-Large at Application Development Trends magazine.