cmd/link: cannot fallocate file in tmpfs on EulerOS when cpuprofile is on #69137
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
Go version
go version devel go1.24-6edc1c23ed Thu Aug 22 01:18:23 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
The program can not make Fallocate and goes into infinite loop.
What did you expect to see?
The program makes changes the file size.
Explanation
This situation happens when few factors are met in the same time:
The real-world situation happened, when I tried to measure sweet benchmark in the pgo mode on my performance server. The problematic callstack is the following:
The problematic code is in the
cmd/link/internal/ld.(*OutBuf).Mmap
:The
fallocate
always returnsEINTR
and the code do not leave the loop. I found, that other people faced the similar problems, but their solution was the loop above.My solution of this problem was to replace the
fallocate
withftruncate
syscall in the following way:That workaround worked, and I'd like to ask the advice what is the best way to solve the problem?
The text was updated successfully, but these errors were encountered: