djhenderson / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

python segfaults when using Easysoft ODBC Driver #113

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The code I have below will crash when using Easysofts ODBC-SQL Server driver 
but performs fine using freetds ODBC driver

import pyodbc
conn = pyodbc.connect('DSN=MYDSN")
curs = conn.cursor()
curs.execute('select * from mytable')
row = curs.fetchone()
print row
# this is the point where it will segfault.

I ran this same code using gdb and I get the following backtrace.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46928339233648 (LWP 27817)]
PyObject_Repr (v=0x54552e53555f6e65) at Objects/object.c:371
371             else if (Py_TYPE(v)->tp_repr == NULL)
(gdb) bt
#0  PyObject_Repr (v=0x54552e53555f6e65) at Objects/object.c:371
#1  0x00002aae5b59380f in Row_repr (o=<value optimized out>)
    at/pyodbc-2.1.7/src/row.cpp:227
#2  0x0000000000417cdd in PyObject_Call (func=0x2aae5c67cf90,
    arg=0x2aae5a843050, kw=0x0) at Objects/abstract.c:2492
#3  0x000000000048f767 in PyEval_EvalFrameEx (f=0x832d80,
    throwflag=<value optimized out>) at Python/ceval.c:3924
#4  0x00000000004963a5 in PyEval_EvalCodeEx (co=0x2aae5b009738,
    globals=<value optimized out>, locals=<value optimized out>, args=0x0,
    argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
    at Python/ceval.c:2968
#5  0x00000000004963e2 in PyEval_EvalCode (co=0x54552e53555f6e65,
    globals=0x68c140, locals=0x2aae5c40c010) at Python/ceval.c:522
#6  0x00000000004b7f46 in PyRun_InteractiveOneFlags (fp=0x2aae5afd06c0,
    filename=0x5043c9 "<stdin>", flags=0x7fff502a1ed0)
    at Python/pythonrun.c:1335
#7  0x00000000004b8164 in PyRun_InteractiveLoopFlags (fp=0x2aae5afd06c0,
    filename=0x5043c9 "<stdin>", flags=0x7fff502a1ed0)
    at Python/pythonrun.c:760
#8  0x00000000004b893a in PyRun_AnyFileExFlags (fp=0x2aae5afd06c0,
    filename=0x5043c9 "<stdin>", closeit=0, flags=0x7fff502a1ed0)
    at Python/pythonrun.c:729
#9  0x0000000000413e1c in Py_Main (argc=<value optimized out>,
    argv=0x7fff502a1ff8) at Modules/main.c:599
#10 0x00002aae5adb3184 in __libc_start_main () from /lib64/libc.so.6
#11 0x0000000000413099 in _start ()

As I mentioned previously this code executes correctly with FreeTDS 
TDS Version=8.0

I'm running this on x86_64 linux.

Original issue reported on code.google.com by jason.s.holmes on 4 Aug 2010 at 5:11

GoogleCodeExporter commented 9 years ago
I filed this bug prematurely and I believe it is now related to another issue 
in my compilation of both pyodbc and python under a 64 bit system.

Original comment by jason.s.holmes on 9 Aug 2010 at 6:50

GoogleCodeExporter commented 9 years ago
From your second comment, I assume this should be closed?  If not, please 
reopen.

Original comment by mkleehammer on 26 Aug 2010 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 21 Nov 2010 at 4:43