frankenphp
frankenphp copied to clipboard
PIE mode tests with fibers
Running CGO_CXXFLAGS=-fPIE CGO_CFLAGS=-fPIE CGO_LDFLAGS=-pie go test -buildmode=pie -v ./... (-race is not compatible with pie) 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.
huh, interesting... I cannot reproduce this.
go clean -testcache
CGO_CXXFLAGS=-fPIE CGO_CFLAGS=-fPIE CGO_LDFLAGS=-pie go test -buildmode=pie -v ./...
# goto 0
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.
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.