nanosleep returns prematurely, with return value 0

Hi,

I have encountered the following problem on Solaris 10:

I have a thread that is asleep on nanosleep (set to 24 hours).

Something that happens on another thread, causes the nanosleep to exit, even though the time has not elapsed.
The returned value is 0 (so it doesn't look like it wakes due to a signal, at least according to the man pages).

The action on the other thread that triggers the nanosleep wake seems to be a TCP connection being established.
Also, it's possible that it happens only when 2 different TCP connections are being established concurrently in 2 other threads.

Obviously some actions are taken by the other threads when a connection is made, including various socket and network calls, like accept(), select(), inet_addr(), inet_ntoa(), gethostbyname(), etc. But I don't see how any of it can be related to the nanosleep() waking.

My questions are:

  • What could make nanosleep return ahead of time and return 0?

  • Can a memory override possibly make this happen?

Any insight, direction or idea would be greatly appriciated!

Thanks.

Source code for nanosleep() can be viewed in the OpenSolaris source code repository.
The relevant file is .../src/uts/common/os/timers.c.