Open qiulaidongfeng opened 1 year ago
In virtualbox
Please fill out the complete issue template, including the output from go env
in the environment in which the test fails.
Please also include details about the virtualbox configuration — what kind of hardware is the physical machine running, and what kind of hardware is VirtualBox emulating?
In virtualbox
Please fill out the complete issue template, including the output from
go env
in the environment in which the test fails.Please also include details about the virtualbox configuration — what kind of hardware is the physical machine running, and what kind of hardware is VirtualBox emulating?
Done. On my virtualbox machine, the same test for go1.21.3 also failed. The version of gotip is go version devel go1.22-eeadf0853e Sat Oct 21 12:11:22 2023+0800 Linux/amd64.
From the first failure in the issue report:
pprof_test.go:214: compare 1m13.387525s user + 5.416163s system = 1m18.803688s vs 20.64s
The first round of the test asks NumCPU
workers to each do 5 seconds of work. The view from getrusage(2)
shows 1m18.8s = 78.8s of on-CPU time, which is close to 16 workers * 5 seconds per worker.
The CPU profiler saw 20.64s worth of samples, 2064 samples each representing 10ms of on-CPU time. That's close to 4 workers worth of on-CPU time, or 2.5 ms between successful SIGPROF deliveries (a bit faster than a common CONFIG_HZ setting of 250Hz / 4ms).
I'm not set up for VirtualBox, so I haven't tried to reproduce that aspect. Are there any useful hints in the last "profiling broken on VirtualBox" issue? https://github.com/golang/go/issues/18856#issuecomment-276686977
I'm not able to reproduce the issue on a remote machine running Ubuntu 22.04.3 with Linux kernel 6.2 and go1.21.3:
$ go1.21 version
go version go1.21.3 darwin/arm64
$ ssh ubuntu@${addr} 'uname -a'
Linux ip-172-31-18-227 6.2.0-1012-aws #12~22.04.1-Ubuntu SMP Thu Sep 7 14:01:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ ssh ubuntu@${addr} 'cat /etc/lsb-release'
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
$ GOOS=linux GOARCH=amd64 go1.21 test -o /tmp/pprof.test -c runtime/pprof
$ scp /tmp/pprof.test ubuntu@${addr}:.
pprof.test 100% 4513KB 1.6MB/s 00:02
$ ssh ubuntu@${addr} './pprof.test -test.run=TestCPUProfileMultithreadMagnitude -test.v'
=== RUN TestCPUProfileMultithreadMagnitude
pprof_test.go:121: Running on Linux 6.2
=== RUN TestCPUProfileMultithreadMagnitude/serial
pprof_test.go:187: Running with 1 workers
pprof_test.go:558: total 500 CPU profile samples collected:
368: 0x553143 (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
129: 0x55313b (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
1: 0x4582cc (runtime.nanotime:19) 0x47f16d (time.Since:915) 0x5530c5 (runtime/pprof.cpuHogger:41) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
1: 0x55313f (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
1: 0x46c1e0 (runtime.asyncPreempt:8) 0x553143 (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
pprof_test.go:629: found 499 samples in expected function runtime/pprof.cpuHog1
pprof_test.go:215: compare 5.00444s user + 4.875ms system = 5.009315s vs 5s
=== RUN TestCPUProfileMultithreadMagnitude/parallel
pprof_test.go:187: Running with 16 workers
pprof_test.go:558: total 7988 CPU profile samples collected:
2975: 0x553143 (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
2381: 0x55313b (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
2581: 0x553124 (runtime/pprof.cpuHog0:61 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
5: 0x553127 (runtime/pprof.cpuHog0:61 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
32: 0x553130 (runtime/pprof.cpuHog0:62 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
6: 0x55313f (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
1: 0x40b1b7 (runtime.lock2:61) 0x440268 (runtime.lockWithRank:24 runtime.lock:48 runtime.goschedImpl:3756) 0x44058e (runtime.gopreempt_m:3788) 0x468f0d (runtime.mcall:458) labels: map[]
1: 0x46c1e0 (runtime.asyncPreempt:8) 0x553143 (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
2: 0x46c1e0 (runtime.asyncPreempt:8) 0x553124 (runtime/pprof.cpuHog0:61 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
2: 0x46c1e0 (runtime.asyncPreempt:8) 0x55313b (runtime/pprof.cpuHog0:65 runtime/pprof.cpuHog1:56) 0x55308e (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
1: 0x46c783 (runtime.nanotime1:282) labels: map[]
1: 0x553082 (runtime/pprof.cpuHogger:42) 0x554c8e (runtime/pprof.TestCPUProfileMultithreadMagnitude.func3.2.1.1:233) labels: map[]
pprof_test.go:629: found 7985 samples in expected function runtime/pprof.cpuHog1
pprof_test.go:215: compare 1m19.917177s user + 51.998ms system = 1m19.969175s vs 1m19.88s
--- PASS: TestCPUProfileMultithreadMagnitude (10.31s)
--- PASS: TestCPUProfileMultithreadMagnitude/serial (5.11s)
--- PASS: TestCPUProfileMultithreadMagnitude/parallel (5.20s)
PASS
@rhysh After attempting https://github.com/golang/go/issues/18856#issuecomment-276686977, the test still failed.
My machine uses the command output mentioned in your comment.
$ uname -a
Linux qiulaidongfeng-VirtualBox 6.2.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 3 13:14:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=23.04
DISTRIB_CODENAME=lunar
DISTRIB_DESCRIPTION="Ubuntu 23.04"
$ go version
go version go1.21.3 linux/amd64
@qiulaidongfeng are you able to reproduce this on a non-virtualized environment? Thanks.
I don't have any non virtualized Linux machines right now.
If necessary, I can try using the same Ubuntu image to install Windows and Ubuntu dual system testing on my own computer. Do you need to do this?
└─$ uname -a
Linux kali 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.9-1kali1 (2024-01-08) x86_64 GNU/Linux
└─$ go version
go version go1.21.6 linux/amd64
The CPU is 8 cores and 16 threads. The virtual machine running with virtualbox is set to have 16 processors. kail get from here: https://www.kali.org/get-kali/#kali-virtual-machines
if export GOMAXPROCS=6 ,test pass. if export GOMAXPROCS=8 ,test fail. if no set GOMAXPROCS environment variable ,test fail.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
In virtualbox
The physical machine is a GOOS=amd64 machine, and the virtual machine is also a GOOS=amd64 machine, both with 16 threads.
Virtual machine 4.5GB memory.
go test runtime/pprof
What did you expect to see?
Test passed.
What did you see instead?