Visual C++ generates incorrect code with omit frame pointer and setjmp - by rwallace13

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 666704 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 5/4/2011 12:02:26 PM
Access Restriction Public


When you call setjmp from a function other than main, and compile with omit frame pointer, the resulting program sometimes crashes on return from main. Further discussion at:
Sign in to post a comment.
Posted by syplex on 7/20/2012 at 11:34 AM
This is marked as fixed, where is the fix?
Posted by Microsoft on 5/11/2011 at 11:26 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by rwallace13 on 5/11/2011 at 10:46 AM
Okay, I've managed to boil it down to a small self-contained test case that reproduces the problem, and uploaded the code. If you compile it with /O2 as in the enclosed batch file and run it, you should see it crashing on return from main.

(The reason my original attempt to create a test case failed was that the function that calls setjmp and the function that calls longjmp have to be in separate source files, perhaps because otherwise the latter will be inlined into the former.)
Posted by Microsoft on 5/10/2011 at 11:10 PM

Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Please zip the file and use "FeedbackID-XXXXXX" as prefix of the file name.


It may help if you provide us with a dump file and call stack. You can use the following steps to get a dump file:
1. Start Visual Studio.
2. Start another instance of VS.
go to Tools | Options | Debugging
- Enable ".NET Framework source stepping"
- Enable "Source Server support"
- Enable "Step over properties and operators (Managed only)"
- Disable "Enable Just My Code"

3. In the second instance click Tools | Attach to Process...
4. In the list of processes locate devenv.exe.
5. Click Select... and explicitly choose 'Native' and 'Managed' code.
6. Click OK and OK to close Select dialog and Attach to Process dialog.
7. Go back to the first instance of VS and repro the crash.
8. Upon the crash, control should go to the second instance of VS.
9. In the second instance click Debug | Save Mini Dump (without heap).

You can get detailed steps about how to get the dump file and call stack at

After that, please upload file to workspace:
Password is xLBDIjK)abN

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 4 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.
Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 5/10/2011 at 11:16 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(