Home Dashboard Directory Help
Search

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


Status: 

Active


2
0
Sign in
to vote
Type: Bug
ID: 357154
Opened: 7/21/2008 2:06:25 PM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

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.
Details
Sign in to post a comment.
Posted by PaulH79 on 4/28/2011 at 8:18 AM
The following code will demonstrate the issue:

    try
    {
        throw std::runtime_error( "a" );
    }
    catch( std::runtime_error& e1 )
    {
        try
        {
            try
            {
                throw std::runtime_error( "b" );
            }
            catch( std::runtime_error& e11 )
            {
                throw;
            }
        }
        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)

-PaulH
Posted by Rhobison on 7/28/2008 at 5:32 AM
Some progress??
Thanks!
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
Sign in to post a workaround.