Discussion:
[Python.NET] glibc invalid pointer when importing clr
z***@public.gmane.org
2014-10-17 10:41:56 UTC
Permalink
Hi!

First, sorry for my English. I'm trying to use pythonnet on Debian Wheezy. I'm checkout svn trunk, when install mono-2, and other dependencies. Building clr.so done without errors. On the next step I'm put clr.so, Python.Runtime.dll and Python.Runtime.dll.config in /usr/local/lib/python2.7/dist-packages.
But when I'm try to use this, I'm got such traceback:

***@debian-salt:/usr/local/lib/python2.7/dist-packages# python
Python 2.7.3 (default, Mar 14 2014, 11:57:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
*** glibc detected *** python: free(): invalid pointer: 0xb6653180 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x70c41)[0xb7618c41]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x724a8)[0xb761a4a8]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d)[0xb761d5ed]
/usr/lib/libpython2.7.so.1.0(PyString_InternInPlace+0xaf)[0xb6e3f7af]
======= Memory map: ========
00010000-00081000 rw-p 00000000 00:00 0
08048000-0828e000 r-xp 00000000 08:05 23939 /usr/bin/python2.7
0828e000-0828f000 r--p 00245000 08:05 23939 /usr/bin/python2.7
0828f000-082e4000 rw-p 00246000 08:05 23939 /usr/bin/python2.7
082e4000-082f1000 rw-p 00000000 00:00 0
09e7a000-09fec000 rw-p 00000000 00:00 0 [heap]
b6500000-b6521000 rw-p 00000000 00:00 0
b6521000-b6600000 ---p 00000000 00:00 0
b6652000-b6693000 rw-p 00000000 00:00 0
b6693000-b66ae000 r--p 00000000 08:05 46606 /usr/local/lib/python2.7/dist-packages/Python.Runtime.dll
b66ae000-b66b7000 ---p 00000000 00:00 0
b66b7000-b67b0000 rw-p 00000000 00:00 0
b67b0000-b67cf000 ---p 00000000 00:00 0
b67cf000-b67e0000 rwxp 00000000 00:00 0
b67e0000-b67ea000 r-xp 00000000 08:01 32537 /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b67ea000-b67eb000 r--p 00009000 08:01 32537 /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b67eb000-b67ec000 rw-p 0000a000 08:01 32537 /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b67ec000-b67f5000 r-xp 00000000 08:01 32539 /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
b67f5000-b67f6000 r--p 00008000 08:01 32539 /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
b67f6000-b67f7000 rw-p 00009000 08:01 32539 /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
b67f7000-b680a000 r-xp 00000000 08:01 32533 /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
b680a000-b680b000 r--p 00012000 08:01 32533 /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
b680b000-b680c000 rw-p 00013000 08:01 32533 /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
b680c000-b680e000 rw-p 00000000 00:00 0
b6814000-b6818000 rw-p 00000000 00:00 0
b6818000-b681a000 r-xp 00000000 08:05 10456 /usr/lib/i386-linux-gnu/gconv/UTF-16.so
b681a000-b681b000 r--p 00001000 08:05 10456 /usr/lib/i386-linux-gnu/gconv/UTF-16.so
b681b000-b681c000 rw-p 00002000 08:05 10456 /usr/lib/i386-linux-gnu/gconv/UTF-16.so
b681c000-b6a96000 r--p 00000000 08:05 41796 /usr/lib/mono/2.0/mscorlib.dll
b6a96000-b6aa7000 rwxp 00000000 00:00 0
b6aa7000-b6ae4000 r-xp 00000000 08:01 33080 /lib/i386-linux-gnu/libpcre.so.3.13.1
b6ae4000-b6ae5000 rw-p 0003c000 08:01 33080 /lib/i386-linux-gnu/libpcre.so.3.13.1
b6ae5000-b6bc5000 r-xp 00000000 08:05 4041 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
b6bc5000-b6bc9000 r--p 000e0000 08:05 4041 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
b6bc9000-b6bca000 rw-p 000e4000 08:05 4041 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
b6bca000-b6bd1000 rw-p 00000000 00:00 0
b6bd1000-b6ccc000 r-xp 00000000 08:01 33092 /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b6ccc000-b6ccd000 r--p 000fa000 08:01 33092 /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b6ccd000-b6cce000 rw-p 000fb000 08:01 33092 /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b6cce000-b6f39000 r-xp 00000000 08:05 38605 /usr/lib/libpython2.7.so.1.0
b6f39000-b6f3a000 r--p 0026b000 08:05 38605 /usr/lib/libpython2.7.so.1.0
b6f3a000-b6f8f000 rw-p 0026c000 08:05 38605 /usr/lib/libpython2.7.so.1.0
b6f8f000-b6f9c000 rw-p 00000000 00:00 0
b6f9c000-b6fa3000 r-xp 00000000 08:01 32543 /lib/i386-linux-gnu/i686/cmov/librt-2.13.so
b6fa3000-b6fa4000 r--p 00006000 08:01 32543 /lib/i386-linux-gnu/i686/cmov/librt-2.13.so
b6fa4000-b6fa5000 rw-p 00007000 08:01 32543 /lib/i386-linux-gnu/i686/cmov/librt-2.13.so
b6fa5000-b72b6000 r-xp 00000000 08:05 41753 /usr/lib/libmono-2.0.so.1.0.0
b72b6000-b72b9000 r--p 00310000 08:05 41753 /usr/lib/libmono-2.0.so.1.0.0
b72b9000-b72be000 rw-p 00313000 08:05 41753 /usr/lib/libmono-2.0.so.1.0.0
b72be000-b72dd000 rw-p 00000000 00:00 0
b72de000-b72e4000 r-xp 00000000 08:01 32535 /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
b72e4000-b72e5000 r--p 00005000 08:01 32535 /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
b72e5000-b72e6000 rw-p 00006000 08:01 32535 /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
b72e6000-b72e7000 rw-s 00000000 00:11 939641 /run/shm/mono.7877
b72e7000-b72eb000 rw-p 00000000 00:00 0
b72eb000-b7308000 r-xp 00000000 08:01 32559 /lib/i386-linux-gnu/libtinfo.so.5.9
b7308000-b730a000 r--p 0001c000 08:01 32559 /lib/i386-linux-gnu/libtinfo.so.5.9
b730a000-b730b000 rw-p 0001e000 08:01 32559 /lib/i386-linux-gnu/libtinfo.so.5.9
b730b000-b7343000 r-xp 00000000 08:01 32576 /lib/i386-linux-gnu/libreadline.so.6.2
b7343000-b7344000 r--p 00038000 08:01 32576 /lib/i386-linux-gnu/libreadline.so.6.2
b7344000-b7347000 rw-p 00039000 08:01 32576 /lib/i386-linux-gnu/libreadline.so.6.2
b7347000-b7349000 rw-p 00000000 00:00 0
b7349000-b734d000 r-xp 00000000 08:05 24426 /usr/lib/python2.7/lib-dynload/readline.so
b734d000-b734e000 r--p 00003000 08:05 24426 /usr/lib/python2.7/lib-dynload/readline.so
b734e000-b734f000 rw-p 00004000 08:05 24426 /usr/lib/python2.7/lib-dynload/readline.so
b734f000-b74c6000 r--p 00000000 08:05 6381 /usr/lib/locale/locale-archive
b74c6000-b758b000 rw-p 00000000 00:00 0
b758b000-b75a7000 r-xp 00000000 08:01 32523 /lib/i386-linux-gnu/libgcc_s.so.1
b75a7000-b75a8000 rw-p 0001b000 08:01 32523 /lib/i386-linux-gnu/libgcc_s.so.1
b75a8000-b7705000 r-xp 00000000 08:01 32527 /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
b7705000-b7707000 r--p 0015d000 08:01 32527 /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
b7707000-b7708000 rw-p 0015f000 08:01 32527 /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
b7708000-b770b000 rw-p 00000000 00:00 0
b770b000-b772f000 r-xp 00000000 08:01 32531 /lib/i386-linux-gnu/i686/cmov/libm-2.13.so
b772f000-b7730000 r--p 00023000 08:01 32531 /lib/i386-linux-gnu/i686/cmov/libm-2.13.so
b7730000-b7731000 rw-p 00024000 08:01 32531 /lib/i386-linux-gnu/i686/cmov/libm-2.13.so
b7731000-b7748000 r-xp 00000000 08:01 32615 /lib/i386-linux-gnu/libz.so.1.2.7
b7748000-b7749000 r--p 00016000 08:01 32615 /lib/i386-linux-gnu/libz.so.1.2.7Stacktrace:

at (wrapper managed-to-native) Python.Runtime.Runtime.Py_Initialize () <0xffffffff>
at Python.Runtime.Runtime.Initialize () <0x00013>
at Python.Runtime.PythonEngine.Initialize () <0x00047>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

/usr/lib/libmono-2.0.so.1(+0xb5b43) [0xb705ab43]
[0xb777c410]
[0xb777c422]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x51) [0xb75d2681]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x182) [0xb75d5ab2]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x66b55) [0xb760eb55]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x70c41) [0xb7618c41]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x724a8) [0xb761a4a8]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d) [0xb761d5ed]
/usr/lib/libpython2.7.so.1.0(PyString_InternInPlace+0xaf) [0xb6e3f7af]

Debug info from gdb:


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Mono 2.10.8.1-8
libglib2.0-dev 2.33.12+really2.32.4-5

Have any suggestions how to fix this? Help very welcome!

Best regards,
Renat Zaripov


_________________________________________________
Python.NET mailing list - PythonDotNet-+ZN9ApsXKcEdnm+***@public.gmane.org
https://mail.python.org/mailman/listinfo/pythondotnet
Tony Roberts
2014-10-17 16:30:24 UTC
Permalink
Hi,

probably your python has not been compiled with --enable-shared, and so it
ends up loading the python core twice (once in the executable, and again in
the so referenced by the pythonnet module). This means that the one
pythonnet is using doesn't get initialized correctly.

You could try building python yourself with --enable-shared. Here are some
instructions (there are loads of others, I just found this on google):
http://du-alter-schwede.azurewebsites.net/index.php/2012/07/26/how-to-build-python-so-that-a-shared-library-libpythonx-y-so-is-produced/

Otherwise you could use the npython binary that builds as part of the
pythonnet project.

You might also want to try the latest version of the pythonnet code from
the develop branch on github. It's got a Travis CI build so does get built
and tested on linux (ubuntu not debian though) - although you should be
able to get the svn code working too.
https://github.com/pythonnet/pythonnet
https://travis-ci.org/pythonnet/pythonnet/builds

cheers,
Tony


On Fri, Oct 17, 2014 at 11:41 AM, <zaripov-***@public.gmane.org> wrote:

> Hi!
>
> First, sorry for my English. I'm trying to use pythonnet on Debian Wheezy.
> I'm checkout svn trunk, when install mono-2, and other dependencies.
> Building clr.so done without errors. On the next step I'm put clr.so,
> Python.Runtime.dll and Python.Runtime.dll.config in
> /usr/local/lib/python2.7/dist-packages.
> But when I'm try to use this, I'm got such traceback:
>
> ***@debian-salt:/usr/local/lib/python2.7/dist-packages# python
> Python 2.7.3 (default, Mar 14 2014, 11:57:14)
> [GCC 4.7.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import clr
> *** glibc detected *** python: free(): invalid pointer: 0xb6653180 ***
> ======= Backtrace: =========
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x70c41)[0xb7618c41]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x724a8)[0xb761a4a8]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d)[0xb761d5ed]
> /usr/lib/libpython2.7.so.1.0(PyString_InternInPlace+0xaf)[0xb6e3f7af]
> ======= Memory map: ========
> 00010000-00081000 rw-p 00000000 00:00 0
> 08048000-0828e000 r-xp 00000000 08:05 23939 /usr/bin/python2.7
> 0828e000-0828f000 r--p 00245000 08:05 23939 /usr/bin/python2.7
> 0828f000-082e4000 rw-p 00246000 08:05 23939 /usr/bin/python2.7
> 082e4000-082f1000 rw-p 00000000 00:00 0
> 09e7a000-09fec000 rw-p 00000000 00:00 0 [heap]
> b6500000-b6521000 rw-p 00000000 00:00 0
> b6521000-b6600000 ---p 00000000 00:00 0
> b6652000-b6693000 rw-p 00000000 00:00 0
> b6693000-b66ae000 r--p 00000000 08:05 46606
> /usr/local/lib/python2.7/dist-packages/Python.Runtime.dll
> b66ae000-b66b7000 ---p 00000000 00:00 0
> b66b7000-b67b0000 rw-p 00000000 00:00 0
> b67b0000-b67cf000 ---p 00000000 00:00 0
> b67cf000-b67e0000 rwxp 00000000 00:00 0
> b67e0000-b67ea000 r-xp 00000000 08:01 32537
> /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
> b67ea000-b67eb000 r--p 00009000 08:01 32537
> /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
> b67eb000-b67ec000 rw-p 0000a000 08:01 32537
> /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
> b67ec000-b67f5000 r-xp 00000000 08:01 32539
> /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
> b67f5000-b67f6000 r--p 00008000 08:01 32539
> /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
> b67f6000-b67f7000 rw-p 00009000 08:01 32539
> /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
> b67f7000-b680a000 r-xp 00000000 08:01 32533
> /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
> b680a000-b680b000 r--p 00012000 08:01 32533
> /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
> b680b000-b680c000 rw-p 00013000 08:01 32533
> /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
> b680c000-b680e000 rw-p 00000000 00:00 0
> b6814000-b6818000 rw-p 00000000 00:00 0
> b6818000-b681a000 r-xp 00000000 08:05 10456
> /usr/lib/i386-linux-gnu/gconv/UTF-16.so
> b681a000-b681b000 r--p 00001000 08:05 10456
> /usr/lib/i386-linux-gnu/gconv/UTF-16.so
> b681b000-b681c000 rw-p 00002000 08:05 10456
> /usr/lib/i386-linux-gnu/gconv/UTF-16.so
> b681c000-b6a96000 r--p 00000000 08:05 41796
> /usr/lib/mono/2.0/mscorlib.dll
> b6a96000-b6aa7000 rwxp 00000000 00:00 0
> b6aa7000-b6ae4000 r-xp 00000000 08:01 33080
> /lib/i386-linux-gnu/libpcre.so.3.13.1
> b6ae4000-b6ae5000 rw-p 0003c000 08:01 33080
> /lib/i386-linux-gnu/libpcre.so.3.13.1
> b6ae5000-b6bc5000 r-xp 00000000 08:05 4041
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
> b6bc5000-b6bc9000 r--p 000e0000 08:05 4041
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
> b6bc9000-b6bca000 rw-p 000e4000 08:05 4041
> /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
> b6bca000-b6bd1000 rw-p 00000000 00:00 0
> b6bd1000-b6ccc000 r-xp 00000000 08:01 33092
> /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
> b6ccc000-b6ccd000 r--p 000fa000 08:01 33092
> /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
> b6ccd000-b6cce000 rw-p 000fb000 08:01 33092
> /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
> b6cce000-b6f39000 r-xp 00000000 08:05 38605
> /usr/lib/libpython2.7.so.1.0
> b6f39000-b6f3a000 r--p 0026b000 08:05 38605
> /usr/lib/libpython2.7.so.1.0
> b6f3a000-b6f8f000 rw-p 0026c000 08:05 38605
> /usr/lib/libpython2.7.so.1.0
> b6f8f000-b6f9c000 rw-p 00000000 00:00 0
> b6f9c000-b6fa3000 r-xp 00000000 08:01 32543
> /lib/i386-linux-gnu/i686/cmov/librt-2.13.so
> b6fa3000-b6fa4000 r--p 00006000 08:01 32543
> /lib/i386-linux-gnu/i686/cmov/librt-2.13.so
> b6fa4000-b6fa5000 rw-p 00007000 08:01 32543
> /lib/i386-linux-gnu/i686/cmov/librt-2.13.so
> b6fa5000-b72b6000 r-xp 00000000 08:05 41753
> /usr/lib/libmono-2.0.so.1.0.0
> b72b6000-b72b9000 r--p 00310000 08:05 41753
> /usr/lib/libmono-2.0.so.1.0.0
> b72b9000-b72be000 rw-p 00313000 08:05 41753
> /usr/lib/libmono-2.0.so.1.0.0
> b72be000-b72dd000 rw-p 00000000 00:00 0
> b72de000-b72e4000 r-xp 00000000 08:01 32535
> /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
> b72e4000-b72e5000 r--p 00005000 08:01 32535
> /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
> b72e5000-b72e6000 rw-p 00006000 08:01 32535
> /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
> b72e6000-b72e7000 rw-s 00000000 00:11 939641 /run/shm/mono.7877
> b72e7000-b72eb000 rw-p 00000000 00:00 0
> b72eb000-b7308000 r-xp 00000000 08:01 32559
> /lib/i386-linux-gnu/libtinfo.so.5.9
> b7308000-b730a000 r--p 0001c000 08:01 32559
> /lib/i386-linux-gnu/libtinfo.so.5.9
> b730a000-b730b000 rw-p 0001e000 08:01 32559
> /lib/i386-linux-gnu/libtinfo.so.5.9
> b730b000-b7343000 r-xp 00000000 08:01 32576
> /lib/i386-linux-gnu/libreadline.so.6.2
> b7343000-b7344000 r--p 00038000 08:01 32576
> /lib/i386-linux-gnu/libreadline.so.6.2
> b7344000-b7347000 rw-p 00039000 08:01 32576
> /lib/i386-linux-gnu/libreadline.so.6.2
> b7347000-b7349000 rw-p 00000000 00:00 0
> b7349000-b734d000 r-xp 00000000 08:05 24426
> /usr/lib/python2.7/lib-dynload/readline.so
> b734d000-b734e000 r--p 00003000 08:05 24426
> /usr/lib/python2.7/lib-dynload/readline.so
> b734e000-b734f000 rw-p 00004000 08:05 24426
> /usr/lib/python2.7/lib-dynload/readline.so
> b734f000-b74c6000 r--p 00000000 08:05 6381
> /usr/lib/locale/locale-archive
> b74c6000-b758b000 rw-p 00000000 00:00 0
> b758b000-b75a7000 r-xp 00000000 08:01 32523
> /lib/i386-linux-gnu/libgcc_s.so.1
> b75a7000-b75a8000 rw-p 0001b000 08:01 32523
> /lib/i386-linux-gnu/libgcc_s.so.1
> b75a8000-b7705000 r-xp 00000000 08:01 32527
> /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
> b7705000-b7707000 r--p 0015d000 08:01 32527
> /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
> b7707000-b7708000 rw-p 0015f000 08:01 32527
> /lib/i386-linux-gnu/i686/cmov/libc-2.13.so
> b7708000-b770b000 rw-p 00000000 00:00 0
> b770b000-b772f000 r-xp 00000000 08:01 32531
> /lib/i386-linux-gnu/i686/cmov/libm-2.13.so
> b772f000-b7730000 r--p 00023000 08:01 32531
> /lib/i386-linux-gnu/i686/cmov/libm-2.13.so
> b7730000-b7731000 rw-p 00024000 08:01 32531
> /lib/i386-linux-gnu/i686/cmov/libm-2.13.so
> b7731000-b7748000 r-xp 00000000 08:01 32615
> /lib/i386-linux-gnu/libz.so.1.2.7
> b7748000-b7749000 r--p 00016000 08:01 32615
> /lib/i386-linux-gnu/libz.so.1.2.7Stacktrace:
>
> at (wrapper managed-to-native) Python.Runtime.Runtime.Py_Initialize ()
> <0xffffffff>
> at Python.Runtime.Runtime.Initialize () <0x00013>
> at Python.Runtime.PythonEngine.Initialize () <0x00047>
> at (wrapper runtime-invoke) object.runtime_invoke_void
> (object,intptr,intptr,intptr) <0xffffffff>
>
> Native stacktrace:
>
> /usr/lib/libmono-2.0.so.1(+0xb5b43) [0xb705ab43]
> [0xb777c410]
> [0xb777c422]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x51) [0xb75d2681]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x182) [0xb75d5ab2]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x66b55) [0xb760eb55]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x70c41) [0xb7618c41]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x724a8) [0xb761a4a8]
> /lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d) [0xb761d5ed]
> /usr/lib/libpython2.7.so.1.0(PyString_InternInPlace+0xaf)
> [0xb6e3f7af]
>
> Debug info from gdb:
>
>
> =================================================================
> Got a SIGABRT while executing native code. This usually indicates
> a fatal error in the mono runtime or one of the native libraries
> used by your application.
> =================================================================
>
> Mono 2.10.8.1-8
> libglib2.0-dev 2.33.12+really2.32.4-5
>
> Have any suggestions how to fix this? Help very welcome!
>
> Best regards,
> Renat Zaripov
>
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet-+ZN9ApsXKcEdnm+***@public.gmane.org
> https://mail.python.org/mailman/listinfo/pythondotnet
>
z***@public.gmane.org
2014-10-18 20:54:47 UTC
Permalink
Hi Tony,

Your assumption about build option --enable-shared absolutely correct. Simple way to check this with using ldd:

***@debian-salt:~# ldd /usr/bin/python2.7
linux-gate.so.1 (0xb772c000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb7702000)
libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xb76fd000)
libutil.so.1 => /lib/i386-linux-gnu/i686/cmov/libutil.so.1 (0xb76f8000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb76db000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb7695000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb74ea000)
/lib/ld-linux.so.2 (0xb772d000)

***@debian-salt:~# ldd /usr/local/lib/python2.7/dist-packages/pythonnet-2.0.0.dev1-py2.7-linux-i686.egg/EGG-INFO/scripts/npython
linux-gate.so.1 (0xb7727000)
libmonoboehm-2.0.so.1 => /usr/lib/libmonoboehm-2.0.so.1 (0xb7325000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb72df000)
librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xb72d5000)
libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xb72d0000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb72b4000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb718c000)
libpython2.7.so.1.0 => /usr/lib/i386-linux-gnu/libpython2.7.so.1.0 (0xb6de5000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb6c39000)
/lib/ld-linux.so.2 (0xb7728000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb6bc8000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb6bab000)
libutil.so.1 => /lib/i386-linux-gnu/i686/cmov/libutil.so.1 (0xb6ba7000)

As you can see libpython2.7.so.1.0 not linked with python that shipped with debian. For me using npython is prefer, than build and replace python. Building pythonnet on Debian done well, with minor problems. Because Wheezy contains stable versions (in other words old) of packages, I'm using mono and gcc packages from sid. I'll thinking that pythonnet is dead when looked into sourceforge. How I'm not found this project on GitHub? It is strange...

Thank you for explanation and advices, they helped me!

Best regards,

Renat Zaripov

________________________________
От: PythonDotNet [pythondotnet-bounces+zaripov=***@python.org] от имени Tony Roberts [***@pyxll.com]
Отправлено: 17 октября 2014 г. 20:30
To: A list for users and developers of Python for .NET
Тема: Re: [Python.NET] glibc invalid pointer when importing clr

Hi,

probably your python has not been compiled with --enable-shared, and so it ends up loading the python core twice (once in the executable, and again in the so referenced by the pythonnet module). This means that the one pythonnet is using doesn't get initialized correctly.

You could try building python yourself with --enable-shared. Here are some instructions (there are loads of others, I just found this on google):
http://du-alter-schwede.azurewebsites.net/index.php/2012/07/26/how-to-build-python-so-that-a-shared-library-libpythonx-y-so-is-produced/

Otherwise you could use the npython binary that builds as part of the pythonnet project.

You might also want to try the latest version of the pythonnet code from the develop branch on github. It's got a Travis CI build so does get built and tested on linux (ubuntu not debian though) - although you should be able to get the svn code working too.
https://github.com/pythonnet/pythonnet
https://travis-ci.org/pythonnet/pythonnet/builds

cheers,
Tony


On Fri, Oct 17, 2014 at 11:41 AM, <***@electronxray.com<mailto:***@electronxray.com>> wrote:
Hi!

First, sorry for my English. I'm trying to use pythonnet on Debian Wheezy. I'm checkout svn trunk, when install mono-2, and other dependencies. Building clr.so done without errors. On the next step I'm put clr.so, Python.Runtime.dll and Python.Runtime.dll.config in /usr/local/lib/python2.7/dist-packages.
But when I'm try to use this, I'm got such traceback:

***@debian-salt:/usr/local/lib/python2.7/dist-packages# python
Python 2.7.3 (default, Mar 14 2014, 11:57:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
*** glibc detected *** python: free(): invalid pointer: 0xb6653180 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x70c41)[0xb7618c41]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x724a8)[0xb761a4a8]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d)[0xb761d5ed]
/usr/lib/libpython2.7.so.1.0(PyString_InternInPlace+0xaf)[0xb6e3f7af]
======= Memory map: ========
00010000-00081000 rw-p 00000000 00:00 0
08048000-0828e000 r-xp 00000000 08:05 23939 /usr/bin/python2.7
0828e000-0828f000 r--p 00245000 08:05 23939 /usr/bin/python2.7
0828f000-082e4000 rw-p 00246000 08:05 23939 /usr/bin/python2.7
082e4000-082f1000 rw-p 00000000 00:00 0
09e7a000-09fec000 rw-p 00000000 00:00 0 [heap]
b6500000-b6521000 rw-p 00000000 00:00 0
b6521000-b6600000 ---p 00000000 00:00 0
b6652000-b6693000 rw-p 00000000 00:00 0
b6693000-b66ae000 r--p 00000000 08:05 46606 /usr/local/lib/python2.7/dist-packages/Python.Runtime.dll
b66ae000-b66b7000 ---p 00000000 00:00 0
b66b7000-b67b0000 rw-p 00000000 00:00 0
b67b0000-b67cf000 ---p 00000000 00:00 0
b67cf000-b67e0000 rwxp 00000000 00:00 0
b67e0000-b67ea000 r-xp 00000000 08:01 32537 /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so<http://libnss_files-2.13.so>
b67ea000-b67eb000 r--p 00009000 08:01 32537 /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so<http://libnss_files-2.13.so>
b67eb000-b67ec000 rw-p 0000a000 08:01 32537 /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so<http://libnss_files-2.13.so>
b67ec000-b67f5000 r-xp 00000000 08:01 32539 /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so<http://libnss_nis-2.13.so>
b67f5000-b67f6000 r--p 00008000 08:01 32539 /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so<http://libnss_nis-2.13.so>
b67f6000-b67f7000 rw-p 00009000 08:01 32539 /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so<http://libnss_nis-2.13.so>
b67f7000-b680a000 r-xp 00000000 08:01 32533 /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so<http://libnsl-2.13.so>
b680a000-b680b000 r--p 00012000 08:01 32533 /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so<http://libnsl-2.13.so>
b680b000-b680c000 rw-p 00013000 08:01 32533 /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so<http://libnsl-2.13.so>
b680c000-b680e000 rw-p 00000000 00:00 0
b6814000-b6818000 rw-p 00000000 00:00 0
b6818000-b681a000 r-xp 00000000 08:05 10456 /usr/lib/i386-linux-gnu/gconv/UTF-16.so
b681a000-b681b000 r--p 00001000 08:05 10456 /usr/lib/i386-linux-gnu/gconv/UTF-16.so
b681b000-b681c000 rw-p 00002000 08:05 10456 /usr/lib/i386-linux-gnu/gconv/UTF-16.so
b681c000-b6a96000 r--p 00000000 08:05 41796 /usr/lib/mono/2.0/mscorlib.dll
b6a96000-b6aa7000 rwxp 00000000 00:00 0
b6aa7000-b6ae4000 r-xp 00000000 08:01 33080 /lib/i386-linux-gnu/libpcre.so.3.13.1
b6ae4000-b6ae5000 rw-p 0003c000 08:01 33080 /lib/i386-linux-gnu/libpcre.so.3.13.1
b6ae5000-b6bc5000 r-xp 00000000 08:05 4041 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
b6bc5000-b6bc9000 r--p 000e0000 08:05 4041 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
b6bc9000-b6bca000 rw-p 000e4000 08:05 4041 /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17
b6bca000-b6bd1000 rw-p 00000000 00:00 0
b6bd1000-b6ccc000 r-xp 00000000 08:01 33092 /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b6ccc000-b6ccd000 r--p 000fa000 08:01 33092 /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b6ccd000-b6cce000 rw-p 000fb000 08:01 33092 /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b6cce000-b6f39000 r-xp 00000000 08:05 38605 /usr/lib/libpython2.7.so.1.0
b6f39000-b6f3a000 r--p 0026b000 08:05 38605 /usr/lib/libpython2.7.so.1.0
b6f3a000-b6f8f000 rw-p 0026c000 08:05 38605 /usr/lib/libpython2.7.so.1.0
b6f8f000-b6f9c000 rw-p 00000000 00:00 0
b6f9c000-b6fa3000 r-xp 00000000 08:01 32543 /lib/i386-linux-gnu/i686/cmov/librt-2.13.so<http://librt-2.13.so>
b6fa3000-b6fa4000 r--p 00006000 08:01 32543 /lib/i386-linux-gnu/i686/cmov/librt-2.13.so<http://librt-2.13.so>
b6fa4000-b6fa5000 rw-p 00007000 08:01 32543 /lib/i386-linux-gnu/i686/cmov/librt-2.13.so<http://librt-2.13.so>
b6fa5000-b72b6000 r-xp 00000000 08:05 41753 /usr/lib/libmono-2.0.so.1.0.0
b72b6000-b72b9000 r--p 00310000 08:05 41753 /usr/lib/libmono-2.0.so.1.0.0
b72b9000-b72be000 rw-p 00313000 08:05 41753 /usr/lib/libmono-2.0.so.1.0.0
b72be000-b72dd000 rw-p 00000000 00:00 0
b72de000-b72e4000 r-xp 00000000 08:01 32535 /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so<http://libnss_compat-2.13.so>
b72e4000-b72e5000 r--p 00005000 08:01 32535 /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so<http://libnss_compat-2.13.so>
b72e5000-b72e6000 rw-p 00006000 08:01 32535 /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so<http://libnss_compat-2.13.so>
b72e6000-b72e7000 rw-s 00000000 00:11 939641 /run/shm/mono.7877
b72e7000-b72eb000 rw-p 00000000 00:00 0
b72eb000-b7308000 r-xp 00000000 08:01 32559 /lib/i386-linux-gnu/libtinfo.so.5.9
b7308000-b730a000 r--p 0001c000 08:01 32559 /lib/i386-linux-gnu/libtinfo.so.5.9
b730a000-b730b000 rw-p 0001e000 08:01 32559 /lib/i386-linux-gnu/libtinfo.so.5.9
b730b000-b7343000 r-xp 00000000 08:01 32576 /lib/i386-linux-gnu/libreadline.so.6.2
b7343000-b7344000 r--p 00038000 08:01 32576 /lib/i386-linux-gnu/libreadline.so.6.2
b7344000-b7347000 rw-p 00039000 08:01 32576 /lib/i386-linux-gnu/libreadline.so.6.2
b7347000-b7349000 rw-p 00000000 00:00 0
b7349000-b734d000 r-xp 00000000 08:05 24426 /usr/lib/python2.7/lib-dynload/readline.so
b734d000-b734e000 r--p 00003000 08:05 24426 /usr/lib/python2.7/lib-dynload/readline.so
b734e000-b734f000 rw-p 00004000 08:05 24426 /usr/lib/python2.7/lib-dynload/readline.so
b734f000-b74c6000 r--p 00000000 08:05 6381 /usr/lib/locale/locale-archive
b74c6000-b758b000 rw-p 00000000 00:00 0
b758b000-b75a7000 r-xp 00000000 08:01 32523 /lib/i386-linux-gnu/libgcc_s.so.1
b75a7000-b75a8000 rw-p 0001b000 08:01 32523 /lib/i386-linux-gnu/libgcc_s.so.1
b75a8000-b7705000 r-xp 00000000 08:01 32527 /lib/i386-linux-gnu/i686/cmov/libc-2.13.so<http://libc-2.13.so>
b7705000-b7707000 r--p 0015d000 08:01 32527 /lib/i386-linux-gnu/i686/cmov/libc-2.13.so<http://libc-2.13.so>
b7707000-b7708000 rw-p 0015f000 08:01 32527 /lib/i386-linux-gnu/i686/cmov/libc-2.13.so<http://libc-2.13.so>
b7708000-b770b000 rw-p 00000000 00:00 0
b770b000-b772f000 r-xp 00000000 08:01 32531 /lib/i386-linux-gnu/i686/cmov/libm-2.13.so<http://libm-2.13.so>
b772f000-b7730000 r--p 00023000 08:01 32531 /lib/i386-linux-gnu/i686/cmov/libm-2.13.so<http://libm-2.13.so>
b7730000-b7731000 rw-p 00024000 08:01 32531 /lib/i386-linux-gnu/i686/cmov/libm-2.13.so<http://libm-2.13.so>
b7731000-b7748000 r-xp 00000000 08:01 32615 /lib/i386-linux-gnu/libz.so.1.2.7
b7748000-b7749000 r--p 00016000 08:01 32615 /lib/i386-linux-gnu/libz.so.1.2.7Stacktrace:

at (wrapper managed-to-native) Python.Runtime.Runtime.Py_Initialize () <0xffffffff>
at Python.Runtime.Runtime.Initialize () <0x00013>
at Python.Runtime.PythonEngine.Initialize () <0x00047>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

/usr/lib/libmono-2.0.so.1(+0xb5b43) [0xb705ab43]
[0xb777c410]
[0xb777c422]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x51) [0xb75d2681]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x182) [0xb75d5ab2]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x66b55) [0xb760eb55]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x70c41) [0xb7618c41]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x724a8) [0xb761a4a8]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d) [0xb761d5ed]
/usr/lib/libpython2.7.so.1.0(PyString_InternInPlace+0xaf) [0xb6e3f7af]

Debug info from gdb:


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Mono 2.10.8.1-8
libglib2.0-dev 2.33.12+really2.32.4-5

Have any suggestions how to fix this? Help very welcome!

Best regards,
Renat Zaripov


_________________________________________________
Python.NET mailing list - ***@python.org<mailto:***@python.org>
https://mail.python.org/mailman/listinfo/pythondotnet

_________________________________________________
Python.NET mailing list - ***@python.org
https://mail.python.org/mailman/
Loading...