I am attempting to use the Pointer Checker with with a trial version of Intel C++ Studio XE for Linux (installed from cpp_studio_xe_2013_sp1_update3.tgz). I have the compiler integrated under Eclipse 4.3 with CDT as noted in my recent two messages. This is a Debian 8 (Testing) system and I have removed the GCC 4.9 compiler and libraries so that the Intel compiler can work with the libraries from GCC 4.8.3.
After reading the documentation I concluded that a minimal use of this facility would involve adding this option to the compiler command line:
and that a full use of it would involve adding:
As far as I know, I don't need to add any code to handle this, though I could in order to customize what happens if a problem is detected.
I want to try this on a real program, but first I am trying just the first option with a Hello World program. This causes about a hundred link errors, starting with:
./src/Hello-World-Intel-C++-1.o: In function `main':
../src/Hello-World-Intel-C++-1.cpp:(.text+0x5d): undefined reference to `__chkp_map_rsi_for_store'
../src/Hello-World-Intel-C++-1.cpp:(.text+0x82): undefined reference to `__chkp_map_rdi_for_store'
makefile:45: recipe for target 'Hello-World-Intel-C++-1' failed
../src/Hello-World-Intel-C++-1.cpp:(.text+0xca): undefined reference to `__chkp_map_rax_for_load'
../src/Hello-World-Intel-C++-1.cpp:(.text+0x10c): undefined reference to `__chkp_cpstore'
../src/Hello-World-Intel-C++-1.cpp:(.text+0x137): undefined reference to `__chkp_map_for_load'
It did not help for me to add:
or to configure the linker to search the .so libraries, including libchkp.so, in /opt/intel/cpp-studio-xe/composer_xe_2013_sp1.3.174/compiler/lib/intel64 .
Googling reveals no pages where anyone else has such trouble. Googling "__chkp_map_rsi_for_store" leads to a solitary Intel page: https://software.intel.com/sites/default/files/icl_log.txt which made no sense to me.
Googling: Intel C++ "pointer checker" leads to about 1,630 results. These seem to be mainly Intel documentation and marketing material, with a few discussions and little evidence of people actually using the Pointer Checker. This discussion http://blog.regehr.org/archives/939 might be of general interest regarding checking pointers, with some alternative approaches.
I couldn't understand this message, regarding an earlier update of the compiler: http://www.tuicool.com/articles/2EjaM3 . The only two messages concerning Pointer Checker in this forum report false positives, and have not been answered.
I want to roughly quantify the performance penalty of Pointer Checker, but can't get past first base with Hello World. The documentation mentions that the performance hit is too high for production code, but does not quantify it. I found an Intel presentation, in various forms, such as:
which quantifies the performance penalty: "Runtime cost is high, about 2X-5X the execution time (based on some open source application runs - work in progress and not yet published), and code size increases from 20 percent to 100 percent or more depending on the application."
This is probably sufficient to rule it out for our intended application. G++'s -D_GLIBCXX_DEBUG facility may be sufficient and my impression is that the performance degradation is minimal, such as less than 10%. In one test, a fully optimized (-O3 -static) program ran about 5% faster - I don't know why.
If I can get the Intel Pointer Checker operating, I will be able to find out the performance penalty on our code. However, the dearth of reports of people using it makes me wonder if this is a bleeding edge new development with little history of robust industrial use.