Exception handling: Access Violation on nested try/catchs - by Rhobison

Status : 


Sign in
to vote
ID 357154 Comments
Status Active Workarounds
Type Bug Repros 1
Opened 7/21/2008 2:06:25 PM
Access Restriction Public


When some try/catchs are nested and I try to re-throw an exception, I get an Access Violation. I Can't see any problem with my application. Its look like a stack corruption.

I am working on Pocket Pc (Windows Mobile 6 SDK + Visual Studio 2005 SP1 + Windows XP SP2) 
The problem happens with both emulator and real device.

Update: Same behavior on Visual Studio 2008.
Sign in to post a comment.
Posted by PaulH79 on 4/28/2011 at 8:18 AM
The following code will demonstrate the issue:

        throw std::runtime_error( "a" );
    catch( std::runtime_error& e1 )
                throw std::runtime_error( "b" );
            catch( std::runtime_error& e11 )
        catch( std::runtime_error& e12 )
            NKDbgPrintfW( L"EC: %S\r\n", e12.what() ); //access violation

The Access Violation occurs when calling std::runtime_error::what(). It does not happen when compiling with Visual Studio 2008 for x86 Windows. I am told it does not happen with GCC Linux. It only happens with ARMV4I Windows Mobile. (I was using Windows Mobile 6.5.3)

Posted by Rhobison on 7/28/2008 at 5:32 AM
Some progress??
Posted by Microsoft on 7/22/2008 at 1:22 AM
Thanks for your feedback. We are escalating this bug to the product unit who works on that specific feature area. The team will review this issue and make a decision on whether they will fix it or not for the next release.

Thank you,
Visual Studio Product Team