Hello,
A simple OCI program doing OCIEnvCreate() fails from time to time...
It can be reproduced on:
Darwin orange.strasbourg.4js.com 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64
But not on:
Darwin melon.strasbourg.4js.com 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct 5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
Using same Oracle client lib on both machines:
ORANGE:
f4gl@orange sf % otool -L ./ocitest1.bin
./ocitest1.bin:
@rpath/libclntsh.dylib.18.1 (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
f4gl@orange sf % sum /usr/local/lib/libclntsh.dylib.18.1
57049 92741 /usr/local/lib/libclntsh.dylib.18.1
MELON:
melon:sf comp$ otool -L ./ocitest1.bin
./ocitest1.bin:
@rpath/libclntsh.dylib.18.1 (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
melon:sf comp$ sum /usr/local/lib/libclntsh.dylib.18.1
57049 92741 /usr/local/lib/libclntsh.dylib.18.1
Also tested on ORANGE with Oracle 19c:
f4gl@orange sf % install_name_tool -change @rpath/libclntsh.dylib.18.1 @rpath/libclntsh.dylib.19.1 ocitest1.bin
f4gl@orange sf % otool -L ./ocitest1.bin
./ocitest1.bin:
@rpath/libclntsh.dylib.19.1 (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
f4gl@orange sf % ls -l /usr/local/lib/libclntsh.dylib.19.1
lrwxr-xr-x 1 root wheel 51 Nov 12 11:21 /usr/local/lib/libclntsh.dylib.19.1 -> /usr/local/dbs/64bits/ora/19.3/libclntsh.dylib.19.1
f4gl@orange sf % sum /usr/local/lib/libclntsh.dylib.19.1
47022 95838 /usr/local/lib/libclntsh.dylib.19.1
To reproduce with ocitest1.c:
$ gcc -o ocitest1.bin ocitest1.c -I $ORACLE_HOME/sdk/include -L$ORACLE_HOME -lclntsh
$ while true; do ./ocitest1.bin UTF8112.STRASBOURG.4JS.COM orauser xxxxxxxxxx || break; done
Sometimes it fails in parent process:
... Parent... 65089
Error -1 at: Could not allocate env handle
>> Could not get Oracle error.
Sometimes in child process:
Parent... 68829
SQL Session connected...
Child... 68830
Error -1 at: Could not allocate env handle
>> Could not get Oracle error.
Child has failed!
Just in case:
f4gl@orange sf % ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-v: address space (kbytes) unlimited
-l: locked-in-memory size (kbytes) unlimited
-u: processes 2784
-n: file descriptors 4096