libarmmem symbol issues prevent Valgrind redirs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
Valgrind should redirect the functions in libarmmem, mainly to check for overlaps but also partly to avoid false positives due to SIMD optimizations reading beyond the terminating nul (Valgrind has a second mechanism to avoid such false positives, but that doesn't work in this case).
It would also help if the shared library contained its soname.
See https:/
To check, run
./vg-in-place --trace-symtab=yes --log-file=sym.log memcheck/
(vg-in-place is for running Valgrind in its own source directory, any executable should do for the test).
Look for the libarmmem section starting with
------ start ELF OBJECT -------
------ name = /usr/lib/
The key part is this table
--- Reading (ELF, standard) dynamic symbol table (14 entries) ---
raw symbol [ 1]: LOC SEC : svma 0x0000000374, sz 0 NONAME
raw symbol [ 2]: LOC SEC : svma 0x0000014024, sz 0 NONAME
raw symbol [ 3]: WEA FUN : svma 0x0000000000, sz 0 __cxa_finalize
ignore -- size=0: __cxa_finalize
raw symbol [ 4]: WEA NOT : svma 0x0000000000, sz 0 _ITM_deregister
raw symbol [ 5]: WEA NOT : svma 0x0000000000, sz 0 __gmon_start__
raw symbol [ 6]: WEA NOT : svma 0x0000000000, sz 0 _ITM_registerTM
raw symbol [ 7]: GLO NOT : svma 0x00000030f8, sz 0 memset
raw symbol [ 8]: GLO NOT : svma 0x00000030e4, sz 0 mempcpy
raw symbol [ 9]: GLO NOT : svma 0x00000031c0, sz 0 strlen
raw symbol [ 10]: GLO NOT : svma 0x000000216c, sz 0 memmove
raw symbol [ 11]: GLO NOT : svma 0x00000030e4, sz 0 __mempcpy
raw symbol [ 12]: GLO NOT : svma 0x0000000b58, sz 0 memcpy
raw symbol [ 13]: GLO NOT : svma 0x00000004d0, sz 0 memcmp
"GLO NOT" means "global notype". Valgrind will ignore notype objects. "sz 0" is also a problem as Valgrind will ignore objects with a size of 0.
Valgrind also needs some modifications, but that requires libarmmem to be fixed first.
description: | updated |
description: | updated |
summary: |
- libarmmem symbol issues prevent Valgrid redirs + libarmmem symbol issues prevent Valgrind redirs |
description: | updated |
Initial version.
I'm not sure what should be done with __mempcpy. Is that an alias that should also by type FUNC and have a size?
With this I get
paulf@raspberry pi:~/scratch/ arm-mem $ readelf -s libarmmem-v7l.so | grep FUNC | grep GLOB
7: 00003094 20 FUNC GLOBAL DEFAULT 9 mempcpy
8: 000030a8 200 FUNC GLOBAL DEFAULT 9 memset
9: 00003170 320 FUNC GLOBAL DEFAULT 9 strlen
10: 0000211c 3960 FUNC GLOBAL DEFAULT 9 memmove
12: 00000b08 5652 FUNC GLOBAL DEFAULT 9 memcpy
13: 00000480 1672 FUNC GLOBAL DEFAULT 9 memcmp
88: 0000211c 3960 FUNC GLOBAL DEFAULT 9 memmove
89: 00000b08 5652 FUNC GLOBAL DEFAULT 9 memcpy
91: 00003094 20 FUNC GLOBAL DEFAULT 9 mempcpy
93: 00000480 1672 FUNC GLOBAL DEFAULT 9 memcmp
95: 000030a8 200 FUNC GLOBAL DEFAULT 9 memset
97: 00003170 320 FUNC GLOBAL DEFAULT 9 strlen
which is certainly better.