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

dictionary fun makes gvim crash

Expand Messages
  • Kim Schulz
    Hi I get gvim to crash every time I try the following: let mynumbers = {0: zero ,1: one ,2: two ,3: three ,4: four ,
    Message 1 of 3 , Jan 4, 2007
    • 0 Attachment
      Hi
      I get gvim to crash every time I try the following:

      let mynumbers = {0:'zero',1:'one',2:'two',3:'three',4:'four',
      5:'five',6:'six',7:'seven',8:'eight',9:'nine'}
      function mynumbers.convert(number) dict
      return join(map(split(a:number,'\zs'), 'get(self,
      v:val,"unknown")'))
      endfunction

      echo mynumbers.convert(12345)

      cannot get the same code to crash in the console version of vim.

      another weird thing is that if I call this function (in console vim)
      and uses the argument 123123123123 then it returns as if approx. half
      of the digits are unknown. is it Vim's number<->string conversion
      mechanism that fails or?



      $ gvim --version
      VIM - Vi IMproved 7.0 (2006 May 7, compiled Dec 21 2006 10:24:55)
      Included patches: 1-178
      Compiled by Thierry Vignaud <tvignaud@...>
      Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
      +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
      +cindent
      +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
      +comments
      +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd
      -ebcdic
      +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
      +find_in_path
      +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand
      +jumplist
      +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
      +menu
      +mksession +modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm
      -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang
      -mzscheme
      +netbeans_intg -osfiletype +path_extra +perl +postscript +printer
      +profile
      +python +quickfix +reltime +rightleft -ruby +scrollbind +signs
      +smartindent
      -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
      -tag_any_white +tcl +terminfo +termresponse +textobjects +title
      +toolbar
      +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
      +vreplace
      +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
      +xsmp_interact
      +xterm_clipboard -xterm_save
      system vimrc file: "/etc/vim/vimrc"
      user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
      system gvimrc file: "/etc/vim/gvimrc"
      user gvimrc file: "$HOME/.gvimrc"
      system menu file: "$VIMRUNTIME/menu.vim"
      fall-back for $VIM: "/usr/share/vim"
      Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
      -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
      -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0
      -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
      -I/usr/include/freetype2 -I/usr/include/libpng12 -DORBIT2=1 -pthread
      -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0
      -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/gnome-keyring-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/libxml2 -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib/perl5/5.8.8/i386-linux/CORE -I/usr/include/python2.5 -pthread -I/usr/include -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_LARGEFILE64_SOURCE=1
      Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux/CORE
      -L/usr/local/lib -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
      -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0
      -lgmodule-2.0 -lglib-2.0 -lgnomeui-2 -lbonoboui-2 -lgnome-keyring
      -lxml2 -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0
      -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0
      -lpango-1.0 -lcairo -lbonobo-2 -lgnomevfs-2 -lbonobo-activation
      -lgconf-2 -lgmodule-2.0 -lORBit-2 -lgthread-2.0 -lgobject-2.0
      -lglib-2.0 -lXt -ltermcap -lacl -Wl,-E
      -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux/CORE
      -L/usr/local/lib /usr/lib/perl5/5.8.8/i386-linux/auto/DynaLoader/DynaLoader.a
      -L/usr/lib/perl5/5.8.8/i386-linux/CORE -lperl -lutil -lc
      -L/usr/lib/python2.5/config -lpython2.5 -lutil -Xlinker -export-dynamic
      -L/usr/lib -ltcl8.4 -lieee -lm



      --
      Kim Schulz | Private : http://www.schulz.dk
      Kim@... | Business: http://www.devteam.dk
      +45 5190 4262 | Sparetime: http://www.fundanemt.com
    • Charles E Campbell Jr
      ... As for the first problem, I don t see it with gvim (using Fedora Core 5, gvim 7.0.1-178,huge). As for the second, I doubt that the number 123123123123 fits
      Message 2 of 3 , Jan 4, 2007
      • 0 Attachment
        Kim Schulz wrote:

        >Hi
        >I get gvim to crash every time I try the following:
        >
        >let mynumbers = {0:'zero',1:'one',2:'two',3:'three',4:'four',
        > 5:'five',6:'six',7:'seven',8:'eight',9:'nine'}
        >function mynumbers.convert(number) dict
        > return join(map(split(a:number,'\zs'), 'get(self,
        >v:val,"unknown")'))
        >endfunction
        >
        >echo mynumbers.convert(12345)
        >
        >cannot get the same code to crash in the console version of vim.
        >
        >another weird thing is that if I call this function (in console vim)
        >and uses the argument 123123123123 then it returns as if approx. half
        >of the digits are unknown. is it Vim's number<->string conversion
        >mechanism that fails or?
        >
        >
        As for the first problem, I don't see it with gvim (using Fedora Core 5,
        gvim 7.0.1-178,huge).

        As for the second, I doubt that the number 123123123123 fits inside the
        number of bits in a long integer on your machine.
        Is your machine a 32-bit machine?

        Regards,
        Chip Campbell
      • Bram Moolenaar
        ... I can t reproduce the crash. Anything specific about the Vim you are using? It s weird that it crashes only in the GUI version, there is nothing
        Message 3 of 3 , Jan 8, 2007
        • 0 Attachment
          Kim Schulz wrote:

          > I get gvim to crash every time I try the following:
          >
          > let mynumbers = {0:'zero',1:'one',2:'two',3:'three',4:'four',
          > 5:'five',6:'six',7:'seven',8:'eight',9:'nine'}
          > function mynumbers.convert(number) dict
          > return join(map(split(a:number,'\zs'), 'get(self,
          > v:val,"unknown")'))
          > endfunction
          >
          > echo mynumbers.convert(12345)
          >
          > cannot get the same code to crash in the console version of vim.
          >

          I can't reproduce the crash. Anything specific about the Vim you are
          using?

          It's weird that it crashes only in the GUI version, there is nothing
          GUI-specific being used.

          Perhaps you can have Vim crash in a debugger and find out where it
          happens?

          > another weird thing is that if I call this function (in console vim)
          > and uses the argument 123123123123 then it returns as if approx. half
          > of the digits are unknown. is it Vim's number<->string conversion
          > mechanism that fails or?

          Size of numbers is limited to 32 bits.

          --
          A consultant is a person who takes your money and annoys your employees while
          tirelessly searching for the best way to extend the consulting contract.
          (Scott Adams - The Dilbert principle)

          /// Bram Moolenaar -- Bram@... -- 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 ///
        Your message has been successfully submitted and would be delivered to recipients shortly.