{"action":"created","issue":{"url":"https://api.github.com/repos/mono/mono/issues/1919","labels_url":"https://api.github.com/repos/mono/mono/issues/1919/labels{/name}","comments_url":"https://api.github.com/repos/mono/mono/issues/1919/comments","events_url":"https://api.github.com/repos/mono/mono/issues/1919/events","html_url":"https://github.com/mono/mono/pull/1919","id":93917001,"number":1919,"title":"Add TLS offset for pre-release OS X 10.11 on amd64","user":{"login":"bosmacs","id":71956,"avatar_url":"https://avatars.githubusercontent.com/u/71956?v=3","gravatar_id":"","url":"https://api.github.com/users/bosmacs","html_url":"https://github.com/bosmacs","followers_url":"https://api.github.com/users/bosmacs/followers","following_url":"https://api.github.com/users/bosmacs/following{/other_user}","gists_url":"https://api.github.com/users/bosmacs/gists{/gist_id}","starred_url":"https://api.github.com/users/bosmacs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bosmacs/subscriptions","organizations_url":"https://api.github.com/users/bosmacs/orgs","repos_url":"https://api.github.com/users/bosmacs/repos","events_url":"https://api.github.com/users/bosmacs/events{/privacy}","received_events_url":"https://api.github.com/users/bosmacs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-09T00:05:59Z","updated_at":"2015-07-09T13:07:51Z","closed_at":"2015-07-09T00:19:07Z","pull_request":{"url":"https://api.github.com/repos/mono/mono/pulls/1919","html_url":"https://github.com/mono/mono/pull/1919","diff_url":"https://github.com/mono/mono/pull/1919.diff","patch_url":"https://github.com/mono/mono/pull/1919.patch"},"body":"This pull request may be premature, but I found it necessary to make this patch in order to get mono working on prerelease versions of OS X 10.11 (as of DP3, at least). "},"comment":{"url":"https://api.github.com/repos/mono/mono/issues/comments/119955595","html_url":"https://github.com/mono/mono/pull/1919#issuecomment-119955595","issue_url":"https://api.github.com/repos/mono/mono/issues/1919","id":119955595,"user":{"login":"bosmacs","id":71956,"avatar_url":"https://avatars.githubusercontent.com/u/71956?v=3","gravatar_id":"","url":"https://api.github.com/users/bosmacs","html_url":"https://github.com/bosmacs","followers_url":"https://api.github.com/users/bosmacs/followers","following_url":"https://api.github.com/users/bosmacs/following{/other_user}","gists_url":"https://api.github.com/users/bosmacs/gists{/gist_id}","starred_url":"https://api.github.com/users/bosmacs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bosmacs/subscriptions","organizations_url":"https://api.github.com/users/bosmacs/orgs","repos_url":"https://api.github.com/users/bosmacs/repos","events_url":"https://api.github.com/users/bosmacs/events{/privacy}","received_events_url":"https://api.github.com/users/bosmacs/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T13:07:51Z","updated_at":"2015-07-09T13:07:51Z","body":"I don't think Apple releases sources for pre-release versions of OS X, so I found the offset by trial-and-error: \r\n~~~~c\r\npthread_key_t key;\r\npthread_key_create(&key, NULL);\r\n\r\nvoid *old_value = pthread_getspecific (key);\r\nvoid *canary = (void*)0xDEADBEEFu;\r\n\r\npthread_key_create (&key, NULL);\r\nassert (old_value != canary);\r\n\r\npthread_setspecific (key, canary);\r\n\r\nfor (int i = 0x0; i < 0xFFFF; i++) {\r\n\ttls_vector_offset = i;\r\n\tif (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) {\r\n\t\tprintf(\"TLS offset found: %x\\n\", tls_vector_offset);\r\n\t}\r\n}\r\n\t\r\nprintf(\"TLS offset not found\\n\");\r\n~~~~\r\nI thought my patch was \"safe\" in that if it was working before, it should never reach the new case. The \"could not discover the mach TLS offset\" error is exactly what I was getting on Beta 3 / 15A216g prior to this patch. I just rebuilt master on Beta 3 and `mcs` appears to be working fine. "}}