[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#32604: closed (26.1.50; memory leak in connect_net

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#32604: closed (26.1.50; memory leak in connect_network_socket)
Date: Thu, 06 Sep 2018 23:42:02 +0000

Your message dated Fri, 07 Sep 2018 08:41:40 +0900
with message-id <address@hidden>
and subject line Re: bug#32604: 26.1.50; memory leak in connect_network_socket
has caused the debbugs.gnu.org bug report #32604,
regarding 26.1.50; memory leak in connect_network_socket
to be marked as done.

(If you believe you have received this mail in error, please contact

32604: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32604
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 26.1.50; memory leak in connect_network_socket Date: Sat, 1 Sep 2018 14:38:51 +0900
In connect_network_socket (in process.c), the memory pointed to
by the variable `sa’ doesn’t seem to be deallocated.

  3328    struct sockaddr *sa = NULL;
  3347    while (!NILP (addrinfos))
  3348      {
  3359        if (sa)
  3360          free (sa);
  3361        sa = xmalloc (addrlen);
  3533      }

The following patch would fix the leak:

diff --git a/src/process.c b/src/process.c
index 676f38446e..e5b70ca058 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3576,6 +3576,8 @@ connect_network_socket (Lisp_Object proc, Lisp_Object 
+  xfree (sa);
   if (s < 0)
       const char *err = (p->is_server

Also, line 3359-3361 above could be:
      sa = xrealloc (addrlen);

                                     YAMAMOTO Mitsuharu

In GNU Emacs 26.1.50 (build 1, x86_64-apple-darwin16.7.0)
 of 2018-09-01 built on YAMAMOTO-no-iMac-5K.local
Repository revision: ac7936cb8f4d4d6706535bfcea0d97741c2ca15f
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --without-ns --without-x-toolkit --without-gnutls
 --with-jpeg=no --with-gif=no --with-tiff=no
 PKG_CONFIG_LIBDIR= --enable-checking=yes,glyphs
 --enable-check-lisp-object-type CFLAGS=-g'

Configured features:

Important settings:
  value of $LANG: ja_JP.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date
mule-util japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue
dynamic-setting font-render-setting x multi-tty make-network-process

Memory information:
((conses 16 97309 7262)
 (symbols 48 20210 2)
 (miscs 40 64 126)
 (strings 32 28170 1559)
 (string-bytes 1 745551)
 (vectors 16 14728)
 (vector-slots 8 572806 12294)
 (floats 8 54 90)
 (intervals 56 261 13)
 (buffers 992 12))

--- End Message ---
--- Begin Message --- Subject: Re: bug#32604: 26.1.50; memory leak in connect_network_socket Date: Fri, 07 Sep 2018 08:41:40 +0900 User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
On Thu, 06 Sep 2018 09:04:27 +0900,
Noam Postavsky wrote:

> YAMAMOTO Mitsuharu <address@hidden> writes:
> > We need to update specbinding according to (potential) change of the
> > value of `sa' by xrealloc call.
> Yes, you're right.  I was confused and somehow dreamed up an extra level
> of indirection in the unwind_protect mechanism.

Installed to the emacs-26 branch.  Closing.

                                     YAMAMOTO Mitsuharu

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]