Bug 487744

Summary: [PATCH] Valgrind coredumps greater than 4GB are unusable and GDB does not interpret them
Product: [Developer tools] valgrind Reporter: chandru.dav <chandru.dav>
Component: generalAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.23.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Patch to fix offset overflow

Description chandru.dav@gmail.com 2024-05-29 14:07:18 UTC
Created attachment 169938 [details]
Patch to fix offset overflow

SUMMARY
    When Valgrind coredumps exceed 4GB, an overflow occurs while computing
    the offset, leading to the corruption of previously written valid
    sections.

STEPS TO REPRODUCE
1.  Run a large binary whose coredump is expected to exceed 4GB in valgrind.
eg: /usr/bin/valgrind --tool=memcheck --track-fds=yes --run-libc-freeres=no --log-file=/valgrind.log --fair-sched=yes --num-callers=20 --leak-check=full --error-limit=no --show-reachable=yes /usr/bin/large_binary
2. Trigger a coredump by sending a kill signal to the valgrind (kill -11 <pid>)
3. Try and examine the resulting coredump generated, using GDB.

OBSERVED RESULT
GDB is not able to load the shared libraries and the backtrace is not shown properly

EXPECTED RESULT
The coredump under GDB should give clear stack traces.

SOFTWARE/OS VERSIONS
Linux