Skip to Content.
Sympa Menu

freetds - Bug: Sybase ASE, sqsh and ct_cancel

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Alex Kiesel <freetds AT document-root.de>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Bug: Sybase ASE, sqsh and ct_cancel
  • Date: Tue, 23 Jul 2002 00:20:08 +0200


Hi all,

I am experiencing a bug with Sybase and FreeTDS in combination with sqsh
1.7. When querying a Sybase ASE server 12.5 (also experienced with
Sybase ASE 11.0) with sqsh 1.7 sometimes I get a whole bunch of "Unknown
marker xy!!"-messages (the problem does not relate to a badly chosen tds
version).

You can reproduce the bug in several ways:
[1] make an expensive query for which the database server cannot easily
return some result rows; e.g. select over an unindexed column in a
rather big table. As long as there are no result-sets appearing on the
screen, sqsh just hangs when pressing Ctrl-C. The connection on the
database-server still exists, the query still even gets executed.
On Linux with the original Sybase-Libs the command line returns.

[2] while the result-sets of a query are shown in sqsh pressing Ctrl-C
sometimes leads to a full screen of error messages declaring "Unknown
marker ...".

[3] possibly the same bug also causes a sqsh segfault when inserting into
a table with a unique index or primary key causing either an foreign
key constraint violation or duplicate keys insert violation.

As far as I have been able to track down the problem I came to the
conclusion that either ct_cancel() does not really cancel a command or the
tds_process_end()-function does not really recover the connection into a
consistent state.

I found this bug rather annoying so I finally decided to report it :)
Here is some information about my system(s):

- FreeBSD 4.5 with FreeTDS 0.53 (actual port version)
- Sybase 12.5 (problem also exists with Sybase 11.0.3.3)
- sqsh 1.7 (same version does not have any problems with the original
sybase librarys)

All three bugs do not exists with the same version of sqsh using the
libraries
shipped with Sybase ASE.

For the three mentioned examples I also submit the output of the
tdsdump (as a small logfile already consumes about half a megabyte I chose
only to send the specific and important parts (or at least what I think
they are):

[1] Sorry, got no table that is big enough here at home :(
[2] Here are the last several lines from the aborted select:

===== 8< ==================
Received packet @ 2002-07-23 00:04:05.131716
0000 22 32 22 20 77 69 64 74 68 3d 22 31 30 30 25 22 |"2" width="100%"|
0010 20 68 65 69 67 68 74 3d 22 34 30 30 22 3e 0d 0a | height="400">..|
0020 20 20 20 20 3c 74 72 20 68 65 69 67 68 74 3d 22 | <tr height="|
0030 31 30 30 25 22 3e 0d 0a 20 20 20 20 20 20 20 3c |100%">.. <|
0040 74 64 20 77 69 64 74 68 3d 22 32 30 30 22 20 76 |td width="200" v|
0050 61 6c 69 67 6e 3d 22 74 6f 70 22 3e 3c 78 73 6c |align="top"><xsl|
0060 3a 61 70 70 6c 79 2d 74 65 6d 70 6c 61 74 65 73 |:apply-templates|
0070 20 73 65 6c 65 63 74 3d 22 2e 2f 6c 69 6e 6b 73 | select="./links|
0080 22 2f 3e 3c 2f 74 64 3e 0d 0a 20 20 20 20 20 20 |"/></td>.. |
0090 20 3c 74 64 20 76 61 6c 69 67 6e 3d 22 74 6f 70 | <td valign="top|
00a0 22 3e 0d 0a 20 20 20 20 20 20 20 3c 78 73 6c 3a |">.. <xsl:|
00b0 63 61 6c 6c 2d 74 65 6d 70 6c 61 74 65 20 6e 61 |call-template na|
00c0 6d 65 3d 22 66 72 61 6d 65 22 3e 0d 0a 20 20 20 |me="frame">.. |
00d0 20 20 20 20 3c 78 73 6c 3a 77 69 74 68 2d 70 61 | <xsl:with-pa|
00e0 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 65 6e |ram name="conten|
00f0 74 22 3e 3c 78 73 6c 3a 63 6f 70 79 2d 6f 66 20 |t"><xsl:copy-of |
0100 73 65 6c 65 63 74 3d 22 2e 2f 72 65 63 68 74 73 |select="./rechts|
0110 22 2f 3e 3c 2f 78 73 6c 3a 77 69 74 68 2d 70 61 |"/></xsl:with-pa|
0120 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 3c 2f 78 |ram>.. </x|
0130 73 6c 3a 63 61 6c 6c 2d 74 65 6d 70 6c 61 74 65 |sl:call-template|
0140 3e 3c 2f 74 64 3e 0d 0a 20 20 20 20 3c 2f 74 72 |></td>.. </tr|
0150 3e 0d 0a 20 20 20 20 3c 74 72 3e 0d 0a 20 20 20 |>.. <tr>.. |
0160 20 20 20 3c 74 64 3e 3c 21 5b 43 44 41 54 41 5b | <td><![CDATA[|
0170 26 6e 62 73 70 3b 5d 5d 3e 3c 2f 74 64 3e 0d 0a |&nbsp;]]></td>..|
0180 20 20 20 20 20 20 3c 74 64 3e 3c 78 73 6c 3a 61 | <td><xsl:a|
0190 70 70 6c 79 2d 74 65 6d 70 6c 61 74 65 73 20 73 |pply-templates s|
01a0 65 6c 65 63 74 3d 22 2e 2f 73 75 62 73 63 72 69 |elect="./subscri|
01b0 70 74 22 2f 3e 3c 2f 74 64 3e 0d 0a 20 20 20 20 |pt"/></td>.. |
01c0 3c 2f 74 72 3e 0d 0a 20 20 3c 2f 74 61 62 6c 65 |</tr>.. </table|
01d0 3e 0d 0a 3c 2f 78 73 6c 3a 74 65 6d 70 6c 61 74 |>..</xsl:templat|
01e0 65 3e 06 00 00 00 00 4e 20 48 92 aa 04 04 61 6c |e>.....N H....al|
01f0 65 78 fd 10 00 02 00 23 |ex.....#|


2002-07-23 00:04:05.132532 clearing column 6 NULL bit
2002-07-23 00:04:05.132567 clearing column 7 NULL bit
2002-07-23 00:04:05.132594 datetime4 72 146 170 4
2002-07-23 00:04:05.132623 clearing column 8 NULL bit
Received packet @ 2002-07-23 00:04:05.132660
0000 00 00 00 |...|


Received packet @ 2002-07-23 00:04:05.132704
0000 fd 20 00 02 00 23 00 00 00 |. ...#...|


p.........|
01e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
01f0 00 00 00 00 00 00 00 00 |........|
======================== 8< ================

[3] The last lines from the constraint violation insert:
Sending packet @ 2002-07-23 00:10:08.989927
0000 0f 01 00 2e 00 00 00 00 21 21 00 00 00 00 73 65 |........!!....se|
0010 74 20 69 64 65 6e 74 69 74 79 5f 69 6e 73 65 72 |t identity_inser|
0020 74 20 74 65 6d 70 6c 61 74 65 20 6f 6e 0a |t template on.|


2002-07-23 00:10:08.990150 ct_send() succeeded
2002-07-23 00:10:08.990185 inside ct_results()
Received packet @ 2002-07-23 00:10:08.991138
0000 fd 00 00 02 00 00 00 00 00 |.........|


2002-07-23 00:10:08.991246 processing result tokens. marker is fd
2002-07-23 00:10:08.991284 inside ct_results()
2002-07-23 00:10:08.991331 inside ct_cmd_drop()
2002-07-23 00:10:09.890612 inside ct_cmd_alloc()
2002-07-23 00:10:09.891190 inside ct_command()
2002-07-23 00:10:09.891229 inside ct_cmd_props() action = CS_GET property = 51
2002-07-23 00:10:09.891318 inside ct_send()
Sending packet @ 2002-07-23 00:10:09.891428
0000 0f 01 00 d3 00 00 00 00 21 c6 00 00 00 00 69 6e |........!.....in|
0010 73 65 72 74 20 69 6e 74 6f 20 74 65 6d 70 6c 61 |sert into templa|
0020 74 65 20 28 74 65 6d 70 6c 61 74 65 5f 69 64 2c |te (template_id,|
0030 20 74 6f 6f 6c 5f 69 64 2c 20 6e 61 6d 65 2c 20 | tool_id, name, |
0040 6c 61 79 6f 75 74 2c 20 64 65 73 63 72 69 70 74 |layout, descript|
0050 69 6f 6e 2c 20 63 6f 6e 74 65 6e 74 2c 20 62 7a |ion, content, bz|
0060 5f 69 64 2c 20 6c 61 73 74 63 68 61 6e 67 65 2c |_id, lastchange,|
0070 20 63 68 61 6e 67 65 64 62 79 29 20 76 61 6c 75 | changedby) valu|
0080 65 73 20 28 38 35 2c 20 32 2c 20 27 64 75 6d 6d |es (85, 2, 'dumm|
0090 79 27 2c 20 27 62 6c 61 68 27 2c 20 27 64 65 73 |y', 'blah', 'des|
00a0 63 27 2c 20 27 74 68 69 73 20 69 73 20 74 68 65 |c', 'this is the|
00b0 20 63 6f 6e 74 65 6e 74 27 2c 20 32 30 30 30 30 | content', 20000|
00c0 2c 20 67 65 74 64 61 74 65 28 29 2c 20 27 6d 65 |, getdate(), 'me|
00d0 27 29 0a |').|


2002-07-23 00:10:09.891953 ct_send() succeeded
2002-07-23 00:10:09.891992 inside ct_results()
Received packet @ 2002-07-23 00:10:10.105146
0000 e5 76 00 29 0a 00 00 03 0e 05 32 33 30 30 30 01 |.v.)......23000.|
0010 00 00 61 00 41 74 74 65 6d 70 74 20 74 6f 20 69 |..a.Attempt to i|
0020 6e 73 65 72 74 20 64 75 70 6c 69 63 61 74 65 20 |nsert duplicate |
0030 6b 65 79 20 72 6f 77 20 69 6e 20 6f 62 6a 65 63 |key row in objec|
0040 74 20 27 74 65 6d 70 6c 61 74 65 27 20 77 69 74 |t 'template' wit|
0050 68 20 75 6e 69 71 75 65 20 69 6e 64 65 78 20 27 |h unique index '|
0060 74 65 6d 70 6c 61 74 65 5f 34 31 36 30 30 34 35 |template_4160045|
0070 31 33 31 27 0a 00 00 01 00 ec 4c 00 05 00 05 69 |131'......L....i|
0080 6e 64 65 78 00 02 00 00 00 27 13 00 08 64 61 74 |ndex.....'...dat|
0090 61 62 61 73 65 00 02 00 00 00 27 03 00 05 6f 77 |abase.....'...ow|
00a0 6e 65 72 00 02 00 00 00 27 03 00 05 74 61 62 6c |ner.....'...tabl|
00b0 65 00 02 00 00 00 27 08 00 06 63 6f 6c 75 6d 6e |e.....'...column|
00c0 00 02 00 00 00 27 0b 00 d7 13 74 65 6d 70 6c 61 |.....'....templa|
00d0 74 65 5f 34 31 36 30 30 34 35 31 33 31 03 63 6d |te_4160045131.cm|
00e0 73 03 64 62 6f 08 74 65 6d 70 6c 61 74 65 0b 74 |s.dbo.template.t|
00f0 65 6d 70 6c 61 74 65 5f 69 64 fd 05 00 01 00 00 |emplate_id......|
0100 00 00 00 e5 2f 00 25 0e 00 00 00 0a 05 5a 5a 5a |..../.%......ZZZ|
0110 5a 5a 00 03 00 1a 00 43 6f 6d 6d 61 6e 64 20 68 |ZZ.....Command h|
0120 61 73 20 62 65 65 6e 20 61 62 6f 72 74 65 64 2e |as been aborted.|
0130 0a 00 00 01 00 fd 12 00 03 00 00 00 00 00 |..............|


2002-07-23 00:10:10.105779 processing result tokens. marker is e5
2002-07-23 00:10:10.106464 processing result tokens. marker is ec

Greets,
Alex




  • Bug: Sybase ASE, sqsh and ct_cancel, Alex Kiesel, 07/22/2002

Archive powered by MHonArc 2.6.24.

Top of Page