#32 Crash on import, probably due to api change in python 2.5

open
nobody
None
5
2007-06-11
2007-06-11
Anonymous
No

When importing xmlrpc into python 2.5 I get the following:

python 2.5.1, py-xmlrpc 0.8.8.3, glibc v2.5

>>> import xmlrpc
# /usr/lib/python2.5/site-packages/xmlrpc.pyc matches /usr/lib/python2.5/site-packages/xmlrpc.py
import xmlrpc # precompiled from /usr/lib/python2.5/site-packages/xmlrpc.pyc
dlopen("/usr/lib/python2.5/site-packages/_xmlrpc.so", 2);
import _xmlrpc # dynamically loaded from /usr/lib/python2.5/site-packages/_xmlrpc.so
*** glibc detected *** python: munmap_chunk(): invalid pointer: 0xb7be0070 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7cc5d72]
/usr/lib/python2.5/site-packages/_xmlrpc.so[0xb7f03add]
/usr/lib/libpython2.5.so.1.0[0xb7e30c55]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalFrameEx+0x3deb)[0xb7e64b2b]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalCodeEx+0x570)[0xb7e674f0]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalCode+0x63)[0xb7e67793]
/usr/lib/libpython2.5.so.1.0(PyImport_ExecCodeModuleEx+0xa7)[0xb7e76bd7]
/usr/lib/libpython2.5.so.1.0[0xb7e770b5]
/usr/lib/libpython2.5.so.1.0[0xb7e781a6]
/usr/lib/libpython2.5.so.1.0[0xb7e78672]
/usr/lib/libpython2.5.so.1.0[0xb7e78884]
/usr/lib/libpython2.5.so.1.0(PyImport_ImportModuleLevel+0x37)[0xb7e78ca7]
/usr/lib/libpython2.5.so.1.0[0xb7e5fa74]
/usr/lib/libpython2.5.so.1.0(PyCFunction_Call+0x12b)[0xb7e1e9eb]
/usr/lib/libpython2.5.so.1.0(PyObject_Call+0x37)[0xb7def787]
/usr/lib/libpython2.5.so.1.0(PyEval_CallObjectWithKeywords+0x7b)[0xb7e6014b]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalFrameEx+0x2da8)[0xb7e63ae8]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalCodeEx+0x570)[0xb7e674f0]
/usr/lib/libpython2.5.so.1.0(PyEval_EvalCode+0x63)[0xb7e67793]
/usr/lib/libpython2.5.so.1.0[0xb7e7f9b6]
/usr/lib/libpython2.5.so.1.0(PyRun_InteractiveOneFlags+0x194)[0xb7e814b4]
/usr/lib/libpython2.5.so.1.0(PyRun_InteractiveLoopFlags+0x5b)[0xb7e8169b]
/usr/lib/libpython2.5.so.1.0(PyRun_AnyFileExFlags+0x4e)[0xb7e817ce]
/usr/lib/libpython2.5.so.1.0(Py_Main+0xa99)[0xb7e8abd9]
python(main+0x32)[0x80485b2]
/lib/libc.so.6(__libc_start_main+0xdc)[0xb7c7883c]
python[0x80484f1]
======= Memory map: ========
08048000-08049000 r-xp 00000000 03:02 5398071 /usr/bin/python2.5
08049000-0804a000 rw-p 00000000 03:02 5398071 /usr/bin/python2.5
0804a000-080ce000 rw-p 0804a000 00:00 0 [heap]
b7aa5000-b7aaf000 r-xp 00000000 03:02 5375124 /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1
b7aaf000-b7ab0000 rw-p 00009000 03:02 5375124 /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1
b7ad6000-b7b11000 r-xp 00000000 03:02 4015056 /lib/libncurses.so.5.5
b7b11000-b7b1a000 rw-p 0003a000 03:02 4015056 /lib/libncurses.so.5.5
b7b1a000-b7b60000 r-xp 00000000 03:02 4014970 /lib/libncursesw.so.5.5
b7b60000-b7b69000 rw-p 00045000 03:02 4014970 /lib/libncursesw.so.5.5
b7b69000-b7b94000 r-xp 00000000 03:02 3834352 /lib/libreadline.so.5.2
b7b94000-b7b98000 rw-p 0002b000 03:02 3834352 /lib/libreadline.so.5.2
b7b98000-b7b99000 rw-p b7b98000 00:00 0
b7b99000-b7b9c000 r-xp 00000000 03:02 5398060 /usr/lib/python2.5/lib-dynload/readline.so
b7b9c000-b7b9d000 rw-p 00003000 03:02 5398060 /usr/lib/python2.5/lib-dynload/readline.so
b7b9d000-b7ba4000 r--s 00000000 03:02 1707912 /usr/lib/gconv/gconv-modules.cache
b7ba4000-b7bdf000 r--p 00000000 03:02 197193 /usr/lib/locale/en_US.utf8/LC_CTYPE
b7bdf000-b7c63000 rw-p b7bdf000 00:00 0
b7c63000-b7d83000 r-xp 00000000 03:02 5393836 /lib/libc-2.5.so
b7d83000-b7d84000 r--p 00120000 03:02 5393836 /lib/libc-2.5.so
b7d84000-b7d86000 rw-p 00121000 03:02 5393836 /lib/libc-2.5.so
b7d86000-b7d89000 rw-p b7d86000 00:00 0
b7d89000-b7dac000 r-xp 00000000 03:02 5394218 /lib/libm-2.5.so
b7dac000-b7dae000 rw-p 00022000 03:02 5394218 /lib/libm-2.5.so
b7dae000-b7db0000 r-xp 00000000 03:02 5394368 /lib/libutil-2.5.so
b7db0000-b7db2000 rw-p 00001000 03:02 5394368 /lib/libutil-2.5.so
b7db2000-b7db4000 r-xp 00000000 03:02 5394235 /lib/libdl-2.5.so
b7db4000-b7db6000 rw-p 00001000 03:02 5394235 /lib/libdl-2.5.so
b7db6000-b7dc9000 r-xp 00000000 03:02 5394208 /lib/libpthread-2.5.so
b7dc9000-b7dca000 r--p 00012000 03:02 5394208 /lib/libpthread-2.5.so
b7dca000-b7dcb000 rw-p 00013000 03:02 539420
Aborted

This doesn't occur with python 2.4.4 (if the library is built for 2.4.4).

Discussion

  • yiwamoto
    yiwamoto
    2007-07-05

    Logged In: YES
    user_id=1666448
    Originator: NO

    I changed the source file (6 files) to use PyObject_DEL() instead of PyMem_DEL().
    After this change, py-xmlrpc works good with Python 2.5.1(win32).

    [files]
    rpcBase64.c
    rpcBoolean.c
    rpcClient.c
    rpcData.c
    rpcDispatch.c
    rpcSource.c