GNU bug report logs - #76473
31.0.50; gnutls_pproc leak

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Fri, 21 Feb 2025 15:18:03 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Pip Cet <pipcet <at> protonmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76473 in the body.
You can then email your comments to 76473 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#76473; Package emacs. (Fri, 21 Feb 2025 15:18:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 21 Feb 2025 15:18:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; gnutls_pproc leak
Date: Fri, 21 Feb 2025 16:16:42 +0100
[Message part 1 (text/plain, inline)]
On the features/igc branch, it looks like the process->gnutls_pproc
field is never freed.

This patch would fix that:

[0001-Don-t-forget-to-free-process-gnutls_pproc-if-we-HAVE.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
Helmut



In GNU Emacs 31.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2025-02-21 built on caladan
Repository revision: d13ef81273c45f60add3a7adbea8274a916f469a
Repository branch: fix-gnutls-leak
Windowing system distributor 'The X.Org Foundation', version 11.0.12401004
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --config-cache --enable-checking=all,igc_check_fwd,igc_debug
 --with-mps=debug --with-xpm=ifavailable --with-gif=ifavailable
 --with-native-compilation=no 'CFLAGS=-g -O0 --std=gnu99
 -I/scratch/emacs/mps-install/include -L/scratch/emacs/mps-install/lib''

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSELINUX
LIBSYSTEMD LIBXML2 MODULES MPS NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM
XINERAMA XINPUT2 XRANDR GTK3 ZLIB


Added tag(s) patch. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 21 Feb 2025 16:49:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76473; Package emacs. (Fri, 21 Feb 2025 18:03:02 GMT) Full text and rfc822 format available.

Message #10 received at 76473 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 76473 <at> debbugs.gnu.org
Subject: Re: bug#76473: 31.0.50; gnutls_pproc leak
Date: Fri, 21 Feb 2025 18:02:34 +0000
"Helmut Eller" <eller.helmut <at> gmail.com> writes:

> On the features/igc branch, it looks like the process->gnutls_pproc
> field is never freed.

AFAICT, on w32 (which is the only place where it's used), the
process->gnutls_pproc pointer will keep alive the process indefinitely,
so the entire process is never freed.  Right?

> This patch would fix that:

I believe it would!  Is anyone testing the w32/w64 + gnutls combination?

Pip





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76473; Package emacs. (Fri, 21 Feb 2025 18:40:02 GMT) Full text and rfc822 format available.

Message #13 received at 76473 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 76473 <at> debbugs.gnu.org, eller.helmut <at> gmail.com
Subject: Re: bug#76473: 31.0.50; gnutls_pproc leak
Date: Fri, 21 Feb 2025 20:39:40 +0200
> Cc: 76473 <at> debbugs.gnu.org
> Date: Fri, 21 Feb 2025 18:02:34 +0000
> From:  Pip Cet via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> > This patch would fix that:
> 
> I believe it would!  Is anyone testing the w32/w64 + gnutls combination?

In general, or on the igc branch?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76473; Package emacs. (Fri, 21 Feb 2025 18:45:02 GMT) Full text and rfc822 format available.

Message #16 received at 76473 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76473 <at> debbugs.gnu.org, eller.helmut <at> gmail.com
Subject: Re: bug#76473: 31.0.50; gnutls_pproc leak
Date: Fri, 21 Feb 2025 18:44:17 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes:

>> Cc: 76473 <at> debbugs.gnu.org
>> Date: Fri, 21 Feb 2025 18:02:34 +0000
>> From:  Pip Cet via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>
>> > This patch would fix that:
>>
>> I believe it would!  Is anyone testing the w32/w64 + gnutls combination?
>
> In general, or on the igc branch?

The latter.  This bug is specific to feature/igc, I think, since that's
the only branch that has gnutls_pproc.

Pip





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76473; Package emacs. (Fri, 21 Feb 2025 19:26:02 GMT) Full text and rfc822 format available.

Message #19 received at 76473 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 76473 <at> debbugs.gnu.org, eller.helmut <at> gmail.com
Subject: Re: bug#76473: 31.0.50; gnutls_pproc leak
Date: Fri, 21 Feb 2025 21:24:14 +0200
> Date: Fri, 21 Feb 2025 18:44:17 +0000
> From: Pip Cet <pipcet <at> protonmail.com>
> Cc: eller.helmut <at> gmail.com, 76473 <at> debbugs.gnu.org
> 
> "Eli Zaretskii" <eliz <at> gnu.org> writes:
> 
> >> Cc: 76473 <at> debbugs.gnu.org
> >> Date: Fri, 21 Feb 2025 18:02:34 +0000
> >> From:  Pip Cet via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >>
> >> > This patch would fix that:
> >>
> >> I believe it would!  Is anyone testing the w32/w64 + gnutls combination?
> >
> > In general, or on the igc branch?
> 
> The latter.  This bug is specific to feature/igc, I think, since that's
> the only branch that has gnutls_pproc.

If you or Helmut tell me what to try and what to notice, I can do
that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76473; Package emacs. (Fri, 21 Feb 2025 19:59:02 GMT) Full text and rfc822 format available.

Message #22 received at 76473 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76473 <at> debbugs.gnu.org, eller.helmut <at> gmail.com
Subject: Re: bug#76473: 31.0.50; gnutls_pproc leak
Date: Fri, 21 Feb 2025 19:58:19 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes:

>> Date: Fri, 21 Feb 2025 18:44:17 +0000
>> From: Pip Cet <pipcet <at> protonmail.com>
>> Cc: eller.helmut <at> gmail.com, 76473 <at> debbugs.gnu.org
>>
>> "Eli Zaretskii" <eliz <at> gnu.org> writes:
>>
>> >> Cc: 76473 <at> debbugs.gnu.org
>> >> Date: Fri, 21 Feb 2025 18:02:34 +0000
>> >> From:  Pip Cet via "Bug reports for GNU Emacs,
>> >>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> >>
>> >> > This patch would fix that:
>> >>
>> >> I believe it would!  Is anyone testing the w32/w64 + gnutls combination?
>> >
>> > In general, or on the igc branch?
>>
>> The latter.  This bug is specific to feature/igc, I think, since that's
>> the only branch that has gnutls_pproc.
>
> If you or Helmut tell me what to try and what to notice, I can do
> that.

Can you watch the PVEC_PROCESS line (in M-x igc-stats) or the
xzalloc-ambig line (in M-x igc-roots-stats) while creating and
destroying a number of gnutls processes?

Without the patch, the numbers should go up but never down.  With the
patch, all should be fine :-)

Thanks!
Pip





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76473; Package emacs. (Sat, 22 Feb 2025 08:55:03 GMT) Full text and rfc822 format available.

Message #25 received at 76473 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 76473 <at> debbugs.gnu.org, eller.helmut <at> gmail.com
Subject: Re: bug#76473: 31.0.50; gnutls_pproc leak
Date: Sat, 22 Feb 2025 10:54:36 +0200
> Date: Fri, 21 Feb 2025 19:58:19 +0000
> From: Pip Cet <pipcet <at> protonmail.com>
> Cc: eller.helmut <at> gmail.com, 76473 <at> debbugs.gnu.org
> 
> "Eli Zaretskii" <eliz <at> gnu.org> writes:
> 
> >> Date: Fri, 21 Feb 2025 18:44:17 +0000
> >> From: Pip Cet <pipcet <at> protonmail.com>
> >> Cc: eller.helmut <at> gmail.com, 76473 <at> debbugs.gnu.org
> >>
> >> "Eli Zaretskii" <eliz <at> gnu.org> writes:
> >>
> >> >> Cc: 76473 <at> debbugs.gnu.org
> >> >> Date: Fri, 21 Feb 2025 18:02:34 +0000
> >> >> From:  Pip Cet via "Bug reports for GNU Emacs,
> >> >>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >> >>
> >> >> > This patch would fix that:
> >> >>
> >> >> I believe it would!  Is anyone testing the w32/w64 + gnutls combination?
> >> >
> >> > In general, or on the igc branch?
> >>
> >> The latter.  This bug is specific to feature/igc, I think, since that's
> >> the only branch that has gnutls_pproc.
> >
> > If you or Helmut tell me what to try and what to notice, I can do
> > that.
> 
> Can you watch the PVEC_PROCESS line (in M-x igc-stats) or the
> xzalloc-ambig line (in M-x igc-roots-stats) while creating and
> destroying a number of gnutls processes?
> 
> Without the patch, the numbers should go up but never down.  With the
> patch, all should be fine :-)

I indeed see that with the patch, igc-collect and/or deleting the
processes (in the list-processes display) makes the number of
PVEC_PROCESS objects go down, whereas without the patch it stays at
the same value it had before (and goes up when I invoke eww for
another HTTPS connection).  However, even with the patch, the number
never goes back to zero, only to 1.  Don't know if it's important or
not.

Anyway, the patch seems to be TRT, thanks.




Reply sent to Pip Cet <pipcet <at> protonmail.com>:
You have taken responsibility. (Sat, 22 Feb 2025 14:35:06 GMT) Full text and rfc822 format available.

Notification sent to Helmut Eller <eller.helmut <at> gmail.com>:
bug acknowledged by developer. (Sat, 22 Feb 2025 14:35:07 GMT) Full text and rfc822 format available.

Message #30 received at 76473-done <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76473-done <at> debbugs.gnu.org, eller.helmut <at> gmail.com
Subject: Re: bug#76473: 31.0.50; gnutls_pproc leak
Date: Sat, 22 Feb 2025 14:34:27 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes:

>> Date: Fri, 21 Feb 2025 19:58:19 +0000
>> From: Pip Cet <pipcet <at> protonmail.com>
>> Cc: eller.helmut <at> gmail.com, 76473 <at> debbugs.gnu.org
>>
>> "Eli Zaretskii" <eliz <at> gnu.org> writes:
>>
>> >> Date: Fri, 21 Feb 2025 18:44:17 +0000
>> >> From: Pip Cet <pipcet <at> protonmail.com>
>> >> Cc: eller.helmut <at> gmail.com, 76473 <at> debbugs.gnu.org
>> >>
>> >> "Eli Zaretskii" <eliz <at> gnu.org> writes:
>> >>
>> >> >> Cc: 76473 <at> debbugs.gnu.org
>> >> >> Date: Fri, 21 Feb 2025 18:02:34 +0000
>> >> >> From:  Pip Cet via "Bug reports for GNU Emacs,
>> >> >>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> >> >>
>> >> >> > This patch would fix that:
>> >> >>
>> >> >> I believe it would!  Is anyone testing the w32/w64 + gnutls combination?
>> >> >
>> >> > In general, or on the igc branch?
>> >>
>> >> The latter.  This bug is specific to feature/igc, I think, since that's
>> >> the only branch that has gnutls_pproc.
>> >
>> > If you or Helmut tell me what to try and what to notice, I can do
>> > that.
>>
>> Can you watch the PVEC_PROCESS line (in M-x igc-stats) or the
>> xzalloc-ambig line (in M-x igc-roots-stats) while creating and
>> destroying a number of gnutls processes?
>>
>> Without the patch, the numbers should go up but never down.  With the
>> patch, all should be fine :-)
>
> I indeed see that with the patch, igc-collect and/or deleting the
> processes (in the list-processes display) makes the number of
> PVEC_PROCESS objects go down, whereas without the patch it stays at
> the same value it had before (and goes up when I invoke eww for
> another HTTPS connection).  However, even with the patch, the number
> never goes back to zero, only to 1.  Don't know if it's important or
> not.

Thanks!  Since there is no process in M-x list-processes (such as a
server process), I think it's most likely that an "ambiguous" reference
to a destroyed process survives on the bytecode stack or the C stack.
So my guess it's that's a harmless side-effect of conservative garbage
collection.

> Anyway, the patch seems to be TRT, thanks.

Thanks, Helmut!  I've changed the subject line to reference the bug
number, but otherwise what I just pushed should be identical to what you
sent!

Closing this bug.

Pip





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 23 Mar 2025 11:24:49 GMT) Full text and rfc822 format available.

This bug report was last modified 140 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.