Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

SDE execution Error (April, 29, 2010)

inteleverywhere
Beginner
1,455 Views
Hello There,
I am using the Intel SDE (http://software.intel.com/en-us/articles/intel-software-development-emulator/) to execute C/C++ projects built on MSVC 2005. When executing my application with certain switches I am getting an error which has no mention so far on the web. Anybody there to help.

Further I would like to know what is the use of the XED tool provided in the package.

C:\\intel_sde>sde -mix --My App

....
.....

And then the error message: IN INSTLIB::emx_catastrophe_handler

Similarly

C:\\intel_sde>sde -ast --My App

....
.....

And then the error message: IN INSTLIB::emx_catastrophe_handler

Thanks
Deepak

0 Kudos
8 Replies
MarkC_Intel
Moderator
1,455 Views
Hi Deepak, the catastrophe handler is something new. I added this when we observed that pin would crash when the stack was corrupted and an program exception was generated. The exception handling mechanism needs a stack to execute and cannot create one because the stack pointer is pointing at inaccessible memory. That's what I call a catastrophe.

While it is impossible to know for sure without looking more deeply at your program, I suspect that the application stack is getting corrupted. The other possibility is that your code might be doing something with unmasked SSE exceptions? unmasked SSE exceptions are not supported in the current version of SDE (with the "exception" of div/0 for the AVX divide instructions).
You say you are using MSVC2005; Does that imply you are not using SSE4, AESNI, or AVX instructions? If so, does your application require emulation? If not, does your application run on native hardware?
Let me know if this helps or not. Possibly you can use the brute force techniques to cut back your program to see when the corruption might be occurring.
0 Kudos
inteleverywhere
Beginner
1,455 Views
Hello Mark,
Thanks very much.Just a couple of points. The existing source I have contains instructions from SSE2 to SSE4.2 (using the 128 bit XMM register intriniscs).The intention is touse AVXfor further performance gain.
My existing system set up is: MSVC 2005, Corei7 (presume Nehelam) and Intel Compiler 11.

My understanding is that I need MSVC 2008, Corei7 (SandyBridge) and Intel Complier 11.1. Which of these is available I am not sure!

Meanwhile I used the SDE provided by Intel and ran the executable (containing SSE4.2 implementations). With the option -no-avx. The program output was identical as the one generated when the executable is run on MSVC 2005.

But with the option -ast the exception occurs. Same happens when the histogram mix tool is used (option -mix)Moreover I am unable to write an AVX inststructions and compile the code on MSVC 2005. Do I need to used XED. What is XED for?


Thanks and Regards
Deepak
0 Kudos
Brijender_B_Intel
1,455 Views
Hi Deepak,
For AVX code you can use MSVC2008 if you are using Intel Compiler 11.1+ as it gets integrated to Visual Studio.Intel compiler is available for download. Also, MSVC2010 supports AVX. The switch in both compilers is /arch:AVX (that you may have to add manually as GUI does not have it). Secondly, in Intel compiler you need one more switch -QxAVX in addition to /arch:AVX. It will generate AVX bytes. After code is compiled then you can use SDE to emulate it as Sandy Bridge is not available.
I am not sure whether you have played with it or not, Intel compiler 11.+ also has auto vectorization. You can turn on vectorization report and it will print which loop was vectorized and which was not. It generates pretty good code.
I will let Mark answer your questions on "ast" and "mix".
0 Kudos
inteleverywhere
Beginner
1,455 Views
Thank You Mr Bharti. Thanks to Mark as well.

Some more help will be greatly appreciated. There is an XED tool in the main folder along with the SDE tool. There are two other folders inside named ia32 and intel64.If the code is built in MSVC with the win-32 configuration then the sde may be used. What ifthe x64 configuration is used to build the code. Are wil still supposed to use the same sde tool at the prompt? Will it internally select the intel64 emulator functions?

Also what should I use the XED tool for?

Thanks again.
0 Kudos
Brijender_B_Intel
1,455 Views
I beleive that is right. SDE is intelligent to pick the right platform. One separate question:
1. Did you try compiling your code with AVX option in compiler?
2. When you saw ast or mix failure is it on non-AVX build or AVX build?
0 Kudos
MarkC_Intel
Moderator
1,455 Views
Hi Deepak, XED is an encoder/decoder/disassembly library. XED is used by Pin and the emulator. XED was created for the Pin binary instrumentation system and has over time worked its way in to other software. But that's not how you'd want to write AVX code by hand! For more information on XED's API: http://www.pintool.org/docs/33586/Xed/html/
Responding to your earlier question: As Brijender said, you can use the Intel Compiler. For hand-coded assembly I use an external tool called YASM. The recent versions of GNU GCC also support AVX but that might be less relevant as you mentioned you are using Windows. Of course things like cygwin have gcc for Windows.

The -no-avx option is a really for people who want the emulator to stop when it encounters an AVX instruction. If you are not using AVX, you don't need to use that option.

If you are not using AVX, then you do not need to check for AVX/SSE transitions. (That's what the "-ast" knob controls). Are you saying that you are using -ast with -no-avx? That's not what your example shows in the initial posting. So I'm kind of confused at this point. You wrote that you are "unable to write an AVX instruction".

Either way, mix shouldn't crash. Especially if your app runs fine under sde without -mix.
SDE relies on Pin to run the right version of the emulator, either 32b or 64b. It looks at the executables as they are starting up and does the right thing.

If you have a *very* small boiled-down example that demonstrates the problem you are experiencing and it is not sensitive in nature, and does not require any nonstandard runtime libraries, licensing, and is otherwise unencumbered, you can put it in an encrypted zip file and mail the zip file (and the password!) to me. Please indicate exactly how you run your test. I can try to look at it, but can make no promises. mark dot charney at intel dot com.

Regards,
Mark
0 Kudos
inteleverywhere
Beginner
1,455 Views
Hello Mark;Brijendar,
Thanksand sorry.Thanks for all the guidance and sorry to have confused you both. As I mentioned in one of the previousposts, the source I am using contains instructions from SSE to SSE4.2. Ibuilt it in MSVC 2005with the Intel 11 compiler on a Corei7 (Nehelam arch.) X86 system(Windows 32 bit version).

I just wanted to run the sde with the -ast option to check if the code works fine with SSE4.2 only and noAVX since my source will contain both AVX and SSE4.2; it should thereforebe possible to use -ast even though AVX instructions have not yet been added. The problem is probably that I have not yet migrated to MSVC 2008and Intel 11.1. Once that is done I guess that the SDE willtake care of imitating SandyBridge and I willbe abletest theworking of AVX instructions on the future platform.

Thanks again. I shall come back toyouif thereis any issue.

Best
Deepak


0 Kudos
bronxzv
New Contributor II
1,455 Views
Sandy Bridge is not available.


Well it looks like it's already available to a happy few since a poster on this very forum comments on it, see tim18 comment about thevery deceptive IPC of 256-bit AVX
http://software.intel.com/en-us/forums/showthread.php?t=73821&o=d&s=lr

so a simple question : when will the SandyBridge"platform readiness program" (not sure about the exact name) i.e. access to pre-production hardware will start for small ISVs like the ones who were enjoying Intel's EAP in the past?

0 Kudos
Reply