Bug 492947 - valgrind/massif ARM => missing backtrace in case of valgrind strip.
Summary: valgrind/massif ARM => missing backtrace in case of valgrind strip.
Status: RESOLVED INTENTIONAL
Alias: None
Product: valgrind
Classification: Developer tools
Component: massif (other bugs)
Version First Reported In: 3.23.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Nicholas Nethercote
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-10 15:03 UTC by Fred M
Modified: 2024-09-15 07:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.