- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I compile the following program:
#include
#include
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I compile the following program:
#include
#include
int main()
{
char x[100];
int len;
strcpy(x, "mumbo jumbo");
len = (int) strlen(x);
printf("%dn", 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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 optionwill likely impact your performance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was actually a deficiency in Valgrind; it gets confused by aligned vector loads that extend past the end of an allocated memory block.
https://bugs.kde.org/show_bug.cgi?id=294285
This deficiency is fixed in (soon-to-be-released) Valgrind 3.9.0 and above. If you use that version of Valgrind and run your test case with "--partial-loads-ok=yes", you should find it works now.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page