src/dblib/unittests/t0007

Main

Hostnameobol602
uname -aLinux obol602 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
date2009-11-23

==1141== Memcheck, a memory error detector
==1141== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==1141== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright info
==1141== Command: ./t0007
==1141== 
--1141-- Valgrind options:
--1141--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--1141--    --tool=memcheck
--1141--    --num-callers=20
--1141--    --leak-check=yes
--1141--    -v
--1141--    --show-reachable=yes
--1141--    --log-fd=3
--1141--    --suppressions=/home/freddy/suppressions.supp
--1141-- Contents of /proc/version:
--1141--   Linux version 2.6.31-14-generic (buildd@crested) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) ) #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009
--1141-- Arch and hwcaps: AMD64, amd64-sse3-cx16
--1141-- Page sizes: currently 4096, max supported 4096
--1141-- Valgrind library directory: /usr/lib/valgrind
--1141-- Reading syms from /home/freddy/cpp/freetds/ftds_comp82/src/dblib/unittests/t0007 (0x400000)
--1141-- Reading syms from /lib/ld-2.10.1.so (0x4000000)
--1141-- Reading debug info from /lib/ld-2.10.1.so ..
--1141-- .. CRC mismatch (computed 27e0048f wanted 447ba3bc)
--1141-- Reading debug info from /usr/lib/debug/lib/ld-2.10.1.so ..
--1141-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux (0x38000000)
--1141--    object doesn't have a dynamic symbol table
--1141-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--1141-- Reading suppressions file: /home/freddy/suppressions.supp
--1141-- Reading suppressions file: /usr/lib/valgrind/default.supp
--1141-- REDIR: 0x4017050 (strlen) redirected to 0x3803fa17 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--1141-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so (0x4a20000)
--1141-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so (0x4c22000)
==1141== WARNING: new redirection conflicts with existing -- ignoring it
--1141--     new: 0x04017050 (strlen              ) R-> 0x04c26210 strlen
--1141-- REDIR: 0x4016ec0 (index) redirected to 0x4c25f60 (index)
--1141-- REDIR: 0x4016f40 (strcmp) redirected to 0x4c26510 (strcmp)
--1141-- Reading syms from /home/freddy/cpp/freetds/ftds_comp82/src/dblib/.libs/libsybdb.so.5.0.0 (0x4e2a000)
--1141-- Reading syms from /lib/librt-2.10.1.so (0x50ea000)
--1141-- Reading debug info from /lib/librt-2.10.1.so ..
--1141-- .. CRC mismatch (computed e0bf5db1 wanted 745ed498)
--1141-- Reading debug info from /usr/lib/debug/lib/librt-2.10.1.so ..
--1141-- Reading syms from /usr/lib/libgnutls.so.26.14.10 (0x52f2000)
--1141-- Reading debug info from /usr/lib/libgnutls.so.26.14.10 ..
--1141-- .. CRC mismatch (computed e962bb1e wanted 1627984e)
--1141-- Reading debug info from /usr/lib/debug/usr/lib/libgnutls.so.26.14.10 ..
--1141-- Reading syms from /lib/libpthread-2.10.1.so (0x5594000)
--1141-- Reading debug info from /lib/libpthread-2.10.1.so ..
--1141-- .. CRC mismatch (computed 217e8639 wanted 7a12e000)
--1141-- Reading debug info from /usr/lib/debug/lib/libpthread-2.10.1.so ..
--1141-- Reading syms from /lib/libc-2.10.1.so (0x57b0000)
--1141-- Reading debug info from /lib/libc-2.10.1.so ..
--1141-- .. CRC mismatch (computed 9003397f wanted a4efd6e8)
--1141-- Reading debug info from /usr/lib/debug/lib/libc-2.10.1.so ..
--1141-- Reading syms from /usr/lib/libtasn1.so.3.1.5 (0x5b1f000)
--1141-- Reading debug info from /usr/lib/libtasn1.so.3.1.5 ..
--1141-- .. CRC mismatch (computed 9c17bda6 wanted d502479b)
--1141--    object doesn't have a symbol table
--1141-- Reading syms from /lib/libz.so.1.2.3.3 (0x5d30000)
--1141-- Reading debug info from /lib/libz.so.1.2.3.3 ..
--1141-- .. CRC mismatch (computed 3957eb9d wanted 90f25be3)
--1141--    object doesn't have a symbol table
--1141-- Reading syms from /lib/libgcrypt.so.11.5.2 (0x5f47000)
--1141-- Reading debug info from /lib/libgcrypt.so.11.5.2 ..
--1141-- .. CRC mismatch (computed 77ef73e7 wanted f3b95632)
--1141-- Reading debug info from /usr/lib/debug/lib/libgcrypt.so.11.5.2 ..
--1141-- Reading syms from /lib/libgpg-error.so.0.4.0 (0x61bf000)
--1141-- Reading debug info from /lib/libgpg-error.so.0.4.0 ..
--1141-- .. CRC mismatch (computed 5580a1c2 wanted 3127cddf)
--1141--    object doesn't have a symbol table
--1141-- REDIR: 0x582f7e0 (rindex) redirected to 0x4c25dc0 (rindex)
--1141-- REDIR: 0x582f3b0 (strlen) redirected to 0x4c261d0 (strlen)
--1141-- REDIR: 0x582a780 (malloc) redirected to 0x4c250d1 (malloc)
--1141-- REDIR: 0x58324c0 (memcpy) redirected to 0x4c265e0 (memcpy)
--1141-- REDIR: 0x582ee20 (strcmp) redirected to 0x4c264c0 (strcmp)
--1141-- REDIR: 0x5831020 (memset) redirected to 0x4c27080 (memset)
--1141-- REDIR: 0x582ee60 (strcpy) redirected to 0x4c26230 (strcpy)
--1141-- REDIR: 0x58308d0 (memchr) redirected to 0x4c265b0 (memchr)
--1141-- REDIR: 0x582a6a0 (free) redirected to 0x4c24ce1 (free)
--1141-- REDIR: 0x5834e90 (strchrnul) redirected to 0x4c27160 (strchrnul)
found TESTSRV.test for test in "../../../PWD"
Start
--1141-- REDIR: 0x5829d70 (calloc) redirected to 0x4c243c9 (calloc)
About to logon
About to open
--1141-- REDIR: 0x5830950 (bcmp) redirected to 0x4c26d70 (bcmp)
--1141-- REDIR: 0x5831b50 (mempcpy) redirected to 0x4c271b0 (mempcpy)
--1141-- REDIR: 0x5832170 (stpcpy) redirected to 0x4c26e10 (stpcpy)
--1141-- Reading syms from /lib/libnss_compat-2.10.1.so (0x67c3000)
--1141-- Reading debug info from /lib/libnss_compat-2.10.1.so ..
--1141-- .. CRC mismatch (computed 87a816bf wanted 753a1f07)
--1141-- Reading debug info from /usr/lib/debug/lib/libnss_compat-2.10.1.so ..
--1141-- Reading syms from /lib/libnsl-2.10.1.so (0x69cc000)
--1141-- Reading debug info from /lib/libnsl-2.10.1.so ..
--1141-- .. CRC mismatch (computed 3749f1e8 wanted 750c9fd1)
--1141-- Reading debug info from /usr/lib/debug/lib/libnsl-2.10.1.so ..
--1141-- Reading syms from /lib/libnss_nis-2.10.1.so (0x6be6000)
--1141-- Reading debug info from /lib/libnss_nis-2.10.1.so ..
--1141-- .. CRC mismatch (computed 2839fa35 wanted 4fda88b3)
--1141-- Reading debug info from /usr/lib/debug/lib/libnss_nis-2.10.1.so ..
--1141-- Reading syms from /lib/libnss_files-2.10.1.so (0x6df1000)
--1141-- Reading debug info from /lib/libnss_files-2.10.1.so ..
--1141-- .. CRC mismatch (computed 1e8ecf79 wanted 95e01138)
--1141-- Reading debug info from /usr/lib/debug/lib/libnss_files-2.10.1.so ..
--1141-- REDIR: 0x582eda0 (index) redirected to 0x4c25e60 (index)
--1141-- REDIR: 0x582f580 (strncmp) redirected to 0x4c26450 (strncmp)
--1141-- REDIR: 0x582f660 (strncpy) redirected to 0x4c26300 (strncpy)
--1141-- REDIR: 0x5834e30 (rawmemchr) redirected to 0x4c27190 (rawmemchr)
--1141-- Reading syms from /usr/lib/gconv/ISO8859-1.so (0x6ffe000)
--1141-- Reading debug info from /usr/lib/gconv/ISO8859-1.so ..
--1141-- .. CRC mismatch (computed cb3aff31 wanted 2fb673ac)
--1141-- Reading debug info from /usr/lib/debug/usr/lib/gconv/ISO8859-1.so ..
--1141-- REDIR: 0x4017ae0 (stpcpy) redirected to 0x4c26fb0 (stpcpy)
--1141-- REDIR: 0x582b4c0 (realloc) redirected to 0x4c25182 (realloc)
--1141-- REDIR: 0x582ebe0 (strcat) redirected to 0x4c25fa0 (strcat)
--1141-- REDIR: 0x58324b0 (__memcpy_chk) redirected to 0x4c276d0 (__memcpy_chk)
--1141-- REDIR: 0x58a5460 (__strcpy_chk) redirected to 0x4c27830 (__strcpy_chk)
--1141-- REDIR: 0xffffffffff600400 (???) redirected to 0x3803fa0d (vgPlain_amd64_linux_REDIR_FOR_vtime)
--1141-- REDIR: 0xffffffffff600000 (???) redirected to 0x3803fa03 (vgPlain_amd64_linux_REDIR_FOR_vgettimeofday)
--1141-- REDIR: 0x5830e60 (memmove) redirected to 0x4c270f0 (memmove)
--1141-- Reading syms from /usr/lib/gconv/CP1252.so (0x7201000)
--1141-- Reading debug info from /usr/lib/gconv/CP1252.so ..
--1141-- .. CRC mismatch (computed 15399baf wanted 55096056)
--1141-- Reading debug info from /usr/lib/debug/usr/lib/gconv/CP1252.so ..
creating table
insert
insert into #dblib0007 values (1, 'row 0000001')
insert into #dblib0007 values (2, 'row 0000002')
insert into #dblib0007 values (3, 'row 0000003')
insert into #dblib0007 values (4, 'row 0000004')
insert into #dblib0007 values (5, 'row 0000005')
insert into #dblib0007 values (6, 'row 0000006')
insert into #dblib0007 values (7, 'row 0000007')
insert into #dblib0007 values (8, 'row 0000008')
insert into #dblib0007 values (9, 'row 0000009')
select * from #dblib0007 where i<=5 order by i
col 1 is i
col 2 is s
Read a row of data -> 1 row 0000001 
Read a row of data -> 2 row 0000002 
second select.  Should fail.
select * from #dblib0007 where i>=5 order by i
OK: anticipated error 20019 (Attempt to initiate a new Adaptive Server operation with results pending) arrived
dblib okay on t0007.c
--1141-- Discarding syms at 0x72014d0-0x7202298 in /usr/lib/gconv/CP1252.so due to munmap()
--1141-- Discarding syms at 0x6ffe4d0-0x6fff058 in /usr/lib/gconv/ISO8859-1.so due to munmap()
--1141-- Discarding syms at 0x67c4310-0x67c92c8 in /lib/libnss_compat-2.10.1.so due to munmap()
--1141-- Discarding syms at 0x6be8020-0x6bee4a8 in /lib/libnss_nis-2.10.1.so due to munmap()
--1141-- Discarding syms at 0x69d00c0-0x69dd978 in /lib/libnsl-2.10.1.so due to munmap()
--1141-- Discarding syms at 0x6df3170-0x6dfab68 in /lib/libnss_files-2.10.1.so due to munmap()
==1141== 
==1141== HEAP SUMMARY:
==1141==     in use at exit: 3,356 bytes in 49 blocks
==1141==   total heap usage: 3,576 allocs, 3,527 frees, 680,893 bytes allocated
==1141== 
==1141== Searching for pointers to 49 not-freed blocks
==1141== Checked 244,232 bytes
==1141== 
==1141== 240 bytes in 5 blocks are still reachable in loss record 11 of 16
==1141==    at 0x4C25153: malloc (vg_replace_malloc.c:195)
==1141==    by 0x5F516F0: do_malloc (global.c:737)
==1141==    by 0x5F518F8: _gcry_malloc (global.c:759)
==1141==    by 0x5F564D0: _gcry_module_add (module.c:88)
==1141==    by 0x5F5AC1F: pk_register_default (pubkey.c:216)
==1141==    by 0x5F5B07E: _gcry_pk_init (pubkey.c:2598)
==1141==    by 0x5F51BB4: global_init (global.c:105)
==1141==    by 0x5F51DF5: _gcry_check_version (global.c:222)
==1141==    by 0x531DCE9: gnutls_global_init (gnutls_global.c:194)
==1141==    by 0x4EA79BF: tds_ssl_init (net.c:1098)
==1141==    by 0x4E7AD83: tds8_do_login (login.c:1025)
==1141==    by 0x4E78083: tds_connect (login.c:433)
==1141==    by 0x4E39FDE: tdsdbopen (dblib.c:1145)
==1141==    by 0x402324: main (t0007.c:104)
==1141== 
==1141== 624 bytes in 13 blocks are still reachable in loss record 13 of 16
==1141==    at 0x4C25153: malloc (vg_replace_malloc.c:195)
==1141==    by 0x5F516F0: do_malloc (global.c:737)
==1141==    by 0x5F518F8: _gcry_malloc (global.c:759)
==1141==    by 0x5F564D0: _gcry_module_add (module.c:88)
==1141==    by 0x5F634E3: md_register_default (md.c:188)
==1141==    by 0x5F636CE: _gcry_md_init (md.c:1291)
==1141==    by 0x5F51BA8: global_init (global.c:102)
==1141==    by 0x5F51DF5: _gcry_check_version (global.c:222)
==1141==    by 0x531DCE9: gnutls_global_init (gnutls_global.c:194)
==1141==    by 0x4EA79BF: tds_ssl_init (net.c:1098)
==1141==    by 0x4E7AD83: tds8_do_login (login.c:1025)
==1141==    by 0x4E78083: tds_connect (login.c:433)
==1141==    by 0x4E39FDE: tdsdbopen (dblib.c:1145)
==1141==    by 0x402324: main (t0007.c:104)
==1141== 
==1141== 864 bytes in 18 blocks are still reachable in loss record 16 of 16
==1141==    at 0x4C25153: malloc (vg_replace_malloc.c:195)
==1141==    by 0x5F516F0: do_malloc (global.c:737)
==1141==    by 0x5F518F8: _gcry_malloc (global.c:759)
==1141==    by 0x5F564D0: _gcry_module_add (module.c:88)
==1141==    by 0x5F585B1: cipher_register_default (cipher.c:301)
==1141==    by 0x5F587EE: _gcry_cipher_init (cipher.c:1873)
==1141==    by 0x5F51B9F: global_init (global.c:99)
==1141==    by 0x5F51DF5: _gcry_check_version (global.c:222)
==1141==    by 0x531DCE9: gnutls_global_init (gnutls_global.c:194)
==1141==    by 0x4EA79BF: tds_ssl_init (net.c:1098)
==1141==    by 0x4E7AD83: tds8_do_login (login.c:1025)
==1141==    by 0x4E78083: tds_connect (login.c:433)
==1141==    by 0x4E39FDE: tdsdbopen (dblib.c:1145)
==1141==    by 0x402324: main (t0007.c:104)
==1141== 
==1141== LEAK SUMMARY:
==1141==    definitely lost: 0 bytes in 0 blocks
==1141==    indirectly lost: 0 bytes in 0 blocks
==1141==      possibly lost: 0 bytes in 0 blocks
==1141==    still reachable: 1,728 bytes in 36 blocks
==1141==         suppressed: 1,628 bytes in 13 blocks
==1141== 
==1141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 5)
--1141-- 
--1141-- used_suppression:      2 gnutls_global_init leak 1
--1141-- used_suppression:      1 getpwuid_r leak 3
--1141-- used_suppression:      5 getpwuid_r leak 2
--1141-- used_suppression:      5 getpwuid_r leak 1
--1141-- used_suppression:      2 Debian libc6 (2.10.x) stripped dynamic linker
--1141-- used_suppression:      2 Debian libc6 (2.10.x) stripped dynamic linker
==1141== 
==1141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 5)

Main