Search

Native frames missing from some mixed call stacks - C++ by small_mountain_0705

Closed
as Fixed Help for as Fixed

5
0
Sign in
to vote
Type: Bug
ID: 554772
Opened: 4/27/2010 7:12:19 PM
Access Restriction: Public
0
Workaround(s)
3
User(s) can reproduce this bug
In a mixed-mode (native/managed) C++ project that targets .NET 4.0, if you hit a breakpoint in managed code and look at the call stack, in certain scenarios, some or all of the native frames that should appear in the call stack are missing. It *appears* to have something to do with passing native parameters to managed functions. This is a regression from VS 2008/.NET 2.0/.NET 3.0/.NET 3.5.
Details (expand)

Product Language

English

Visual Studio Version

Visual Studio 2010

Operating System

Windows 7

Operating System Language

English (US)

Steps to Reproduce

Create a C++ project that targets .NET 4.0 with some native files and some managed (C++/CLI) files. You'll need some call paths through the code that take you from managed code to native code and back to managed code. A good scenario is a WPF event handler that calls into native code, which in turn calls back into managed code. The managed function at the top of the stack seems to need to have some parameters of native reference or pointer type (see the attached VS 2010 solution). Set a breakpoint in the managed code at the end of this code path, and then when you hit the breakpoint, examine the call stack. As soon as there is a transition from the managed code to the native code, all the native frames will not show up in the Call Stack. Only when code transitions back to managed code do you see call stack frames again. If you set a breakpoint in native code, you see the native frames, at least up to the point where there is a transition back to managed and then back to native.

Debugger Type is Mixed, but Auto does the same thing. Win32 Debug configuration.

Actual Results

Missing native frames from mixed call stack.

Expected Results

Same call stack as Visual Studio 2008 (with a project that targets .NET 2.0)
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey.

 

File Attachments
File Name Submitted By Submitted On File Size  
zqj_BadCallStacks.zip 4/30/2010 22 KB
Sign in to post a comment.
Posted by jippers on 9/13/2010 at 10:26 AM
I'm unable to make a sample project to reproduce this problem, but in may actual project I am still seeing this issue with mixed call stacks. Is there a way to have MSFT connect with me remotely and see the call stacks?
Posted by Microsoft on 9/3/2010 at 4:59 PM
The hotfix provided does fix the original issue that was reported by "small_mountain" and at this time there are no other outstanding issues regarding to managed/native call stacks that we know of.

Could you please attach a zipped project file to this feedback through our site that can help us with the unresolved issue for your case?
Posted by jgeras on 8/20/2010 at 5:11 PM
I found the hotfix for this issue here: http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2151757

... however it doesn't seem to fix the issue for me in all cases. Are there still known issues with the hotfix?
Posted by Microsoft on 8/13/2010 at 4:08 PM
http://support.microsoft.com/kb/2151757

Thanks,
~Pete Steijn
Windows C++ SDET
Posted by gkwei on 8/13/2010 at 1:52 PM
I also am encountering this problem. Is there a link to the hotfix request?

Thanks.
Posted by Microsoft on 6/21/2010 at 3:11 PM
We have been working on issuing a hotfix for this problem. Since you are the customer for the hotfix contact, we will send you a private very soon ..

Thanks again for the report. I will close this connect issue at our end because we both can track the issue with the hotfix request.
Posted by jschroedl on 5/10/2010 at 6:54 AM
Any news on this? It's getting quite painful to debug our C++/CLI application?
Posted by Microsoft on 5/3/2010 at 2:57 AM
Thanks for your feedback. We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by small_mountain_0705 on 4/30/2010 at 1:28 PM
I have uploaded a ZIP file with a VS 2010 solution that reproduces the problem. The instructions are in the ReadMe.txt file included in the solution directory.

Eric
Posted by Microsoft on 4/29/2010 at 7:06 PM
We will wait for you 7 days.

Thanks again for your efforts and we look forward to hearing from you.
Visual Studio Product Team
Posted by small_mountain_0705 on 4/29/2010 at 5:02 PM
I can't send our whole project, so I'm working on a small repro. I can tell you that our simple attempts at a repro have not shown the problem, so I can see why you had trouble reproducing it. I'm working to make it match our full project in all the relevant ways to trigger the bug. So it is clearly not as widespread as the bug title would make you think. It may take a few days.

Eric
Posted by Microsoft on 4/29/2010 at 2:49 AM
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.

Could you please attach a zipped project file to this feedback through our site to help us reproduce the issue?

Thanks again for your efforts and we look forward to hearing from you.
Visual Studio Product Team
Posted by small_mountain_0705 on 4/28/2010 at 2:16 AM
I updated the bug to include that you will need for the mixed mode project to target .NET 4.0 to see the problem.

Eric
Posted by Microsoft on 4/28/2010 at 1:38 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.