might a little away from your topic.
I found from msdn that _controlfp is not supported on x64 platform, which will give invalid-parameter exceptions:(
"On the x64 architecture, changing the floating point precision is not supported. If the precision control mask is used on that platform, an assertion and the invalid parameter handler is invoked, as described in Parameter Validation."
Post by Kevin8237
I think I am losing it...this all works just fine in x86, but not in x64.
I have a C++/CLI code that essentially calls _controlfp_s, catches SEH
exceptions (exceptions thrown from Intel Fortran .dll file loaded via
LibraryLoad), and builds a call stack. So far so good.
However, if the StackWalk64 call gets to a frame that involves my C++/CLI
.dll file, then I get problems.
If I use the _set_se_translator / throw method, then somewhere between
throw and catch, something decides to call abort().
If I use the __try/__except(Filter that calls StackWalk64 and returns 1)
method, then I get the NT_STATUS_BAD_STACK MessageBox error from Visual
Even the Visual Studio debugger "Call Stack" window looks wrong. If I
double-click into the function that caused the exception, the arguments
inside that function are just bogus.
All this only on x64, and only if StackWalk64 makes it into a frame that
belongs to my C++/CLI .dll.
I have tried VS2008. I have tried VS2010. I have tried the VS2010 dbghelp
library. I have tried the Feb 2010 dbghelp library.
Post by Jochen Kalmbach [MVP]
Waht does you mean?
Your programm ist compiled as x64 or still as x86, but running on x64
(x86 on x64)?
StackWalk only works correctly for native stack-frames.
WHY dou you want to walk the callstack?
My blog about Win32 and .NET
Post by Kevin8237
I compile and ship both a x86 version and a x64 version. x64 is
preferrable, and x86 is "fallback" depending on user's operating system.
I need the stack trace to help the user. Typically if user enters invalid
input, it will cause a divide-by-zero crash (or similar) somewhere in the
Fortran (native!) code. Once the native code exception is handled properly
(as is the case for the x86 build), I do not have a problem.
Post by Trey Nash
Stack walking on x64 has "evolved" over time so to speak. By that I mean it
has gotten better and better with each OS release.
To effectively walk stacks on x64, you must set the DisablePagingExecutive
REG ADD "HKLM\System\CurrentControlSet\Control\Session Manager\Memory
Management" -v DisablePagingExecutive -d 0x1 -t REG_DWORD -f
BTW, I have authored a forthcoming blog post for our team blog
(http://blogs.msdn.com/ntdebugging) that talks more about stack walking in
x64 and the unwind metadata necessary for one to effectively do so.
I hope this helps,