Python 2.1a[12] and MySQLdb 0.3.2

kopfarzt at kopfarzt at
Mon Feb 5 14:36:25 EST 2001


I get SEGFAULTs (backtrace included) when fetching more than one row
with Python 2.1, MySQLdb 0.3.2 and mxDateTime from a table that contains
a date. I tried to reduce the problem to the max:

I got this table:
create table test (some_date datetime);
insert into test values ('2000-01-01');
insert into test values ('2000-01-02');

and this testprogram
import MySQLdb
import mxDateTime

db = MySQLdb.connect (host='localhost', db='test',
                      user='test', passwd='test')
cr = db.cursor ()
cr.execute ('select * from test')
rw = cr.fetchone ()
print type (rw[0]), rw[0]

will print:

<type 'DateTime'> 2000-01-01 00:00:00.00
Segmentation fault (core dumped)

my setup is:

linux 2.2.12
python 2.1a1 (and 2.1a2)
mysql 3.22.32
mxDateTime 1.3.0

without any special configuration options. I also tried Python 1.5.2,
1.6 and 2.0 where it works.

Anybody else experiencing similar problems or got a solution?

Thanks in advance

The gdb backtrace is:
#0  0x400ae352 in chunk_free (ar_ptr=0x40145d00, p=0x80f2af0) at
#1  0x400ae157 in __libc_free (mem=0x80f2c38) at malloc.c:2950
#2  0x808f08c in string_dealloc (op=0x80f2c38) at
#3  0x805a45e in code_dealloc (co=0x80f2e90) at Python/compile.c:89
#4  0x8084703 in func_dealloc (op=0x813efa4) at Objects/funcobject.c:249
#5  0x808b42d in dict_dealloc (mp=0x813430c) at Objects/dictobject.c:602
#6  0x807c219 in class_dealloc (op=0x813454c) at
#7  0x808aec6 in insertdict (mp=0x80f3a64, key=0x811f8b0,
    value=0x80bb42c) at Objects/dictobject.c:364
#8  0x808b190 in PyDict_SetItem (op=0x80f3a64, key=0x811f8b0,
    at Objects/dictobject.c:498
#9  0x808cbbc in _PyModule_Clear (m=0x80f65e4) at
#10 0x8065635 in PyImport_Cleanup () at Python/import.c:291
#11 0x806b428 in Py_Finalize () at Python/pythonrun.c:212
#12 0x8051c83 in Py_Main (argc=1, argv=0xbffff764) at Modules/main.c:302
#13 0x8051670 in main (argc=2, argv=0xbffff764) at

Sent via

More information about the Python-list mailing list