Bug 475634 - valgrind is not starting
Summary: valgrind is not starting
Status: RESOLVED WORKSFORME
Alias: None
Product: valgrind
Classification: Developer tools
Component: massif (other bugs)
Version First Reported In: 3.22 GIT
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Nicholas Nethercote
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-14 22:29 UTC by Fred M
Modified: 2024-04-28 17:59 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 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?