Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc/cgo/testcarchive: TestSIGPROF flakes with "signal: profiling timer expired" #19320

Closed
ianlancetaylor opened this issue Feb 28, 2017 · 14 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

I see this test failure from a trybot, in https://storage.googleapis.com/go-build-log/f8d7aae9/darwin-amd64-10_11_578453d9.log.

##### ../misc/cgo/testcarchive
--- FAIL: TestSIGPROF (1.40s)
	carchive_test.go:591: 
	carchive_test.go:592: signal: profiling timer expired
FAIL
2017/02/28 07:44:16 Failed: exit status 1
@ianlancetaylor ianlancetaylor added this to the Go1.9 milestone Feb 28, 2017
@josharian
Copy link
Contributor

@gopherbot
Copy link

CL https://golang.org/cl/42830 mentions this issue.

@crawshaw
Copy link
Member

crawshaw commented May 5, 2017

I see this once every ~200 runs of go test -run=TestSIGPROF carchive_test.go.

What I think may be happening:

  • thread A has a pending SIGPROF
  • thread B calls setcpuprofilerate(0) which turns off further SIGPROFs with setitimer, and then removes the handler using a special code path just for c-archive/c-shared
  • thread A tries to deal with SIGPROF, and the default handler terminates the program.

If this is so, then I don't see a way to uninstall the SIGPROF handler.

https://golang.org/cl/42830 leaves the handler installed once it is installed. That's enough to fix the test, over several thousand runs. Is this good enough? Should we also forward SIGPROF in this case?

@bradfitz
Copy link
Contributor

bradfitz commented Jul 6, 2017

Kicking to Go 1.10.

@bcmills, feel free to take it over (soon) if you think this is important for Go 1.9.

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 6, 2017
@bradfitz bradfitz modified the milestones: Go1.10, Go1.9 Jul 6, 2017
@dmitshur
Copy link
Contributor

dmitshur commented Sep 7, 2017

It looks like this intermittent trybot failure may have masked a real failure in CL 60530, causing #21783.

@gopherbot
Copy link

Change https://golang.org/cl/68850 mentions this issue: runtime: clear pending SIGPROF signals after disabling the profile timer

@gopherbot
Copy link

Change https://golang.org/cl/69111 mentions this issue: misc/cgo/testcarchive: avoid crashes from spurious SIGPROF signals

@gopherbot
Copy link

Change https://golang.org/cl/69114 mentions this issue: misc/cgo/testcarchive: skip slaky SIGPROF test on darwin

gopherbot pushed a commit that referenced this issue Oct 9, 2017
Updates #19320.

Change-Id: Id38df033e3f0873986e668c8ff3855b6e08407a9
Reviewed-on: https://go-review.googlesource.com/69114
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017
@gopherbot gopherbot modified the milestones: Go1.11, Unplanned May 23, 2018
@mvdan
Copy link
Member

mvdan commented Mar 22, 2019

Happened on a freebsd-amd64-12_0 trybot run: https://farmer.golang.org/temporarylogs?name=freebsd-amd64-12_0&rev=f424e02578b25cb81ab055a6bd39e86b1f37855a&st=0xc455410000

##### ../misc/cgo/testcarchive
--- FAIL: TestSIGPROF (1.45s)
    carchive_test.go:670: 
    carchive_test.go:671: signal: profiling timer expired
FAIL
2019/03/22 12:26:23 Failed: exit status 1

@bcmills
Copy link
Contributor

bcmills commented Jul 31, 2019

@bcmills bcmills changed the title misc/cgo/testcarchive: failure on Darwin: signal: profiling timer expired misc/cgo/testcarchive: TestSIGPROF flakes with "signal: profiling timer expired" Jul 31, 2019
@bcmills bcmills removed the OS-Darwin label Jul 31, 2019
@odeke-em
Copy link
Member

@ianlancetaylor @bcmills, David Crawshaw seems very busy and had submitted CL https://go-review.googlesource.com/c/go/+/42830 which has been open for more than 2 years. Could someone please take over that CL giving him credit, we can submit the newly created one and abandon his old CL.

@bcmills
Copy link
Contributor

bcmills commented Oct 2, 2019

I don't have the bandwidth to take this on at the moment, but if someone wants to make a run at this I could probably at least find the time to review a fix.

@bcmills
Copy link
Contributor

bcmills commented Oct 4, 2019

@gopherbot
Copy link

Change https://golang.org/cl/200740 mentions this issue: runtime: when disabling SIGPROF handler, ignore SIGPROF

@golang golang locked and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

10 participants