freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
compute row bug: tds/token.c:527: assigns to null pointer (tds->res_info)
- From: "James K. Lowden" <jklowden AT schemamania.org>
- To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
- Subject: compute row bug: tds/token.c:527: assigns to null pointer (tds->res_info)
- Date: Fri, 25 Oct 2002 20:04:46 -0400
TDS 7.0, current CVS, updated minutes ago.
Query is:
while (select max(sat) from sat) < getdate()
insert sat
select dateadd(week, 1, max(sat))
from sat
Initial contents of table "sat":
1> select * from sat
2> go
sat
May 11 2002 12:00AM
Problem: Segfault when query completes (26 rows are added).
Transcript follows, log attached.
--jkl
$ gdb tsql
GNU gdb 4.17
[...]
(gdb) r
Starting program: /usr/local/bin/tsql -S s -U u -P p
Msg 5703, Level 0, State 1, Server CPRO200, Line 0
Changed language setting to us_english.
1> while (select max(sat) from sat) < getdate() insert sat select
dateadd(week, 1, max(sat )) from sat
2> go
Program received signal SIGSEGV, Segmentation fault.
0x4007e211 in tds_process_row_tokens (tds=0xc000, rowtype=0xbfbfd16c,
computeid=0xbfbfd170) at ../../../src/tds/token.c:527
527 tds->res_info->more_results =
more_results;
(gdb) bt
#0 0x4007e211 in tds_process_row_tokens (tds=0xc000, rowtype=0xbfbfd16c,
computeid=0xbfbfd170) at ../../../src/tds/token.c:527
#1 0x1abd in do_query (tds=0xc000,
buf=0x18000 "while (select max(sat) from sat) < getdate() insert sat
select dateadd(week, 1, max(sat )) from sat\n", opt_flags=0)
at ../../../src/apps/tsql.c:174
#2 0x23ee in main (argc=7, argv=0xbfbfd3d8) at
#../../../src/apps/tsql.c:418
527 tds->res_info->more_results =
more_results;
(gdb) l
522 case TDS_DONE_TOKEN:
523 case TDS_DONEPROC_TOKEN:
524 case TDS_DONEINPROC_TOKEN:
525
526 tds_process_end(tds, marker,
&more_results, &cancelled);
527 tds->res_info->more_results =
more_results;
528 *rowtype = TDS_NO_MORE_ROWS;
529 return TDS_NO_MORE_ROWS;
530
531 default:
(gdb) p marker
$1 = 253
(gdb) p *tds
$3 = {s = 6, major_version = 7, minor_version = 0,
product_version = 2264925002,
capabilities = "\001\a\003m\177\002\a\000\000\nh\000\000",
broken_dates = 0 '\000', in_buf = 0x12200 "\001", out_buf = 0x16000 "",
in_buf_max = 408, in_pos = 18, out_pos = 8, in_len = 18, out_len = 0,
out_flag = 1 '\001', last_packet = 1 '\001', parent = 0x0,
curr_resinfo = 0xe080, res_info = 0x0, num_comp_info = 0, comp_info =
0x0,
param_info = 0x0, has_status = 0 '\000', ret_status = 0, state = 2
'\002',
rows_affected = 0, timeout = 0, longquery_timeout = 0, longquery_func =
0,
longquery_param = 0, queryStarttime = 1035589663, env = 0xa040,
num_dyns = 0, cur_dyn_elem = 0, dyns = 0x0, emul_little_endian = 0,
date_fmt = 0x0, tds_ctx = 0xa000, iconv_info = 0x6010, connect_info =
0x0,
spid = 7}
(gdb) p more_results
$4 = 0
(gdb) p cancelled
$5 = 0
(gdb) p tds->res_info
$6 = (TDSRESULTINFO *) 0x0
Attachment:
varley.tdsdump
Description: Binary data
- compute row bug: tds/token.c:527: assigns to null pointer (tds->res_info), James K. Lowden, 10/25/2002
Archive powered by MHonArc 2.6.24.