-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/dist: get testcarchive working on iOS #8345
Comments
misc/cgo tests breakdown: misc/cgo/stdio, misc/cgo/life aren't important, they are just cgo examples; misc/cgo/test: the most important one, shouldn't be too hard to run; misc/cgo/testcdefs: should be covered by other systems; misc/cgo/testso: test cgo could link dynamic libraries, covered by normal android cgo usage; misc/cgo/testasan: not relevant on 32-bit systems; misc/cgo/errors: covered by other systems. In summary: we need to run misc/cgo/test and various crash tests from runtime. I don't think we need to modify test/run.go. |
For iOS, this is very close to working. The sticking point is TestCthread:
This is a slightly gnarlier version of #10043. In this instance, our EXC_BAD_ACCESS handler isn't be activated because the cgo callback is being run on a foreign thread. For foreign threads we have never had an opportunity to grab the mach_task_port. One potential solution is to steal the pthread_create symbol and register the task port then. |
This CL updates a TODO on a condition excluding a lot of tests on android, clarifying what needs to be done. Several of the tests should be turned off, for example anything depending on the Go tool, others should be enabled. (See #8345, comment 3 for more details.) Also add iOS, which has the same set of restrictions. Tested manually on linux/amd64, darwin/amd64, android/arm, darwin/arm. Updates #8345 Change-Id: I147f0a915426e0e0de9a73f9aea353766156609b Reviewed-on: https://go-review.googlesource.com/7734 Reviewed-by: Burcu Dogan <[email protected]>
The cgo test is probably the most important test that should be run on iOS.
(If I have to choose a subset of test on iOS, I'd choose runtime, sync, cgo,
os, math, net, and net/http to always run, and happily ignore all the
others.)
That said, I don't like the idea of overriding pthread_create even though
I'm
the one that proposed the same idea to implement cgo on OpenBSD and it's
how cgo works on OpenBSD despite the fact that the OS doesn't natively
support TLS.
The reason is that it's probably too risky to override such fundamental
functions
when the binary is subject to review by the App store. In fact, I think
we'd better
remove the task port code as well when building the release binary. (add a
TODO for cmd/gomobile?)
There is a way to install the task_port for foreign threads, because that
test
want to test that recover on foreign threads can still recover from SIGSEGV,
we can do the task_port installation at cgocallback time when we detected
that we're being called on a foreign thread.
|
CL https://golang.org/cl/9891 mentions this issue. |
CL https://golang.org/cl/6823 mentions this issue. |
CL https://golang.org/cl/9890 mentions this issue. |
Many tests now run, but there's still a few more that would be nice. Punting what's left to 1.6. |
CL https://golang.org/cl/21102 mentions this issue. |
The text was updated successfully, but these errors were encountered: