Prevent Valgrind Validation from Shared Libraries

Firstly, I know that there is another question with almost the same name , but the answers to this question are useless here. Another question is approaching, but again the solution is not one, I can here.

My application uses a shared library that Valgrind really dislikes. It generates:

Program Exception - illegal instruction Image PC Routine Line Source libirc.so 000000000405ED3C Unknown Unknown Unknown libhdf5.so.7 00000000061338E2 Unknown Unknown Unknown libhdf5.so.7 00000000061A73CE Unknown Unknown Unknown libhdf5.so.7 00000000061A9D6F Unknown Unknown Unknown libhdf5_fortran.s 0000000006B23233 Unknown Unknown Unknown libhdf5_fortran.s 0000000006B19FF9 Unknown Unknown Unknown les3d.x 00000000006D815C Unknown Unknown Unknown 

and dies before it even gets into my application (well, it gets into my application, but the first thing we do is call the procedure to initialize the shared library in which it dies). Running without Valgrind does not trigger an illegal instruction, but I get fancy segfaults and therefore the need for memory control. Thus, this is completely unsuitable, so error suppression will not work.

Is it possible to actually prevent Valgrind from working in shared libraries called by the application? Do not suppress the conclusion, but do not actually descend into it. If not, is there a preventable memory checker?

+4
source share
1 answer

First of all, you should report this problem - there is information on how to do this on the valgrind website.

What you see suggests that valgrind JIT generates an instruction that is invalid on your computer, which really shouldn't be.

To answer your direct question, there is no way to do what you want, because it makes no sense - if valgrind cannot see all the reads and writes that your program does, it cannot monitor the memory state properly and can detect errors in those parts of the program that it controls. You will receive both false positives and false negatives.

+3
source

All Articles