gettimeofday segfaults when called from a shared library
|Reported by:||Owned by:||axeld|
|Has a Patch:||no||Platform:||All|
Trying to track down firefox starting issues brought me to this. I'll attach a simple test app after opening the bug.
If a shared library function calls gettimeofday (in sys/time.h, function in libroot I think), and an application which links to the library calls the library function, a segfault occurs. The same app works fine under R5. Interestingly, the call actually returns the correct value before the segfault happens (in the test app the value is displayed before the crash).
I thought this may be an issue with shared libraries calling functions in other shared libraries but setting up a test app where main() calls a function in lib1, which calls a function in lib2 to get a value to return, worked correctly. It also doesn't apply to all libroot functions, calling snooze from the shared lib also works fine.
I suspect it's the runtime loader that doesn't correctly initialise something when dynamically linking a shared library to another shared library. Then again, it might just be something perculiar about the gettimeofday function.