Solved: Debugger:: An unhandled non-continuable exception was thrown during process load “0xc0000022”

I recently developed a new application on my local machine (in Visual Studio/C++ 2008), and then moved it into our source/revision control system at work, IBM/Rational ClearCase (cc). The new app uses some third-party libraries for which we only have DLLs (no source), so I checked those into ClearCase, too. Unfortunately, the first time I made any changes to the version in cc and tried to step through the app in the debugger, I was immediately presented with an unfriendly error and app termination:

Debugger:: An unhandled non-continuable exception was thrown during process load

along with some return code (0xc0000022).

I turned to google, and didn’t find any silver bullets among the first few results, but found one guy who gave up after discovering that it still ran fine when copied to his local drive, and eventually found this post, where user bpjung was kind enough to contribute this gem:

!!! Make sure the permissions of your DLLs are set correctly !!!
glew32.dll from the official site glew.sf.net comes with wrong permissions.

While I wasn’t using that particular dll, that note, in combination with the fact that it worked when copied locally, was enough for me to deduce a likely culprit and hypothesis. One quick test later, and–sure enough–I had fixed the issue!

Solution

Apparently the ‘execute’ permission in unix/linux gets enforced somehow when mounting a clearcase view as a drive in Windows (at least, on Windows XP with ClearCase 6). From linux, I checked out the DLLs that are in the view for this project (find ./ -iname '*.dll' -exec cleartool co -nc {} \;), added execute permission to the dlls (find ./ -iname '*.dll' -exec chmod +x {} \;), and then tried firing up the debugger (from my Windows machine). Much to my relief, everything fired up and ran as expected (the code changes I made even worked!), so life was good again.

I don’t know if this affects source/revision control systems other than ClearCase, but hopefully if anyone else runs into this problem in the future, their search might be a little shorter than mine :). Enjoy!

P.S. Thanks to this tip for getting my single quotes to render as such, rather than converted to HTML smart quotes like ‘this’ (‘this&’) so that the find commands above will copy/paste correctly.

Tags: , ,

Leave a Reply