Bug 492947

Summary: valgrind/massif ARM => missing backtrace in case of valgrind strip.
Product: [Developer tools] valgrind Reporter: Fred M <dark_footix>
Component: massifAssignee: Nicholas Nethercote <njn>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: pjfloyd
Priority: NOR    
Version First Reported In: 3.23.0   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Fred M 2024-09-10 15:03:54 UTC
Hello Valgrind,

In valgrind 3.23 / ARM, I remark an issue with massif.

When I am stripping everything ( valgrind included )
And I lost the backtraces :

#-----------
snapshot=0
#-----------
time=10000
mem_heap_B=96964693
mem_heap_extra_B=120243
mem_stacks_B=0
heap_tree=detailed
n1: 96964693 (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
 n0: 96964693 0x0: ???    <--------------- HERE


But if I overwrite the folder /usr/libexec/valgrind/ without the strip , for this lib : 
vgpreload_core-arm-linux.so
vgpreload_drd-arm-linux.so
vgpreload_helgrind-arm-linux.so
vgpreload_massif-arm-linux.so
vgpreload_memcheck-arm-linux.so
=> it s working fine , 

Would it be a build option to make valgrind / massif / backtraces robust to the strip ?

Regards,
Frédéric
Comment 1 Paul Floyd 2024-09-11 07:18:53 UTC
(In reply to Fred M from comment #0)

> Would it be a build option to make valgrind / massif / backtraces robust to
> the strip ?

No. Simply don't use strip. From README_PACKAGERS:

-- Don't strip the debug info off lib/valgrind/$platform/vgpreload*.so
   in the installation tree.  Either Valgrind won't work at all, or it
   will still work if you do, but will generate less helpful error
   messages.  Here's an example:

The example in the README is a bit out of date. This issue looks like another case where it is a problem.

The worst thing about stripped binaries for us (Valgrind developers) is that bug reports won't have useful stack traces.
Comment 2 Paul Floyd 2024-09-15 07:03:16 UTC
I'm closing this as intentional.

I can't see any way that we can fix the issue and we've been saying not to strip binaries for donkeys years.