-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Fallback not used when clock_gettime is unavailable (crash on OSX < 10.12) #1576
Comments
So the workaround is to set NNG_USE_GETTIMEOFDAY. I need to see if I can convince CMake of this. I expect what is happening is that we are detecting a clock_gettime() symbol on macOS versions that are old, but that the implementation is defective. (I.e. compile time checks find it, but at run time it doesn't work. :( |
well maybe... I do see that we aren't using the check for NNG_HAVE_CLOCKGETTIME. |
Btw, we are likely to retire support for such old versions of macOS. Pretty much everyone dropping support for macOS versions more than 5 years old. Go dropped support for 10.15 almost a year ago. (Meaning you need macOS 11 -- Big Sur -- or better.) On the one hand, I'm unlikely to go far out of my way to intentionally break compatibility with an older OS, but I am also unlikely to go far out of my way supporting an old OS. Right now Apple is only providing support for macOS 12 and newer. A similar situation exists with Windows and to a lesser extent some Linux distributions. |
Describe the bug
The POSIX implementation of NNG uses
clock_gettime
which is not available on old versions of Mac OS X. The Mac OS X Deployment Target has no bearing on this behavior.Expected behavior
Mac OS X Deployment Targets less than 10.12 should enable the
NNG_USE_GETTIMEOFDAY
macro which enables a less performant fallback implementation.Actual Behavior
NNG's CMake files make no reference to NNG_USE_GETTIMEOFDAY. POSIX builds will always use
clock_gettime
regardless of its availability.To Reproduce
Configure and build NNG with a Mac OS X deployment target of 10.11 or lower. Alternatively, configure NNG to build on a POSIX platform lacking
clock_gettime
.Run a test application in a debugger, with a breakpoint on
nni_clock
. Take note of the code that is executed there.** Environment Details **
The text was updated successfully, but these errors were encountered: