Valery's Mlog

Mindlog of a Freak
July 30th, 2006 by Valery Dachev

Oracle Bug with times()

I’ve just installed Oracle Client on some machines and came accross an interesting bug with some tools (sqlplus, exp, etc.) hanging. It affects all systems with high uptime (according to the latest times() manual this time may vary depending on the OS and the kernel version) and installed. It turns out that it is a known bug and it has been discussed in Oracle’s Instant Client forum back in October 2006. However this bug seems to be reintroduced (as such bugs existed in previous versions of different Oracle products) in the full Oracle Database 10g Client version Here is how you can recognize this problem (on Linux): install the strace utility and execute sqlplus the way you do it usually, but through strace. For example:

strace sqlplus / as sysdba 2> sqlplus.log

and press Ctrl+C after a few seconds. Take a look at sqlplus.log and you find something like this:

open("/home/oracle/client/rdbms/mesg/ocius.msb", O_RDONLY) = 6
fcntl64(6, F_SETFD, FD_CLOEXEC)         = 0
lseek(6, 0, SEEK_SET)                   = 0
read(6, "\\25\\23\\"\\1\\23\\3\\t\\t\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 256) = 256
lseek(6, 512, SEEK_SET)                 = 512
read(6, "\\337y\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 512) = 512
lseek(6, 1024, SEEK_SET)                = 1024
read(6, "\\25\\7\\'\\0072\\7>\\7j\\7\\276\\17$\\'\\6K5S\\24TfT\\307T(VsV\\222"..., 86) = 86
brk(0x80ad000)                          = 0x80ad000
times(NULL)                             = -1850439679
times(NULL)                             = -1850439679
times(NULL)                             = -1850439679
times(NULL)                             = -1850439679
times(NULL)                             = -1850439679
times(NULL)                             = -1850439679
times(NULL)                             = -1850439679
times(NULL)                             = -1850439679

you definitely have a problem. A temporary workaround is to reboot your system (which I wouldn’t because of an… Oracle (yuck !). Back in October Oracle promised to fix this bug in but it’s not been released by now (except for z/Linux and z/OS). However patches for are available at Oracle MetaLink.

UPDATE: It turned out that this problem exists in all the tools and libraries that use the libclntsh library. This includes the oci8 PHP extension. You’re urged to upgrade or reboot your system. :)


3 Responses to “Oracle Bug with times()”
  1. This issue is still present on some old servers.
    Hope nobody will read this, otherwise – reboot and patch!

  2. dermaniac says

    Hi from the future!Just encountered this issue with an old Oracle server that can’t be upgraded or patched. Woohoo! Took me half the day to figure it out to get from “Why is this webapp not responding?” to “Why can’t I connect to Oracle?” to “Why is the listener not responding?” to “Why can’t I restart the listener?” to “Why is sqlplus hanging even if I do /NOLOG?” to coming to this post after I ran “ftrace sqlplus sys as sydba” and saw that it got stuck in a loop of calling TIME(NULL)…

    Since Oracle won’t give out patches without a support contract any more all that’s left for me to do is set up a cronjob that sends an e-mail to the admins to let them know the system needs a reboot after 200 days :-/

  3. @demaniac, hello there! :) What you said sounds to be one of the reasons I’m no longer running any Oracle databases (and I suggest you migrate your system to some other RDBMS). What you can do right now however is start googling for some mirrored packages for your system. Or, if the uptime of the system is critical, run a second switchover server and get both of them reboot every 200 days, but not at the same time.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: