Loading ...
Sorry, an error occurred while loading the content.

:py3 vim.bindeval() causes SIGABRT

Expand Messages
  • Yukihiro Nakadaira
    Steps to reproduce: $ cat a.vim function! Foo() py3 vim.command( py3 0 ) endfunction py3 import vim py3 vim.bindeval( function( Foo ) )() $ vim -u NONE -N ...
    Message 1 of 1 , Mar 24, 2013
      Steps to reproduce:
        $ cat a.vim
        function! Foo()
          py3 vim.command("py3 0")
        py3 import vim
        py3 vim.bindeval('function("Foo")')()

        $ vim -u NONE -N
        :so a.vim
        Vim: Caught deadly signal ABRT

        Same problem with :py.

      Backtrace is

      #0  0x00007ffff509c425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
      #1  0x00007ffff509fb8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
      #2  0x00007fffef02e687 in Py_FatalError (
          msg=0x7fffef130bf0 "PyThreadState_Get: no current thread")
          at ../Python/pythonrun.c:2187
      #3  0x00007fffef027c18 in PyThreadState_Get () at ../Python/pystate.c:382
      #4  0x00007fffeeef0c06 in PyObject_Call (func=0xb47ee0, arg=0x7ffff7f64060,
          kw=0x0) at ../Objects/abstract.c:2150
      #5  0x00007fffeeff7433 in do_call (func=0xb47ee0, pp_stack=0x7fffffffc0a8,
          na=0, nk=0) at ../Python/ceval.c:4141
      #6  0x00007fffeeff6758 in call_function (pp_stack=0x7fffffffc0a8, oparg=0)
          at ../Python/ceval.c:3944
      #7  0x00007fffeeff0663 in PyEval_EvalFrameEx (f=0x9c8bd0, throwflag=0)
          at ../Python/ceval.c:2692
      #8  0x00007fffeeff44a8 in PyEval_EvalCodeEx (_co=0x7fffeec7f490,
          globals=0x93a920, locals=0x93a920, args=0x0, argcount=0, kws=0x0,
          kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0)
          at ../Python/ceval.c:3350
      #9  0x00007fffeefe343d in PyEval_EvalCode (co=0x7fffeec7f490,
          globals=0x93a920, locals=0x93a920) at ../Python/ceval.c:767
      #10 0x00007fffef02d84b in run_mod (mod=0x9c69c0,
          filename=0x7fffef131622 "<string>", globals=0x93a920, locals=0x93a920,
          flags=0x0, arena=0xaaab10) at ../Python/pythonrun.c:1828
      #11 0x00007fffef02d53f in PyRun_StringFlags (
          str=0xd43958 "vim.bindeval('function(\"Foo\")')()", start=257,
          globals=0x93a920, locals=0x93a920, flags=0x0) at ../Python/pythonrun.c:1762
      #12 0x00007fffef02b999 in PyRun_SimpleStringFlags (
          command=0xd43958 "vim.bindeval('function(\"Foo\")')()", flags=0x0)
          at ../Python/pythonrun.c:1324
      #13 0x00007fffef02eccf in PyRun_SimpleString (
          s=0xd43958 "vim.bindeval('function(\"Foo\")')()")
          at ../Python/pythonrun.c:2516
      #14 0x00000000005e37bb in DoPy3Command (eap=0x7fffffffcc40,
          cmd=0x8ace64 "vim.bindeval('function(\"Foo\")')()", rettv=0x0)
          at if_python3.c:841
      #15 0x00000000005e39e8 in ex_py3 (eap=0x7fffffffcc40) at if_python3.c:896
      #16 0x00000000004718c7 in do_one_cmd (cmdlinep=0x7fffffffcd60, sourcing=1,
          cstack=0x7fffffffce50, fgetline=0x46cfc6 <getsourceline>,
          cookie=0x7fffffffd3b0) at ex_docmd.c:2684
      #17 0x000000000046ee2c in do_cmdline (cmdline=0x8c6750 "function! Foo()",
          fgetline=0x46cfc6 <getsourceline>, cookie=0x7fffffffd3b0, flags=7)
          at ex_docmd.c:1122
      #18 0x000000000046cbcc in do_source (fname=0x8ba023 "a.vim", check_other=0,
          is_vimrc=0) at ex_cmds2.c:3260
      #19 0x000000000046c204 in cmd_source (fname=0x8ba023 "a.vim",
          eap=0x7fffffffd5d0) at ex_cmds2.c:2869
      #20 0x000000000046c151 in ex_source (eap=0x7fffffffd5d0) at ex_cmds2.c:2842
      #21 0x00000000004718c7 in do_one_cmd (cmdlinep=0x7fffffffd6f0, sourcing=0,
          cstack=0x7fffffffd7e0, fgetline=0x487955 <getexline>, cookie=0x0)
          at ex_docmd.c:2684
      #22 0x000000000046ee2c in do_cmdline (cmdline=0x0,
          fgetline=0x487955 <getexline>, cookie=0x0, flags=0) at ex_docmd.c:1122
      #23 0x00000000004ffa3e in nv_colon (cap=0x7fffffffdd60) at normal.c:5452
      #24 0x00000000004f855e in normal_cmd (oap=0x7fffffffde00, toplevel=1)
          at normal.c:1199
      #25 0x00000000005edc04 in main_loop (cmdwin=0, noexmode=0) at main.c:1322
      #26 0x00000000005ed510 in main (argc=4, argv=0x7fffffffe108) at main.c:1013

      PyGILState_Ensure/Release are misused.  pygilstate should be local variable.
      I'm not sure if this is correct, but the attached patch seems to work.
      Please check it.

      Yukihiro Nakadaira - yukihiro.nakadaira@...

      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
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    Your message has been successfully submitted and would be delivered to recipients shortly.