List:MySQL ODBC« Previous MessageNext Message »
From:Juergen Daubert Date:March 22 1999 7:19am
Subject:RE: Problems using myodbc from Python
View as plain text  
FORWARDED MESSAGE from Berthold Höllmann (se6y095 @
BH> public.uni-hamburg.de) at 20.03.99 18:22
BH> Hello,
BH>
BH> I try to to use myODBC from Python on my Linux box. I use mxODBC 1.0.1,
BH> MySQL 3.22.20a and iODBC 2.50.22 with myodbc-2.50.22. mxODBC is
BH> compiled
BH> with direct ODBC access to MySQL trough myodbc as well as access
BH> through
BH> iODBC. When I use iODBC the access is OK, but when I try to load myodbc
BH> I ge a segmentation fault. After fiddeling with gdb a bit I found:
BH>
BH> (gdb) run  -c "import ODBC.MySQL"
BH> Starting program: /usr/local/bin/python -c "import ODBC.MySQL"
BH>
BH> Program received signal SIGSEGV, Segmentation fault.
BH> 0x40083c72 in chunk_alloc (ar_ptr=0x400de1a0, nb=16) at malloc.c:2616
BH> malloc.c:2616: Datei oder Verzeichnis nicht gefunden.
BH> (gdb) where
BH> #0  0x40083c72 in chunk_alloc (ar_ptr=0x400de1a0, nb=16) at
BH> malloc.c:2616
BH> #1  0x40083b95 in __libc_malloc (bytes=2) at malloc.c:2561
BH> #2  0x4014659b in my_malloc ()
BH> #3  0x401466e3 in my_strdup ()
BH> #4  0x401391a2 in myodbc_init ()
BH> #5  0x40131714 in SQLAllocEnv ()
BH> #6  0x401212e5 in initmxODBC () at ./mxODBC.c:4155
BH> #7  0x805c124 in _PyImport_LoadDynamicModule (name=0xbfffd7cc
BH> "ODBC.MySQL.mxODBC", pathname=0xbfffd360
BH> "/usr/local/lib/python1.5/site-packages/ODBC/MySQL/mxODBC.so",
BH> fp=0x80cbcb0) at ./importdl.c:851
BH> #8  0x805a828 in load_module (name=0xbfffd7cc "ODBC.MySQL.mxODBC",
BH> fp=0x80cbcb0, buf=0xbfffd360
BH> "/usr/local/lib/python1.5/site-packages/ODBC/MySQL/mxODBC.so", type=3)
BH> at import.c:1206
BH> #9  0x805b327 in import_submodule (mod=0x810e038, subname=0xbfffd7d7
BH> "mxODBC", fullname=0xbfffd7cc "ODBC.MySQL.mxODBC") at import.c:1751
BH> #10 0x805af54 in load_next (mod=0x810e038, altmod=0x80942ec,
BH> p_name=0xbfffdbd8, buf=0xbfffd7cc "ODBC.MySQL.mxODBC",
BH> p_buflen=0xbfffd7c8) at import.c:1599
BH> #11 0x805ac19 in import_module_ex (name=0x0, globals=0x80cc208,
BH> locals=0x80cc208, fromlist=0x80ca4c0) at import.c:1441
BH> #12 0x805ad30 in PyImport_ImportModuleEx (name=0x814b3dc "mxODBC",
BH> globals=0x80cc208, locals=0x80cc208, fromlist=0x80ca4c0) at
BH> import.c:1485
BH> #13 0x8074a65 in builtin___import__ (self=0x0, args=0x81598f8) at
BH> bltinmodule.c:65
BH> #14 0x80538b0 in call_builtin (func=0x809fa60, arg=0x81598f8, kw=0x0)
BH> at
BH> ceval.c:2356
BH> #15 0x80537c8 in PyEval_CallObjectWithKeywords (func=0x809fa60,
BH> arg=0x81598f8, kw=0x0) at ceval.c:2321
BH> #16 0x80524eb in eval_code2 (co=0x80d99c8, globals=0x80cc208,
BH> locals=0x80cc208, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
BH> defcount=0, owner=0x0) at ceval.c:1443
BH> #17 0x8050cc2 in PyEval_EvalCode (co=0x80d99c8, globals=0x80cc208,
BH> locals=0x80cc208) at ceval.c:322
BH> #18 0x8059c7b in PyImport_ExecCodeModuleEx (name=0xbfffea80
BH> "ODBC.MySQL", co=0x80d99c8, pathname=0xbfffe1d0
BH> "/usr/local/lib/python1.5/site-packages/ODBC/MySQL/__init__.py") at
BH> import.c:481
BH> #19 0x805a0d3 in load_source_module (name=0xbfffea80 "ODBC.MySQL",
BH> pathname=0xbfffe1d0
BH> "/usr/local/lib/python1.5/site-packages/ODBC/MySQL/__init__.py",
BH> fp=0x80c9e78) at import.c:720
BH> #20 0x805a80b in load_module (name=0xbfffea80 "ODBC.MySQL",
BH> fp=0x80c9e78, buf=0xbfffe1d0
BH> "/usr/local/lib/python1.5/site-packages/ODBC/MySQL/__init__.py",
BH> type=1)
BH> at import.c:1198
BH> #21 0x805a215 in load_package (name=0xbfffea80 "ODBC.MySQL",
BH> pathname=0xbfffe614
BH> "/usr/local/lib/python1.5/site-packages/ODBC/MySQL")
BH> at import.c:779
BH> #22 0x805a837 in load_module (name=0xbfffea80 "ODBC.MySQL", fp=0x0,
BH> buf=0xbfffe614 "/usr/local/lib/python1.5/site-packages/ODBC/MySQL",
BH> type=5) at import.c:1219
BH> #23 0x805b327 in import_submodule (mod=0x80af5d8, subname=0xbfffea85
BH> "MySQL", fullname=0xbfffea80 "ODBC.MySQL") at import.c:1751
BH> #24 0x805af54 in load_next (mod=0x80af5d8, altmod=0x80af5d8,
BH> p_name=0xbfffee8c, buf=0xbfffea80 "ODBC.MySQL", p_buflen=0xbfffea7c) at
BH> import.c:1599
BH> #25 0x805ac49 in import_module_ex (name=0x0, globals=0x80a1b08,
BH> locals=0x80a1b08, fromlist=0x80942ec) at import.c:1448
BH> #26 0x805ad30 in PyImport_ImportModuleEx (name=0x80aece4 "ODBC.MySQL",
BH> globals=0x80a1b08, locals=0x80a1b08, fromlist=0x80942ec) at
BH> import.c:1485
BH> #27 0x8074a65 in builtin___import__ (self=0x0, args=0x80a4d48) at
BH> bltinmodule.c:65
BH> #28 0x80538b0 in call_builtin (func=0x809fa60, arg=0x80a4d48, kw=0x0)
BH> at
BH> ceval.c:2356
BH> #29 0x80537c8 in PyEval_CallObjectWithKeywords (func=0x809fa60,
BH> arg=0x80a4d48, kw=0x0) at ceval.c:2321
BH> #30 0x80524eb in eval_code2 (co=0x80af598, globals=0x80a1b08,
BH> locals=0x80a1b08, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
BH> defcount=0, owner=0x0) at ceval.c:1443
BH> #31 0x8050cc2 in PyEval_EvalCode (co=0x80af598, globals=0x80a1b08,
BH> locals=0x80a1b08) at ceval.c:322
BH> #32 0x805f77e in run_node (n=0x80bc1c0, filename=0x8088c6f "<string>",
BH> globals=0x80a1b08, locals=0x80a1b08) at pythonrun.c:891
BH> #33 0x805f738 in run_err_node (n=0x80bc1c0, filename=0x8088c6f
BH> "<string>", globals=0x80a1b08, locals=0x80a1b08) at pythonrun.c:876
BH> #34 0x805f6df in PyRun_String (str=0x809f808 "import ODBC.MySQL\n",
BH> start=257, globals=0x80a1b08, locals=0x80a1b08) at pythonrun.c:853
BH> #35 0x805ef16 in PyRun_SimpleString (command=0x809f808 "import
BH> ODBC.MySQL\n") at pythonrun.c:595
BH> #36 0x804f455 in Py_Main (argc=3, argv=0xbffff1b4) at main.c:272
BH> #37 0x804efd8 in main (argc=3, argv=0xbffff1b4) at python.c:12
BH>
BH> and with some more debugging symbols enabled:
BH>
BH> (gdb) up
BH> #1  0x40083b95 in __libc_malloc (bytes=2) at malloc.c:2561
BH> malloc.c:2561: Datei oder Verzeichnis nicht gefunden.
BH> (gdb) up
BH> #2  0x4014659b in my_malloc ()
BH> (gdb) up
BH> #3  0x401466e3 in my_strdup ()
BH> (gdb) up
BH> #4  0x4013919e in myodbc_init () at dll.c:40
BH> 40
BH> default_locale=my_strdup(setlocale(LC_NUMERIC,NullS),MYF(0));
BH> (gdb) print setlocale(1,(char*)0)
BH> $1 = 0x400d7165 "C"
BH>
BH> I have no idea where to go from here?
BH>
BH> Cheers
BH>
BH> Berthold
BH> -- bhoel@stripped
BH>         It is unlawful to use this email address for unsolicited ads
BH>         (USC Title 47 Sec.227). I will assess a US$500 charge for
BH>         reviewing and deleting each unsolicited ad.
BH>
BH> ---------------------------------------------------------------------
BH> To request this thread, e-mail myodbc-thread74@stripped
BH> To unsubscribe, e-mail the address shown in the
BH> List-Unsubscribe header of this message.
BH> For additional commands, e-mail: myodbc-help@stripped
***** NOTES from Juergen Daubert (JUERGEN @ DBAUDIO) at 22.03.99 08:17
Hi,

you don´t need any ODBC stuff to connect from Python to an MySQL
database.
Try to use MySQLmodule-1.4.tar.gz. This works fine for me.
You can find this on http://www.tcx.se/Contrib/

Ciao
Jürgen

+--------------------------+----------------------------------------------+
| Juergen Daubert          | INTERNET: juergen@stripped                |
| d&b audiotechnik AG      |      CIS: >MHS:juergen@dbaudio               |
| D-71522 Backang          |      TEL: +49-7191-9669-126                  |
| Germany                  |      FAX: +49-7191-950000                    |
+--------------------------+----------------------------------------------+

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