Disable debug symbol generation with Visual Studio integrations

Disable debug symbol generation with Visual Studio integrations

This is a problemI have noticed with both the previous version 10.x as well as the latest V11.0.072 Intel compiler + Visual Studio 2008 integrations. All executable files built with the Intel C++ compiler include debug symbol information (standard source file + function name + line number info) no matter if debug symbol generation is turned on or off. The standard Microsoft NDEBUG flag does not appear to eb honored, and manually adding /debug:none to the compiler command line does not change matters. Compiling with the same options using the built-in MSVC compiler does eliminate all debug symbols. An example command line is:

/c /O3 /Og /Ob2 /Oi /Ot /Oy /GT /Qipo /GA /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /GF /EHsc /MD /GS /Gy /fp:fast /Fo"Release/" /W3 /nologo /QaxHost /QxSSE2 /Qparallel /debug:none

Is there a technique I am missing here? The standard operation is a pain, requiring extra steps to process the executable to strip symbols and recalculate the checksum.

13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Let me check.
Which VS version are you using? I'll try with VS2008.

Quoting - Jennifer Jiang (Intel)
Let me check.
Which VS version are you using? I'll try with VS2008.

Jennifer,

We are using VS 2008 Team System. This problem occurs only after a project includes more than a trivial number of source files and functions. Build a simple "Hello, world" application and all debug symbols are stripped properly. A project that includes 20+ source files, their header files, and a bunch of functions results in the executable contianing symbol definitions for most if not all functions that were not inlined. For example, given function main in foo.c and foobar in bar.c, the executable contains a symbol definitions:

;C:DevVisual Studio 2008ProjectsTempfoo.c;_main;48;48;;
;C:DevVisual Studio 2008ProjectsTempbar.c;_foobar;162;162;;

For a reasonably large project, the procedure symbols add over 1MB of data to the final executable. Not only that, but one does not necessarily want customers to see all the functions and files called...

I used NQ sample for testing, didn't see the problem with Composer.

Is it possible for you to upload the "buildlog.htm"to find out the compileroptions?

Please see attachment

Attachments: 

AttachmentSize
Download BuildLog.htm10.28 KB

I did some more investigating. Several compiler settings add debug symbol table information to the executable. These include:

  • /Qipo: Adds symbols for D:usersnbtesterx86win_nightlybranch-11_020090131_010000libdevlibmrealcos_sse2.c and eight other functions in the same folder path. (These look to be pointers to files on an Intel dev's hard drive. They are not ours. No symbol table references to any of our project functions appear in the exe.)
  • /Qparallel: A number of symbol table references appear in the exe. The _main function is listed three times and a function containing parallelized code is listed twice.
  • /Qipo and /Qparallel: A high percentage of the fuctions in the source code appear in the symbol table. The nine D:usersnbtester... symbol references appear as well.

Hopefully this helps isolate the bug!

I experimented some more with this. Selecting eeither single-file (/Qip) or multi-file (/Qipo) optimizations results in the mysterious D:...nbtester... function symbols appearing in the executable file. More importantly, however, I discovered that a minimal test case can be used to see this behavior:

#include 

main (int argc, char **argv)
{
	printf("Hello worldn");
}

Compiling this with /Qipo and /QParallel enabled causes symbols to be emitted for the first and last lines of _main:
;C:TempSystestmain.c;_main;4;4;;
;C:TempSystestmain.c;_main;6;6;;

The compiler command line from Buildlog.htm was:
/c /O2 /Oi /Qipo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /EHsc /MD /GS /Gy /fp:fast /Fo"Release/" /W3 /nologo /Zi /Qparallel /Qvc9 /Qlocation,link,"c:Program Files (x86)Microsoft Visual Studio 9.0VCbin"
.main.c

Command line passed to icl:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /OUT:"C:TempSystestRelease/test.exe" /INCREMENTAL:NO /nologo /MANIFEST /MANIFESTFILE:"Releasetest.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /TLBID:1 /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:TempSystestReleasetest.lib" /MACHINE:X86
Release/main.obj

Command line passed to xlink:
/nologo /outputresource:"C:TempSystestReleasetest.exe;#1" /manifest "Releasetest.exe.intermediate.manifest"

Quoting - petervk
The compiler command line from Buildlog.htm was:
/c /O2 /Oi /Qipo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /EHsc /MD /GS /Gy /fp:fast /Fo"Release/" /W3 /nologo /Zi /Qparallel /Qvc9 /Qlocation,link,"c:Program Files (x86)Microsoft Visual Studio 9.0VCbin"
.main.c

Thanks for trying to find a small testcase.
Your compile option has "/Zi" that is the debug info option. So this is not a good testcase.

Jennifer

Quoting - Jennifer Jiang (Intel)
Thanks for trying to find a small testcase.
Your compile option has "/Zi" that is the debug info option. So this is not a good testcase.

Jennifer

Too much cut and paste confusion going on. I rechecked with all debug output disabled. The symbol definitions for _main still appear in the executable. Compiler command line:

/c /O2 /Oi /Qipo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /EHsc /MD /GS /Gy /fp:fast /Fo"Release/" /W3 /nologo /Qparallel /Qvc9 /Qlocation,link,"c:Program Files (x86)Microsoft Visual Studio 9.0VCbin"
.main.c

Adding to the above...

I also tried compiling the simple "hello world" application from the command line instead of from within Visual Studio. As long as /QParallel is present in the compiler options the debug symbols are present in the executable file. All other optimizations can be removed from the linker and compiler command lines and still have the symbols appear.

Quoting - petervk
Adding to the above...

I also tried compiling the simple "hello world" application from the command line instead of from within Visual Studio. As long as /QParallel is present in the compiler options the debug symbols are present in the executable file. All other optimizations can be removed from the linker and compiler command lines and still have the symbols appear.

Thank you petervk. I can duplicate it with the latest compiler with your description and I'll send it to the engineers.

Jennifer

Hi,

also this problem happens with the last evaluation Version: 11.1 Build: 058 on Mac OS X 10.5 too.

Even worse if 64-bit binaries using OpenMP are compied then the application may crash in random paces.
Another problem even if it does not crash the some constant strigs will be replaced with part of the source code name.

For example

printf("Hello worldn"); 

may print something like this:

user/main.cpp;10;11;

In 32-bit compilations this does not happens but all file names and function names that are using OopenMp directives will be visible in the binaries and this is not well too!!!

I will also need to wait util this important Bug will be fixed before get the license for Intel compile on Mac OS X.

thanks.

Hello everyone,
We have added a new option to control the debug info in non-debug build, but this option is available in the 12.0 compiler only (Intel Parallel Composer 2011 or Intel C++ Composer XE).

Please download it from the registration center.

New option: Qparallel-source-info- (Windows) -no-parallel-source-info (Linux* or Mac OS*)

Thanks,
Jennifer

Leave a Comment

Please sign in to add a comment. Not a member? Join today