{"push_id":2964732722,"size":1,"distinct_size":1,"ref":"refs/heads/cpuid","head":"f0e5b8f6bbd0c2b7b0919faa30659005faaf95c5","before":"7cdc682ab0e6c1c5be857cd4b8b173bdbe71defd","commits":[{"sha":"f0e5b8f6bbd0c2b7b0919faa30659005faaf95c5","author":{"name":"Nikhil Benesch","email":"0e70f566aa977bafe6ad237291a2aeff1c9dbb46@gmail.com"},"message":"Don't install signal handler when checking cpuid\n\nAs part of its CPU feature detection, CryptoPP installs a SIGILL signal\nhandler before issuing the cpuid instruction. The intent is to\ngracefully degrade on CPUs that don't support the cpuid instruction.\n\nThe problem is that it is impossible to safely overwrite a signal\nhandler installed by the Go runtime in go1.10 on macOS\n(golang/go#22805). This causes CockroachDB 2.0 to crash on macOS Mojave:\ncockroachdb/cockroach#31380.\n\nThe situation has improved on the Go front, as go1.11 makes it possible\nto safely save and restore signal handlers installed by the Go runtime\non macOS.\n\nStill, we can do better and support go1.10. There is no need to bother\ninstalling a SIGILL handler, as the cpuid instruction is supported by\nevery x86-64 CPU. We can instead use conditional compilation to make\nsure that we never execute a cpuid instruction on a non x86-64 CPU.\n\nNote that CPU feature detection is performed at executable load time\n(see the attribute(constructor) on DetectX86Features); therefore any\nreference to function which calls DetectX86Features (notably HasAESNI)\ncorrupts the signal handler. It's not entirely clear why this corruption\nlater leads to the SIGTRAP seen in cockroachdb/cockroach#31380--is\nsomething in macOS or the Go runtime generating a SIGILL and trying to\nhandle it gracefully?--but regardless, not mucking with the signal\nhandler fixes the issue.","distinct":true,"url":"https://api.github.com/repos/cockroachdb/cryptopp/commits/f0e5b8f6bbd0c2b7b0919faa30659005faaf95c5"}]}
{"actor":{"display_login":"benesch"}}