Nico Raffo wrote:

> On Jul 22, 5:18 am, James Vega <[email protected]> wrote:
> > On Thu, Jul 22, 2010 at 12:36:27AM -0700, Nico Raffo wrote:
> > > If Vim is compiled with both --enable-pythoninterp and --enable-
> > > python3interp, errors occur when importing many python modules. To
> > > reproduce, compile as described then try something like:
> >
> > > :py import termios
> >
> > I had been meaning to check whether something like that would happen with 
> > the
> > Python interfaces.  I saw something similar when testing the Perl interface.
> > Does the attached patch fix it?
> >
> 
> Thanks. This gets us half way there. I now can import termios with
> both versions of python installed. However if you import it from both
> during one Vim session then Vim crashes and freezes my terminal.
> 
> To reproduce, compile the latest with --enable-pythoninterp and --
> enable-python3interp and with James' patch. Launch Vim and run
> 
> :py import termios
> :py3 import termios
> 
> Vim: Caught deadly signal ABRT
> 
> At this point Vim is gone and my gnome terminal has to be killed.

I also see the crash.  I can recover the terminal (by starting Vim
again).

The output is:

*** glibc detected *** ./vim: free(): invalid pointer: 0xb76990e0 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x1053591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0x1054de8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x1057ecd]
/usr/lib/libpython2.6.so(PyObject_Free+0x54)[0x4168ea4]
/usr/lib/libpython2.6.so(+0x9d213)[0x4190213]
/usr/lib/libpython3.1.so(PyUnicode_InternInPlace+0xd6)[0x11ca576]
/usr/lib/libpython3.1.so(PyUnicode_InternFromString+0x33)[0x11d17e3]
/usr/lib/libpython3.1.so(+0x785d8)[0x11ba5d8]
/usr/lib/libpython3.1.so(PyType_Ready+0x87)[0x11bf7c7]
/usr/lib/libpython3.1.so(_Py_ReadyTypes+0xa4)[0x11ac174]
/usr/lib/libpython3.1.so(Py_InitializeEx+0x86)[0x1218ff6]
/usr/lib/libpython3.1.so(Py_Initialize+0x1e)[0x12195ae]
./vim[0x8211611]
./vim[0x821167c]
./vim(ex_py3+0x41)[0x821179c]
./vim[0x80c89d9]
./vim(do_cmdline+0x944)[0x80c62b2]
./vim[0x814db42]
./vim(normal_cmd+0xf59)[0x8147278]
./vim(main_loop+0x584)[0x8109079]
./vim(main+0xd7c)[0x8108ad0]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xffebd6]
./vim[0x8073f71]

In gdb the stack trace is:

#0  0x0012d422 in __kernel_vsyscall ()
#1  0x00a14651 in *__GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0x00a17a82 in *__GI_abort () at abort.c:92
#3  0x00a4b49d in __libc_message (do_abort=2, 
    fmt=0xb1ff98 "*** glibc detected *** %s: %s: 0x%s ***\n")
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#4  0x00a55591 in malloc_printerr (action=<value optimized out>, 
    str=0x6 <Address 0x6 out of bounds>, ptr=0xb7dbe0e0) at malloc.c:6264
#5  0x00a56de8 in _int_free (av=<value optimized out>, p=<value optimized out>)
    at malloc.c:4792
#6  0x00a59ecd in *__GI___libc_free (mem=0xb7dbe0e0) at malloc.c:3738
#7  0x00f65ea4 in PyObject_Free () from /usr/lib/libpython2.6.so
#8  0x00f8d213 in ?? () from /usr/lib/libpython2.6.so
#9  0x0136f576 in PyUnicode_InternInPlace () from /usr/lib/libpython3.1.so
#10 0x013767e3 in PyUnicode_InternFromString () from /usr/lib/libpython3.1.so
#11 0x0135f5d8 in ?? () from /usr/lib/libpython3.1.so
#12 0x013647c7 in PyType_Ready () from /usr/lib/libpython3.1.so
#13 0x01351174 in _Py_ReadyTypes () from /usr/lib/libpython3.1.so
#14 0x013bdff6 in Py_InitializeEx () from /usr/lib/libpython3.1.so
#15 0x013be5ae in Py_Initialize () from /usr/lib/libpython3.1.so
#16 0x08211611 in Python3_Init () at if_python3.c:527
#17 0x0821167c in DoPy3Command (eap=0xbfffee8c, cmd=0x83cf76c "import termios")
    at if_python3.c:588
#18 0x0821179c in ex_py3 (eap=0xbfffee8c) at if_python3.c:643
#19 0x080c89d9 in do_one_cmd (cmdlinep=0xbffff040, sourcing=0, 
    cstack=0xbffff048, fgetline=0x80dbb9d <getexline>, cookie=0x0)
    at ex_docmd.c:2656
#20 0x080c62b2 in do_cmdline (cmdline=0x0, getline=0x80dbb9d <getexline>, 
    cookie=0x0, flags=0) at ex_docmd.c:1122
#21 0x0814db42 in nv_colon (cap=0xbffff3ac) at normal.c:5295
#22 0x08147278 in normal_cmd (oap=0xbffff46c, toplevel=1) at normal.c:1188
#23 0x08109079 in main_loop (cmdwin=0, noexmode=0) at main.c:1256
#24 0x08108ad0 in main (argc=1, argv=0xbffff6b4) at main.c:964

That it jumps from libpython3.1.so to a function in libpython2.6.so
looks bad.


-- 
BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One.
ANOTHER MONK:    And St.  Attila raised his hand grenade up on high saying "O
                 Lord bless this thy hand grenade that with it thou mayest
                 blow thine enemies to tiny bits, in thy mercy. "and the Lord
                 did grin and people did feast upon the lambs and sloths and
                 carp and anchovies and orang-utans and breakfast cereals and
                 fruit bats and...
BROTHER MAYNARD: Skip a bit brother ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui