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

bug in python interface (SEGFAULT)

Expand Messages
  • Johannes Zellner
    Hello, having fun! PyEval (...) range py import vim py buf = vim.current.buffer exe py lines = buf[ .a:firstline. : .a:lastline. ] py print lines endfun and
    Message 1 of 2 , Jul 7 7:58 PM
    • 0 Attachment
      Hello,

      having

      fun! PyEval (...) range
      py import vim
      py buf = vim.current.buffer
      exe 'py lines = buf['.a:firstline.':'.a:lastline.']'
      py print lines
      endfun

      and selecting a range of lines visuall (say 5), then typing

      :'<,'>call PyEval()

      and everything is ok. But doing the same thing once
      more will SEGFAULT vim. (vim-5.7, python2.0)

      can anybody reproduce this?

      --
      Johannes
    • Johannes Zellner
      ... I can reproduce it myself when linking against python1.5 here is the gdb output: Program received signal SIGSEGV, Segmentation fault. 0x828544b in ?? ()
      Message 2 of 2 , Jul 7 8:21 PM
      • 0 Attachment
        On Sat, 8 Jul 2000, Johannes Zellner wrote:

        > Hello,
        >
        > having
        >
        > fun! PyEval (...) range
        > py import vim
        > py buf = vim.current.buffer
        > exe 'py lines = buf['.a:firstline.':'.a:lastline.']'
        > py print lines
        > endfun
        >
        > and selecting a range of lines visuall (say 5), then typing
        >
        > :'<,'>call PyEval()
        >
        > and everything is ok. But doing the same thing once
        > more will SEGFAULT vim. (vim-5.7, python2.0)
        >
        > can anybody reproduce this?

        I can reproduce it myself when linking against python1.5

        here is the gdb output:

        Program received signal SIGSEGV, Segmentation fault.
        0x828544b in ?? ()
        (gdb) where
        #0 0x828544b in ?? ()
        #1 0x8149275 in apply_slice (u=0x82c4200, v=0x826e7b4, w=0x826e778) at ceval.c:2636
        #2 0x8146757 in eval_code2 (co=0x82ca688, globals=0x82095d4, locals=0x82095d4, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
        defcount=0, owner=0x0) at ceval.c:920
        #3 0x8145b6d in PyEval_EvalCode (co=0x82ca688, globals=0x82095d4, locals=0x82095d4) at ceval.c:300
        #4 0x8157ea0 in run_node (n=0x82c2028, filename=0x81b922f "<string>", globals=0x82095d4, locals=0x82095d4) at pythonrun.c:895
        #5 0x8157e5c in run_err_node (n=0x82c2028, filename=0x81b922f "<string>", globals=0x82095d4, locals=0x82095d4) at pythonrun.c:880
        #6 0x8157e10 in PyRun_String (str=0x826999b "lines = buf[18:24]", start=257, globals=0x82095d4, locals=0x82095d4) at pythonrun.c:857
        #7 0x81575c8 in PyRun_SimpleString (command=0x826999b "lines = buf[18:24]") at pythonrun.c:599
        #8 0x811e98e in DoPythonCommand (eap=0xbfffe634, cmd=0x826999b "lines = buf[18:24]") at if_python.c:160
        #9 0x811e9c4 in do_python (eap=0xbfffe634) at if_python.c:173
        #10 0x8083c1c in do_one_cmd (cmdlinep=0xbfffe804, sourcing=1, cstack=0xbfffe6e4, getline=0x807a5b0 <get_func_line>, cookie=0xbfffeab4)
        at ex_docmd.c:2357
        #11 0x8081361 in do_cmdline (cmdline=0x8281458 "py lines = buf[18:24]", getline=0x807a5b0 <get_func_line>, cookie=0xbfffeab4, flags=3)
        at ex_docmd.c:471
        #12 0x8079652 in do_execute (eap=0xbfffe8a4, getline=0x807a5b0 <get_func_line>, cookie=0xbfffeab4) at eval.c:4768
        #13 0x8083979 in do_one_cmd (cmdlinep=0xbfffea74, sourcing=1, cstack=0xbfffe954, getline=0x807a5b0 <get_func_line>, cookie=0xbfffeab4)
        at ex_docmd.c:2237
        #14 0x8081361 in do_cmdline (cmdline=0x0, getline=0x807a5b0 <get_func_line>, cookie=0xbfffeab4, flags=7) at ex_docmd.c:471
        #15 0x807a3b2 in call_func (fp=0x8278130, argcount=0, argvars=0xbfffeb54, retvar=0xbfffec94, firstline=18, lastline=24) at eval.c:5243
        #16 0x807628c in get_func_var (name=0x82097fa "PyEval", len=6, retvar=0xbfffec94, arg=0xbfffeca8, firstline=18, lastline=24,
        doesrange=0xbfffec88, evaluate=1) at eval.c:2091
        #17 0x8074499 in do_call (eap=0xbfffecf4) at eval.c:656
        #18 0x808398d in do_one_cmd (cmdlinep=0xbfffeec4, sourcing=0, cstack=0xbfffeda4, getline=0x808e8d4 <getexline>, cookie=0x0) at ex_docmd.c:2241
        #19 0x8081361 in do_cmdline (cmdline=0x0, getline=0x808e8d4 <getexline>, cookie=0x0, flags=0) at ex_docmd.c:471
        #20 0x80c4ae3 in nv_colon (cap=0xbfffef60) at normal.c:3567
        #21 0x80c04bc in normal_cmd (oap=0xbffff054, toplevel=1) at normal.c:641
        #22 0x80a1dc1 in main (argc=0, argv=0xbffff17c) at main.c:1566
        #23 0x40323a42 in ()
        (gdb)


        --
        Johannes
      Your message has been successfully submitted and would be delivered to recipients shortly.