Bug 351536

Summary: Valgrind should track map areas of unloaded libraries
Product: [Developer tools] valgrind Reporter: Thiago Macieira <thiago>
Component: memcheckAssignee: Julian Seward <jseward>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: rich, tom
Priority: NOR    
Version: 3.10.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Thiago Macieira 2015-08-20 21:32:02 UTC
Sometimes, an invalid memory access is caused by a library that has got unloaded, as in the following example:

==7557== Invalid read of size 4
==7557==    at 0xA8EBFE4: load<int> (qgenericatomic.h:83)
==7557==    by 0xA8EBFE4: QBasicAtomicInteger<int>::load() const (qbasicatomic.h:118)
[...]
==7557==  Address 0x17a73f80 is not stack'd, malloc'd or (recently) free'd

The report is correct, but it would have been more useful if the last line said:

==7557==  Address 0x17a73f80 is 0x73f80 bytes into unloaded library libQt5XcbQpa.so

Further wishes:
 1) display the backtrace of the dlclose(), which would be equivalent to free() for the regular memcheck functionality
 2) display the closest symbol in the library
Comment 1 Tom Hughes 2015-08-20 21:38:29 UTC

*** This bug has been marked as a duplicate of bug 79362 ***