Memory leaks in OCIEnvCreate()

angela86 walczak angela86.1986 at gmail.com
Tue Oct 13 17:16:27 CEST 2009


Hi,

I'm using Centos x64,  CPU Xeon, and gateway-1.4.3 with oracle DLR,
sqlbox-0.7.2 on oracle, and OCI version:
oracle-instantclient-basic-10.2.0.3-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.3-1.x86_64.rpm
oracle-instantclient-jdbc-10.2.0.3-1.x86_64.rpm
oracle-instantclient-sqlplus-10.2.0.3-1.x86_64.rpm

Application after compiling with OCI has a lot of memory leaks configure
attached at the end of an e-mail
The application works by not communicating the problems but its size is
increased from 12mb to 200mb for example, within a week.
This case is the same as http://www.orafaq.com/forum/t/62399/0/
Tested valgrind bearerbox sqlbox smsbox.
When the test turned off using the applications
http://127.0.0.1:13000/shutdown?password=bar
Request for help how to compile applications that properly had no memory
problems.
Itself after a long time I do not find a solution, once again please help
can you met with such a problem once already.


/etc/init.d/kannel
#!/bin/sh

# Configuration file
CONF=/etc/kannel/kannel.conf
CONFSQL=/etc/kannel/sqlbox.conf
# Kannel boxes
BEARERBOX=/usr/local/sbin/bearerbox
SMSBOX=/usr/local/sbin/smsbox
SQLBOX=/usr/local/sbin/sqlbox

# Debug level: 0..4
DEBUGLEVEL=1

# Kannel user account
USER=kannel

# Check that boxes and config are ok
[ -x $BEARERBOX ] || exit 0
[ -x $SMSBOX ] || exit 0
[ -x $SQLBOX ] || exit 0
[ -f $CONF ] || exit 0

case "$1" in
start)
       ulimit -n 8192
       echo -n "Starting bearerbox... "
       #$BEARERBOX -v $DEBUGLEVEL --daemonize --user $USER $CONF &
       valgrind --tool=memcheck --log-file=/val/1.out -v $BEARERBOX -v
$DEBUGLEVEL --user $USER $CONF &
       echo "done"
       echo -n
       sleep 5

       echo -n "Starting sqlbox... "
       #$SMSBOX -v $DEBUGLEVEL --daemonize --user $USER $CONF &
       valgrind --tool=memcheck --log-file=/val/2.out -v $SQLBOX -v
$DEBUGLEVEL --user $USER $CONFSQL &

       echo "done"
       echo -n
       sleep 7

       echo -n "Starting smsbox... "
       #$SMSBOX -v $DEBUGLEVEL --daemonize --user $USER $CONF &
       valgrind --tool=memcheck --log-file=/val/3.out -v $SMSBOX -v
$DEBUGLEVEL --user $USER $CONF &

       echo "done"

       ;;
stop)

       echo -n "Shutting down sqlbox... "
       killall sqlbox
       echo "done"
       echo -n "Shutting down smsbox... "
       killall smsbox

Summary of large logs have made a valgrind below.

EOF . 1.out

==12915==
==12915== 860 errors in context 255 of 255:
==12915== Conditional jump or move depends on uninitialised value(s)
==12915==    at 0x644907A: CMP_BitLengthOfCMPInt (in /usr/lib/oracle/
10.2.0.3/client64/lib/libnnz10.so)
==12915==    by 0x644ADB7: CMP_CMPIntToFixedLenOctetStr (in /usr/lib/oracle/
10.2.0.3/client64/lib/libnnz10.so)
==12915==    by 0x6446067: A_X931RandomGenerateBytes (in /usr/lib/oracle/
10.2.0.3/client64/lib/libnnz10.so)
==12915==    by 0x5503D21: ztcr2rnd (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12915==    by 0x559577D: ztcsh (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12915==    by 0x5207FB4: kpusattr (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12915==    by 0x51BC959: kpulon (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12915==    by 0x52EAA3F: OCILogon (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12915==    by 0x4727D1: oracle_open_conn (dbpool_oracle.c:199)
==12915==    by 0x471689: dbpool_increase (dbpool.c:186)
==12915==    by 0x471AF3: dbpool_create (dbpool.c:152)
==12915==    by 0x41C683: dlr_init_oracle (dlr_oracle.c:470)
==12915==
--12915--
--12915-- used_suppression:      7 dl-hack3
==12915==
==12915== ERROR SUMMARY: 9369 errors from 255 contexts (suppressed: 7 from
7)


EOF 2.out

==12917== 303 errors in context 254 of 254:
==12917== Conditional jump or move depends on uninitialised value(s)
==12917==    at 0x644907A: CMP_BitLengthOfCMPInt (in /usr/lib/oracle/
10.2.0.3/client64/lib/libnnz10.so)
==12917==    by 0x644ADB7: CMP_CMPIntToFixedLenOctetStr (in /usr/lib/oracle/
10.2.0.3/client64/lib/libnnz10.so)
==12917==    by 0x6446067: A_X931RandomGenerateBytes (in /usr/lib/oracle/
10.2.0.3/client64/lib/libnnz10.so)
==12917==    by 0x5503D21: ztcr2rnd (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12917==    by 0x559577D: ztcsh (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12917==    by 0x5207FB4: kpusattr (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12917==    by 0x51BC959: kpulon (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12917==    by 0x52EAA3F: OCILogon (in /usr/lib/oracle/
10.2.0.3/client64/lib/libclntsh.so.10.1)
==12917==    by 0x41AA41: oracle_open_conn (dbpool_oracle.c:199)
==12917==    by 0x4198F9: dbpool_increase (dbpool.c:186)
==12917==    by 0x419D63: dbpool_create (dbpool.c:152)
==12917==    by 0x40B01D: sqlbox_init_oracle (sqlbox_oracle.c:302)
==12917==
--12917--
--12917-- used_suppression:      7 dl-hack3
==12917==
==12917== ERROR SUMMARY: 3735 errors from 254 contexts (suppressed: 7 from
7)


EOF 3.out

==12930== LEAK SUMMARY:
==12930==    definitely lost: 0 bytes in 0 blocks
==12930==    indirectly lost: 0 bytes in 0 blocks
==12930==      possibly lost: 0 bytes in 0 blocks
==12930==    still reachable: 2,064 bytes in 35 blocks
==12930==         suppressed: 0 bytes in 0 blocks
==12930== Rerun with --leak-check=full to see details of leaked memory
==12930==
==12930== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
==12930==
==12930== 1 errors in context 1 of 1:
==12930== Invalid free() / delete / delete[]
==12930==    at 0x4A05A31: free (vg_replace_malloc.c:325)
==12930==    by 0x3959109B6A: ??? (in /lib64/libc-2.5.so)
==12930==    by 0x3959109761: ??? (in /lib64/libc-2.5.so)
==12930==    by 0x48024E8: _vgnU_freeres (vg_preloaded.c:62)
==12930==    by 0x3959033324: exit (in /lib64/libc-2.5.so)
==12930==    by 0x395901D97A: (below main) (in /lib64/libc-2.5.so)
==12930==  Address 0x62b05a0 is not stack'd, malloc'd or (recently) free'd
==12930==
--12930--
--12930-- used_suppression:      4 dl-hack3
==12930==
==12930== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)


./configure --with-oracle --with-oracle-includes=/usr/include/oracle/
10.2.0.3/client64
--with-oracle-libs=/usr/lib/oracle/10.2.0.3/client64/lib--enable-ssl
--enable-start-stop-daemon --enable-debug

Configuring for Kannel gateway version 1.4.3 ...

Running system checks ...
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... -std=gnu99
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for bison... no
checking for byacc... no
checking for flex... no
checking for lex... no
checking for ar... ar
checking for convert... /usr/bin/convert
checking for perl... /usr/bin/perl
checking for inline... inline
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of short... 2
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking for log in -lm... yes
checking for accept in -lsocket... no
checking for inet_ntoa in -lnsl... yes
checking for inet_ntop in -lresolv... yes
checking for inet_ntop in -lbind... no
checking for pthread_exit in -lpthread... yes
checking for libiconv in -liconv... yes
checking for ANSI C header files... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for stdlib.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for net/if.h... yes
checking for gettimeofday... yes
checking for select... yes
checking for socket... yes
checking for strdup... yes
checking for getopt_long... yes
checking for localtime_r... yes
checking for gmtime_r... yes
checking for backtrace... yes
checking for srandom... yes
checking for getopt... yes
checking for gethostbyname_r... yes
checking for which type of gethostbyname_r... 6
checking for socklen_t in <sys/socket.h>... yes
checking for getopt in <stdio.h>... no
checking for getopt in <unistd.h>... yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking for regcomp... yes

Checking for POSIX threads support ...
checking for working pthreads... yes
checking for pthread_spinlock support... yes
checking for pthread_rwlock support... yes
checking for sem_init in -lrt... yes
checking for semaphore support... yes

Checking for libxml2 support ...
checking for xml2-config... /usr/bin/xml2-config
checking libxml version... 2.6.26

Configuring for PCRE support ...
checking whether to compile with PCRE support... disabled

Configuring DocBook support ...
checking for jade... no
checking for jadetex... no
checking for pdfjadetex... pdfjadetex
checking for dvips... dvips
checking for fig2dev... no
checking for convert... /usr/bin/convert
checking for
/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl... no
checking for /usr/lib/sgml/stylesheets/nwalsh-modular/html/docbook.dsl... no
checking for
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/html/docbook.dsl... yes
checking for
/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl... no
checking for /usr/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl...
no
checking for
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/print/docbook.dsl... yes
Not building documentation.

Configuring parameters ...
checking which malloc to use... native malloc
enabling WMLScript compiler debugging
enabling local time
enabling cookies
enabling HTTP/1.1 keep-alive

Configuring OpenSSL support ...
checking whether to compile with SSL support... trying /usr/lib64
/usr/include/openssl
checking for openssl... /usr/bin/openssl
checking for CRYPTO_lock in -lcrypto... yes
checking for SSL_library_init in -lssl... yes
checking for SSL_connect in -lssl... yes
checking openssl/x509.h usability... yes
checking openssl/x509.h presence... yes
checking for openssl/x509.h... yes
checking openssl/rsa.h usability... yes
checking openssl/rsa.h presence... yes
checking for openssl/rsa.h... yes
checking openssl/crypto.h usability... yes
checking openssl/crypto.h presence... yes
checking for openssl/crypto.h... yes
checking openssl/pem.h usability... yes
checking openssl/pem.h presence... yes
checking for openssl/pem.h... yes
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking openssl/hmac.h usability... yes
checking openssl/hmac.h presence... yes
checking for openssl/hmac.h... yes
checking whether the OpenSSL library is multithread-enabled... yes
checking whether to compile with SSL support... yes

Configuring DB support ...
checking whether to compile with MySQL support... disabled
checking whether to compile with LibSDB support... disabled
checking whether to compile with SQLite2 support... disabled
checking whether to compile with SQLite3 support... disabled
checking whether to compile with Oracle support... searching
checking for oci.h ... yes
checking for OCIEnvCreate in -lclntsh... yes
checking for wtcstu in -lwtc8... no
checking for wtcstu in -lwtc9... no
checking whether to compile with Oracle support... yes
checking whether to compile with PostgresSQL support... disabled

Generating output files ...
configure: creating ./config.status
config.status: creating gwlib/gw_uuid_types.h
config.status: creating Makefile
config.status: creating gw-config.h
config.status: gw-config.h is unchanged

License information ...
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the Kannel Software License, available |
| in this distribution in the file LICENSE. By continuing this       |
| installation process, you are bound by the terms of this license   |
| agreement. If you do not agree with the terms of this license, you |
| must abort the installation process at this point.                 |
|                                                                    |
|                      The Kannel Group <http://www.kannel.org/>     |
+--------------------------------------------------------------------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.kannel.org/pipermail/devel/attachments/20091013/d7753c02/attachment-0001.html>


More information about the devel mailing list