[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Oracle10g issue - times() call fails




Arjan van de Ven wrote:
5
times(NULL)                             = -2147233465

the times(2) man page says that "This return value may overflow the possible range of type clock_t" (for the layman it seems weird that after the system has been up for a while a system call becomes unusable).

clock_t seems to be represented by a 32 bit signed integer which would mean that it should overflow after the counter exceeds 2^31.

doing a little experimenting on RHEL 3 i learned that you can very closely get the clock tick counter value as reported by times() by multiplying the value from /proc/uptime by 100 (sysconf(_SC_CLK_TCK)) which seems to imply that the counter starts from zero after the system is booted.

on RHEL 4 the counter value seems to start at around 429450369 which would correspond to approximately 50 days of uptime (1 day = 24*60*60*100). this would mean that the counter overflows after ~198 days and 19 hours of uptime.

here's what the system uptime reported at the time when we observed the failure:

12:51:33 up 198 days, 21:10, 5 users, load average: 14.46, 13.76, 13.37

contrary to what the times(2) man page says, errno was set to 0 after an error return from times().


hmm I didn't know a times() with NULL argument is legal..

looking at the times(2) man page calling it with NULL doesn't seem too legal:

"The times() function stores the current process times in the struct tms that buf points to."

RHEL 4 seems to tolerate this sort of sloppiness unlike HP-UX 11i v1 and Solaris 8 on which times() returns with an error.


--
	aspa


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]