Skip to Content.
Sympa Menu

freetds - [freetds] Segfault When Fetching NVARCHAR(MAX) Column

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Marc DellaVolpe <marc.dellavolpe AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Segfault When Fetching NVARCHAR(MAX) Column
  • Date: Tue, 12 Jul 2011 17:24:21 -0400

I have run into a strange issue with SQLAlchemy/PyODBC/FreeTDS/unixODBC/
SQL Server 2005 that I was hoping someone can shed some light on.

I have two SQL Server 2005 instances with the same table created on
each. The contents of the tables differ. The servers appear to be
identical to each other in configuration except that the builds of SQL
Server are different. When fetching rows on from the newer build,
the fetch succeeds as normal. When fetching rows from the older
build, pyodbc.so segfaults. The same query/fetch works fine in tsql/
isql from the command line which leads me to believe that it is not a
FreeTDS issue. I am not sure where the issue lies but I figured I
would try with PyODBC and FreeTDS. Is it possible that there is some
bad data in the table to cause this? I have attached a dump from each
session. You will notice a truncation error message at the end of the
segfaulting log, The longest row in that table is length 509 / data
length 1018 so I am not sure about the context of this error message.

As a temporary work around, I have changed the column to varchar(max)
which works. As a last resort, I can apply the updates to the
segfaulting database but I would greatly appreciate more insight into
this issue before I do.

The working instance:

Microsoft SQL Server 2005 - 9.00.1406.00 (Intel X86)
Mar 3 2007 18:40:02
Copyright (c) 1988-2005 Microsoft Corporation
Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

Dump of session - http://pastebin.com/8NcDkvQy

The segfaulting instance:

Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Workgroup Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

Dump of session - http://pastebin.com/vAtPVZvD

Thank You,
- Marc




Archive powered by MHonArc 2.6.24.

Top of Page