Skip to Content.
Sympa Menu

freetds - RE: [freetds] current_results...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] current_results...
  • Date: Thu, 2 Dec 2004 11:01:13 -0000

Freddy,

is tds_checks.c a new unit test program ?
I can't comment on current_results unless I know what you're doing...

I suppose current_results *should* be NULL if there have never been any
results on the stream...
I suppose it's possible current_results is unitialised...
I suppose it's possible current_results still pointing to some freed
storage...

Bill

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of ZIGLIO, Frediano,
VF-IT
Sent: 02 December 2004 10:21
To: FreeTDS Development Group
Subject: [freetds] current_results...


I'm adding some tests to libTDS. Here you are some results.

$ ./dataread
dataread.c: Testing conversion from server
dataread: tds_checks.c:135: tds_check_tds_extra: Assertion `result_found ||
tds->current_results == ((void *)0)' failed.
Abortito (core dumped)
$ gdb ./dataread core.22607
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

Core was generated by `./dataread'.
Program terminated with signal 6, Aborted.
Reading symbols from
/home/freddy/cpp/freetds/freetds64/src/tds/.libs/libtds.so.5...done.
Loaded symbols for
/home/freddy/cpp/freetds/freetds64/src/tds/.libs/libtds.so.5
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /lib/libnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /usr/lib/gconv/ISO8859-1.so...done.
Loaded symbols for /usr/lib/gconv/ISO8859-1.so
Reading symbols from /usr/lib/gconv/CP1252.so...done.
Loaded symbols for /usr/lib/gconv/CP1252.so
#0 0x4d200b31 in kill () from /lib/i686/libc.so.6
(gdb) bt
#0 0x4d200b31 in kill () from /lib/i686/libc.so.6
#1 0x4d2007f5 in raise () from /lib/i686/libc.so.6
#2 0x4d201f28 in abort () from /lib/i686/libc.so.6
#3 0x4d1f9c58 in __assert_fail () from /lib/i686/libc.so.6
#4 0x4002022e in tds_check_tds_extra (tds=0x804c080) at tds_checks.c:142
#5 0x4000a47b in tds_process_result_tokens (tds=0x804c080,
result_type=0xbffff71c, done_flags=0x0) at token.c:509
#6 0x08048e04 in test (type=0x8049aa2 "BIT", value=0x0, result=0x8049aa6
"1") at dataread.c:57
#7 0x080490aa in main (argc=1, argv=0xbffff9d4) at dataread.c:136
(gdb) print *(TDSSOCKET*)0x804c080
$1 = {s = 3, major_version = 8, minor_version = 0, product_version =
2281701570, product_name = 0x807e0b0 "Microsoft SQL Server",
capabilities =
"\001\t\000\000\006m\177▒▒▒▒\002\t\000\000\000\000\nh\000\000", broken_dates
= 0 '\0', option_flag2 = 3 '\003',
in_buf = 0x806d9b8 "\201\001", out_buf = 0x807e128 "", in_buf_max = 357,
in_pos = 22, out_pos = 8, in_len = 22, in_flag = 4 '\004', out_flag = 1
'\001',
last_packet = 1 '\001', parent = 0x0, current_results = 0x807e010, res_info
= 0x0, num_comp_info = 0, comp_info = 0x0, param_info = 0x0, cursor = 0x0,
has_status = 0 '\0', ret_status = 0, state = 0 '\0', rows_affected = -1,
timeout = 0, longquery_timeout = 0, longquery_func = 0, longquery_param = 0x0,
queryStarttime = 1101982485, env = 0x804c358, num_dyns = 0, cur_dyn = 0x0,
dyns = 0x0, emul_little_endian = 0, date_fmt = 0x0, tds_ctx = 0x804c068,
char_conv_count = 5, char_convs = 0x806db70, connection = 0x0, spid = -1,
collation = "\t\004▒\0004", env_chg_func = 0, chkintr = 0, hndlintr = 0,
internal_sp_called = 0, client_cursor_id = 0}

"Assertion `result_found || tds->current_results == ((void *)0)' failed"
means that current_results do not point to any known data. From gdb you can
see that current_results point to a buffer however we can find this buffer in
res_info, param_info, compute, cursors or dynamic... I always though that
current_results should point to one of these members... valgrind prove that
there is no memory leaks however I don't understand how this can happen....

freddy77
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain or
redistribute it. Click here for important additional terms relating to this
e-mail. http://www.ml.com/email_terms/
--------------------------------------------------------





Archive powered by MHonArc 2.6.24.

Top of Page