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

Issue 158 in vim: ":echo serverlist()" leaks memory every time it is run.

Expand Messages
  • vim@...
    Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 158 by dominiqu...@gmail.com: :echo serverlist() leaks memory every time it is run.
    Message 1 of 2 , Jul 24, 2013
    • 0 Attachment
      Status: New
      Owner: ----
      Labels: Type-Defect Priority-Medium

      New issue 158 by dominiqu...@...: ":echo serverlist()" leaks memory
      every time it is run.
      http://code.google.com/p/vim/issues/detail?id=158

      Description: the Ex command ":echo serverlist()" leaks memory every
      time it is run.

      What steps will reproduce the problem?

      1. Run the following command which run ":echo serverlist()" 20 times
      for example (it will result in 20 blocks leaked):

      $ valgrind --leak-check=yes \
      --log-file=valgrind.log \
      ./vim -c 'for i in range(20)|echo serverlist()|endfor|q'

      2. Observe 20 blocks leaked in valgrind.log:

      $ cat valgrind.log
      ...
      ==4730== 20 bytes in 20 blocks are definitely lost in loss record 11 of 34
      ==4730== at 0x4C2B3F8: malloc (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==4730== by 0x5269888: XtMalloc (in
      /usr/lib/x86_64-linux-gnu/libXt.so.6.0.0)
      ==4730== by 0x5274B20: XtOpenDisplay (in
      /usr/lib/x86_64-linux-gnu/libXt.so.6.0.0)
      ==4730== by 0x5423DD: setup_term_clip (os_unix.c:6704)
      ==4730== by 0x4360AE: f_serverlist (eval.c:15007)
      ==4730== by 0x44A962: call_func (eval.c:8530)
      ==4730== by 0x451213: get_func_tv (eval.c:8343)
      ==4730== by 0x44E3D3: eval7 (eval.c:5153)
      ==4730== by 0x44EF75: eval6.constprop.106 (eval.c:4805)
      ==4730== by 0x44FE63: eval3 (eval.c:4621)
      ==4730== by 0x4501C2: eval2 (eval.c:4155)
      ==4730== by 0x450AF3: ex_echo (eval.c:4080)
      ==4730== by 0x479F1A: do_one_cmd (ex_docmd.c:2689)
      ==4730== by 0x47D25C: do_cmdline (ex_docmd.c:1127)
      ==4730== by 0x40A480: main (main.c:2898)

      What version of the product are you using? On what operating system?

      7.4a.44 BETA (huge) on Linux x86_64.

      Please provide any additional information below.

      Vim leaks here in os_unix.c:

      6704 xterm_dpy = XtOpenDisplay(app_context, xterm_display,
      6705 "vim_xterm", "Vim_xterm", NULL, 0, &z, &strp);

      I suppose that we need to call XtCloseDisplay(xterm_dpy) somewhere
      but I'm not sure where it's safe to call it.


      --
      You received this message because this project is configured to send all
      issue notifications to this address.
      You may adjust your notification preferences at:
      https://code.google.com/hosting/settings

      --
      --
      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.
    • vim@...
      Updates: Status: WontFix Comment #1 on issue 158 by brammool...@gmail.com: :echo serverlist() leaks memory every time it is run.
      Message 2 of 2 , Jul 27, 2013
      • 0 Attachment
        Updates:
        Status: WontFix

        Comment #1 on issue 158 by brammool...@...: ":echo serverlist()"
        leaks memory every time it is run.
        http://code.google.com/p/vim/issues/detail?id=158

        XtCloseDisplay() is intentionally skipped. In os_unix.c:

        # if 0
        /* Lesstif and Solaris crash here, lose some memory */
        XtCloseDisplay(xterm_dpy);
        # endif

        The amount of memory lost is negligible.

        --
        You received this message because this project is configured to send all
        issue notifications to this address.
        You may adjust your notification preferences at:
        https://code.google.com/hosting/settings

        --
        --
        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.