Bug 475634

Summary: valgrind is not starting
Product: [Developer tools] valgrind Reporter: Fred M <dark_footix>
Component: massifAssignee: Nicholas Nethercote <njn>
Status: RESOLVED WORKSFORME    
Severity: normal CC: pjfloyd
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-14 22:29:55 UTC
SUMMARY
I am running the git master version of 03 October 23.

I am launching a heavy software

Ran this : 
valgrind '--tool=massif' '--time-unit=ms' '--vgdb=yes' '--vgdb-error=0' '--trace-children=yes' '--threshold=0.01' '--main-stacksize=10000000'  my_soft &

Valgrind is starting with this :
==2807== Massif, a heap profiler
==2807== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
==2807== Using Valgrind-3.22.0.GIT and LibVEX; rerun with -h for copyright info

But as I have a backtrace and this warning : 
==2807==  If you believe this happened as a result of a stack                                                                             
==2807==  overflow in your program's main thread (unlikely but                                                                            
==2807==  possible), you can try to increase the size of the
==2807==  main thread stack using the --main-stacksize= flag.
==2807==  The main thread stack size used in this run was 10002432.

I re-do :
valgrind '--tool=massif' '--time-unit=ms' '--vgdb=yes' '--vgdb-error=0' '--trace-children=yes' '--threshold=0.01' '--main-stacksize=12000000'  my_soft &

I have no more the starting log: "Massif, a heap profiler" 

and : 
vgdb detailed_snapshot /tmp/massif2023-10-15_00-02-50_0.out
vgdb error: no FIFO found and no pid given

It is as "valgrind is not started at all"

and 
Strangely by removing the "&" at the end of the line 
valgrind '--tool=massif' '--time-unit=ms' '--vgdb=yes' '--vgdb-error=0' '--trace-children=yes' '--threshold=0.01' '--main-stacksize=12000000'  my_soft
I see the "Massif, a heap profiler" boot log.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ARM chipset
Comment 1 Paul Floyd 2023-10-15 04:43:29 UTC
Try removing the vgdb options. Valgrind will be stopped waiting for a vgdb connection via named pipe.
Comment 2 Paul Floyd 2023-10-15 05:05:01 UTC
Also does it work with the simplest tool, "--tool=none"?
Comment 3 Fred M 2023-12-09 20:25:37 UTC
Maybe, I found the root cause,

After the 
vagrind XXXX &
I do a "sleep"

https://bugs.busybox.net/show_bug.cgi?id=15619
Bug 15631 - sleep command after '&' in a shell script has no effect

The sleep is not executed.
I am waiting a busybox > 1.36.1 to close the current bug.
Comment 4 Paul Floyd 2024-04-27 16:33:49 UTC
Can this be closed now?