'Valgrind memcheck finds lots of conditional jumps and invalid reads in commercial library

I am debugging a program which links against a commercial API library (under Linux). I am using valgrind memcheck, because I am experiencing strange behavior which could be due to writes beyond allocated blocks of memory:

valgrind --tool=memcheck --error-limit=no --log-file=memcheck.log ./executable

The first thing which jumps to my eye, however, are many errors of the types

Use of uninitialised value of size (4/8/16)

Invalid read of size (4/8/16)

Conditional jump or move depends on uninitialised value(s)

Some, but not all, of these occur in __intel_sse2_strcpy or __intel_sse2_strlen. Furthermore, according to valgrind there are definite memory leaks. which appear in the library. They also appear when I compile one of the examples that ship with the library, so they are not my programming errors. Furthermore, they consistently occur with different versions of the library. Since the library is closed-source I cannot seem to clarify if the errors are fatal or not.

Practically this makes it hard for me to identify my potential own errors. I am a bit surprised to see so many warnings because I tend to fix my own programs until memcheck does not print these anymore (before I give it away at least). The question is: Can I consider such errors as save to ignore, do they commonly appear in packaged software, or are they likely even false positives (for instance because the library was compiled with optimizations)?



Solution 1:[1]

Quoting an answer from here which might explains the false positives encountered in string operations:

https://www.intel.com/content/www/us/en/developer/articles/troubleshooting/false-positive-diagnostic-on-string-operations-reported-by-intel-inspector.html

''' there are certain string operations that use vector(SIMD) instructions to calculate the string length. They read a string pointer in 32 byte chunks and check for a NULL character in each chunk that it reads. If the string size is not a multiple of 32, then it reads garbage in the memory region after the NULL '''

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 isti_spl