Bug 475208

Summary: error: cannot take snapshot before execution has started
Product: [Developer tools] valgrind Reporter: Fred M <dark_footix>
Component: massifAssignee: Nicholas Nethercote <njn>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.22 GIT   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Fred M 2023-10-04 10:40:41 UTC
SUMMARY

By running valgrind memory leak with a heavy application : 
valgrind --tool=massif my_apps &

The detail_snapshot is failing : 
vgdb detailed_snapshot /tmp/massif2023-10-04_12-21-23_0.out
sending command detailed_snapshot /tmp/massif2023-10-04_12-21-23_0.out to pid 1941
error: cannot take snapshot before execution has started

Instead of adding a temporization with "sleep" between the valgrind and vgdb command.
Is there or could it have a function to wait that Valgrind is ready ? 
A blocking/sync wait argument to the vgdb? 
or an option/return vgdb to know everything is ready? I can do the detailed_snapshot.

Regards,
Frédéric 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  ARM / linux
Comment 1 Fred M 2023-10-04 11:12:39 UTC
I workarounded like this : 

sleep 10
vgdb detailed_snapshot my_output.out
while [[ $? != 0 ]]; do
  sleep 60
  vgdb detailed_snapshot my_output.out
done