Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
wolfgang-svrcek-seiler
Total Points:
30
Registered User
July 10, 2009 3:57 AM PDT
Possible bug in inlined string functions of icc Version 11.1 (Build 20090511 Package ID: l_cproc_p_11.1.038)
Hi all,
When I compile the following program:

#include <stdio.h>
#include <string.h>

int main()
{
char x[100];
int len;

strcpy(x, "mumbo jumbo");
len = (int) strlen(x);
printf("%d\n", len);
return 0;
}

with icc 11.1 and optimization level -O2 or higher, valgrind complains about numerous runtime errors, most probably initially triggered triggered
inside strlen(). If, however, I compile it with '-nolib-inline', all error messages are gone.
Besides, compiling with icc 10.1 or 11.0 also gives no errors.

I hope that helps,
greetings,
Andreas



Brandon Hewitt (Intel)
Total Points:
2,340
Status Points:
1,840
Brown Belt
July 10, 2009 4:20 PM PDT
Rate
 
#1
Hi all,
When I compile the following program:

#include <stdio.h>
#include <string.h>

int main()
{
char x[100];
int len;

strcpy(x, "mumbo jumbo");
len = (int) strlen(x);
printf("%d\n", len);
return 0;
}

with icc 11.1 and optimization level -O2 or higher, valgrind complains about numerous runtime errors, most probably initially triggered triggered
inside strlen(). If, however, I compile it with '-nolib-inline', all error messages are gone.
Besides, compiling with icc 10.1 or 11.0 also gives no errors.

I hope that helps,
greetings,
Andreas




I'll take a look at this.  What command line are you using for valgrind?
--------
Brandon Hewitt
Intel Developer Support

Tools Knowledge Base: http://software.intel.com/en-us/articles/tools
Software Product support info: http://www.intel.com/software/support

* Other names and brands may be claimed as the property of others.


wolfgang-svrcek-seiler
Total Points:
30
Registered User
July 13, 2009 4:06 AM PDT
Rate
 
#2 Reply to #1
Hi,
thanks for the quick reply. The submitted example is a close to minimal test case.
Command lines:
icc tstr.c -g -O2
...
valgrind ./a.out | & less
valgrind versio is 3.3.0, flags enabled by default are:  -v  --trace-children=yes --time-stamp=yes --error-limit=no --leak-check=full
--leak-resolution=high

best,
Andreas


Brandon Hewitt (Intel)
Total Points:
2,340
Status Points:
1,840
Brown Belt
August 21, 2009 11:21 AM PDT
Rate
 
#3 Reply to #2
Hi,
thanks for the quick reply. The submitted example is a close to minimal test case.
Command lines:
icc tstr.c -g -O2
...
valgrind ./a.out | & less
valgrind versio is 3.3.0, flags enabled by default are:  -v  --trace-children=yes --time-stamp=yes --error-limit=no --leak-check=full
--leak-resolution=high

best,
Andreas


Looks like this is a known limitation of valgrind.  See http://valgrind.org/docs/manual/dist.news.html under Known Limitations:

- Memcheck is unusable with the Intel compiler suite version 11.1, when it generates code for SSE2-and-above capable targets. This is because of icc's use of highly optimised inlined strlen implementations. It causes Memcheck to report huge numbers of false errors even in simple programs. Helgrind and DRD may also have problems.


If you're using the compiler for 32-bit, you can use the -mia32 option to workaround this, but this option will likely impact your performance.
--------
Brandon Hewitt
Intel Developer Support

Tools Knowledge Base: http://software.intel.com/en-us/articles/tools
Software Product support info: http://www.intel.com/software/support

* Other names and brands may be claimed as the property of others.




Intel Software Network Forums Statistics

8445 users have contributed to 31553 threads and 100398 posts to date.
In the past 24 hours, we have 10 new thread(s) 30 new posts(s), and 43 new user(s).

In the past 3 days, the most popular thread for everyone has been Lost in MKL The most posts were made to TBB on linux segfaulting The post with the most views is Hi,if you were using imsl yo

Please welcome our newest member nonamez