-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
PIE mode tests with fibers #387
base: main
Are you sure you want to change the base?
Conversation
huh, interesting... I cannot reproduce this.
haven't gotten a single failure. \o/ I got nothin. |
oh wait, these tests are different. |
Looks like this might be a good work-around for non-alpine 8.3 builds. |
It looks like it still fails on Debian too. |
@@ -48,11 +48,11 @@ jobs: | |||
run: go build | |||
- | |||
name: Run library tests | |||
run: go test -race -v ./... | |||
run: CGO_CXXFLAGS=-fPIE CGO_CFLAGS=-fPIE CGO_LDFLAGS=-pie go test -buildmode=pie -v ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to preserve the previous values of these env vars (set line 37). Same in the Docker images.
It looks like this way of linking just so happens to lay out the memory in such a way that sometimes (if not most of the time), the fiber stack stays within the bounds of Go's stack. So, instead of a guaranteed explosion, you just randomly get explosions. In practice, I'm not seeing any explosions, but I think the tests sometimes passing/failing illustrates that the possibility is there. |
Running
CGO_CXXFLAGS=-fPIE CGO_CFLAGS=-fPIE CGO_LDFLAGS=-pie go test -buildmode=pie -v ./...
(-race
is not compatible withpie
) appears to be passing tests on x64 (local). Opening this PR to have it test all other architectures as well.I have no idea why this works and it might be an excellent question for golang/go/#62130 to see if it is actually working or just pretending to work by somehow making a larger stack that just so happens to pass the test.
Continuation of #99, #171. Closes #46, closes #99, closes #171.