List:MySQL ODBC« Previous MessageNext Message »
From:Berthold Höllmann Date:March 20 1999 5:22pm
Subject:Problems using myodbc from Python
View as plain text  
Hello,

I try to to use myODBC from Python on my Linux box. I use mxODBC 1.0.1,
MySQL 3.22.20a and iODBC 2.50.22 with myodbc-2.50.22. mxODBC is compiled
with direct ODBC access to MySQL trough myodbc as well as access through
iODBC. When I use iODBC the access is OK, but when I try to load myodbc
I ge a segmentation fault. After fiddeling with gdb a bit I found:

(gdb) run  -c "import ODBC.MySQL"          
Starting program: /usr/local/bin/python -c "import ODBC.MySQL"

Program received signal SIGSEGV, Segmentation fault.
0x40083c72 in chunk_alloc (ar_ptr=0x400de1a0, nb=16) at malloc.c:2616
malloc.c:2616: Datei oder Verzeichnis nicht gefunden.
(gdb) where
#0  0x40083c72 in chunk_alloc (ar_ptr=0x400de1a0, nb=16) at
malloc.c:2616
#1  0x40083b95 in __libc_malloc (bytes=2) at malloc.c:2561
#2  0x4014659b in my_malloc ()
#3  0x401466e3 in my_strdup ()
#4  0x401391a2 in myodbc_init ()
#5  0x40131714 in SQLAllocEnv ()
#6  0x401212e5 in initmxODBC () at ./mxODBC.c:4155
#7  0x805c124 in _PyImport_LoadDynamicModule (name=0xbfffd7cc
"ODBC.MySQL.mxODBC", pathname=0xbfffd360
"/usr/local/lib/python1.5/site-packages/ODBC/MySQL/mxODBC.so",
fp=0x80cbcb0) at ./importdl.c:851
#8  0x805a828 in load_module (name=0xbfffd7cc "ODBC.MySQL.mxODBC",
fp=0x80cbcb0, buf=0xbfffd360
"/usr/local/lib/python1.5/site-packages/ODBC/MySQL/mxODBC.so", type=3)
at import.c:1206
#9  0x805b327 in import_submodule (mod=0x810e038, subname=0xbfffd7d7
"mxODBC", fullname=0xbfffd7cc "ODBC.MySQL.mxODBC") at import.c:1751
#10 0x805af54 in load_next (mod=0x810e038, altmod=0x80942ec,
p_name=0xbfffdbd8, buf=0xbfffd7cc "ODBC.MySQL.mxODBC",
p_buflen=0xbfffd7c8) at import.c:1599
#11 0x805ac19 in import_module_ex (name=0x0, globals=0x80cc208,
locals=0x80cc208, fromlist=0x80ca4c0) at import.c:1441
#12 0x805ad30 in PyImport_ImportModuleEx (name=0x814b3dc "mxODBC",
globals=0x80cc208, locals=0x80cc208, fromlist=0x80ca4c0) at
import.c:1485
#13 0x8074a65 in builtin___import__ (self=0x0, args=0x81598f8) at
bltinmodule.c:65
#14 0x80538b0 in call_builtin (func=0x809fa60, arg=0x81598f8, kw=0x0) at
ceval.c:2356
#15 0x80537c8 in PyEval_CallObjectWithKeywords (func=0x809fa60,
arg=0x81598f8, kw=0x0) at ceval.c:2321
#16 0x80524eb in eval_code2 (co=0x80d99c8, globals=0x80cc208,
locals=0x80cc208, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
defcount=0, owner=0x0) at ceval.c:1443
#17 0x8050cc2 in PyEval_EvalCode (co=0x80d99c8, globals=0x80cc208,
locals=0x80cc208) at ceval.c:322
#18 0x8059c7b in PyImport_ExecCodeModuleEx (name=0xbfffea80
"ODBC.MySQL", co=0x80d99c8, pathname=0xbfffe1d0
"/usr/local/lib/python1.5/site-packages/ODBC/MySQL/__init__.py") at
import.c:481
#19 0x805a0d3 in load_source_module (name=0xbfffea80 "ODBC.MySQL",
pathname=0xbfffe1d0
"/usr/local/lib/python1.5/site-packages/ODBC/MySQL/__init__.py",
fp=0x80c9e78) at import.c:720
#20 0x805a80b in load_module (name=0xbfffea80 "ODBC.MySQL",
fp=0x80c9e78, buf=0xbfffe1d0
"/usr/local/lib/python1.5/site-packages/ODBC/MySQL/__init__.py", type=1)
at import.c:1198
#21 0x805a215 in load_package (name=0xbfffea80 "ODBC.MySQL",
pathname=0xbfffe614 "/usr/local/lib/python1.5/site-packages/ODBC/MySQL")
at import.c:779
#22 0x805a837 in load_module (name=0xbfffea80 "ODBC.MySQL", fp=0x0,
buf=0xbfffe614 "/usr/local/lib/python1.5/site-packages/ODBC/MySQL",
type=5) at import.c:1219
#23 0x805b327 in import_submodule (mod=0x80af5d8, subname=0xbfffea85
"MySQL", fullname=0xbfffea80 "ODBC.MySQL") at import.c:1751
#24 0x805af54 in load_next (mod=0x80af5d8, altmod=0x80af5d8,
p_name=0xbfffee8c, buf=0xbfffea80 "ODBC.MySQL", p_buflen=0xbfffea7c) at
import.c:1599
#25 0x805ac49 in import_module_ex (name=0x0, globals=0x80a1b08,
locals=0x80a1b08, fromlist=0x80942ec) at import.c:1448
#26 0x805ad30 in PyImport_ImportModuleEx (name=0x80aece4 "ODBC.MySQL",
globals=0x80a1b08, locals=0x80a1b08, fromlist=0x80942ec) at
import.c:1485
#27 0x8074a65 in builtin___import__ (self=0x0, args=0x80a4d48) at
bltinmodule.c:65
#28 0x80538b0 in call_builtin (func=0x809fa60, arg=0x80a4d48, kw=0x0) at
ceval.c:2356
#29 0x80537c8 in PyEval_CallObjectWithKeywords (func=0x809fa60,
arg=0x80a4d48, kw=0x0) at ceval.c:2321
#30 0x80524eb in eval_code2 (co=0x80af598, globals=0x80a1b08,
locals=0x80a1b08, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
defcount=0, owner=0x0) at ceval.c:1443
#31 0x8050cc2 in PyEval_EvalCode (co=0x80af598, globals=0x80a1b08,
locals=0x80a1b08) at ceval.c:322
#32 0x805f77e in run_node (n=0x80bc1c0, filename=0x8088c6f "<string>",
globals=0x80a1b08, locals=0x80a1b08) at pythonrun.c:891
#33 0x805f738 in run_err_node (n=0x80bc1c0, filename=0x8088c6f
"<string>", globals=0x80a1b08, locals=0x80a1b08) at pythonrun.c:876
#34 0x805f6df in PyRun_String (str=0x809f808 "import ODBC.MySQL\n",
start=257, globals=0x80a1b08, locals=0x80a1b08) at pythonrun.c:853
#35 0x805ef16 in PyRun_SimpleString (command=0x809f808 "import
ODBC.MySQL\n") at pythonrun.c:595
#36 0x804f455 in Py_Main (argc=3, argv=0xbffff1b4) at main.c:272
#37 0x804efd8 in main (argc=3, argv=0xbffff1b4) at python.c:12

and with some more debugging symbols enabled:

(gdb) up
#1  0x40083b95 in __libc_malloc (bytes=2) at malloc.c:2561
malloc.c:2561: Datei oder Verzeichnis nicht gefunden.
(gdb) up
#2  0x4014659b in my_malloc ()
(gdb) up
#3  0x401466e3 in my_strdup ()
(gdb) up
#4  0x4013919e in myodbc_init () at dll.c:40
40         
default_locale=my_strdup(setlocale(LC_NUMERIC,NullS),MYF(0));
(gdb) print setlocale(1,(char*)0)
$1 = 0x400d7165 "C"

I have no idea where to go from here?

Cheers

Berthold
-- 
bhoel@stripped
        It is unlawful to use this email address for unsolicited ads
        (USC Title 47 Sec.227). I will assess a US$500 charge for
        reviewing and deleting each unsolicited ad.
Thread
Problems using myodbc from PythonBerthold Höllmann20 Mar
  • Re: Problems using myodbc from PythonBerthold Höllmann24 Mar
RE: Problems using myodbc from PythonJuergen Daubert22 Mar