-
Notifications
You must be signed in to change notification settings - Fork 18k
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
runtime: build broken on OpenBSD #4878
Labels
Milestone
Comments
It is possible to tell whether tcp_fixup has run already. Check whether the first word of the TCP points at itself. Before tcp_fixup, it does. Afterward, it does not. The signal handler can use this to decide whether there is a valid m and g worth loading. The new "run Go on C threads" code can do the same. That should eliminate the need for the pthread_create hook hack. Let's do that anyway. I've never felt completely comfortable trying to replace pthread_create. |
Also, this is probably a mistake: // The main thread TCB is a static allocation - do not try to free it. if(!mainthread) free(oldtcb); The pointer I was talking about that points at itself is the first word of the main tcb. In the copy, it still points at the old tcb. Freeing the old tcb creates a dangling pointer. I don't know what looks at it, but probably something does. Or if nothing does, we could set that word to something faulty like 1 to mark that it is a "Go" tcb. |
Hi Russ, amd64 and i386 port of OpenBSD use the large variant of TCB which has the self pointer you described (http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/i386/include/tcb.h?rev=HEAD;content-type=text%2Fplain and http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/amd64/include/tcb.h?rev=HEAD;content-type=text%2Fplain) however arm uses the small tls (http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/arm/include/tcb.h?rev=HEAD;content-type=text%2Fplain). See here for definition of tcb: http://www.openbsd.org/cgi-bin/cvsweb/src/lib/librthread/tcb.h?rev=HEAD;content-type=text%2Fplain i searched /usr/src for __tcb_self, and i don't find any explicit references to it in the code, @jsing, do you agree with the plan to use a bad __tcb_self to signify a Go tcb? |
Issue #4957 has been merged into this issue. |
This issue was closed by revision 960d708. Status changed to Fixed. |
Closed
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: