all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Moreton <andrewjmoreton@gmail.com>
To: 31946@debbugs.gnu.org
Subject: bug#31946: 27.0.50; The NSM should warn about more TLS problems
Date: Mon, 26 Aug 2019 18:45:14 +0100	[thread overview]
Message-ID: <86zhjvrfbp.fsf@gmail.com> (raw)
In-Reply-To: <m3vaa9aius.fsf@gnus.org>

On Mon 26 Aug 2019, Eli Zaretskii wrote:

>> From: Andy Moreton <andrewjmoreton@gmail.com>
>> Date: Mon, 26 Aug 2019 14:13:18 +0100
>> 
>> On Mon 26 Aug 2019, Lars Ingebrigtsen wrote:
>> 
>> > The netsec branch has now been merged into the trunk and I'm closing
>> > this bug report.
>> 
>> After this merge, the network tests fail on 64 bit windows (MSYS2), and
>> using any network functionality results in crashes.
>> 
>> >From emacs --no-desktop under gdb, running list-packages pops upo the
>> NSM "Certificate information" window and asks "Continue comnecting?".
>> Any of the asnwer for this question result in a crash.
>> 
>> warning: HEAP[emacs.exe]: 
>> warning: Invalid address specified to RtlFreeHeap( 0000000002720000, 0000000006037150 )
>> 
>> Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
>> 0x00007ff9199863b7 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
>> (gdb) #0  0x00007ff9199863b7 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
>> No symbol table info available.
>> #1  0x00007ff919941467 in ntdll!memset () from C:\WINDOWS\SYSTEM32\ntdll.dll
>> No symbol table info available.
>> #2  0x00007ff919985290 in ntdll!RtlpNtMakeTemporaryKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
>> No symbol table info available.
>> #3  0x00007ff9199356b8 in ntdll!memset () from C:\WINDOWS\SYSTEM32\ntdll.dll
>> No symbol table info available.
>> #4  0x00007ff9198c07a0 in ntdll!RtlGetCurrentServiceSessionId () from C:\WINDOWS\SYSTEM32\ntdll.dll
>> No symbol table info available.
>> #5  0x00007ff9198bfba1 in ntdll!RtlFreeHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
>> No symbol table info available.
>> #6  0x000000040029e7aa in free_after_dump (ptr=0x6037150) at C:/emacs/git/emacs/master/src/w32heap.c:504
>> No locals.
>> #7  0x000000040018b7f4 in xfree (block=0x6037150) at C:/emacs/git/emacs/master/src/alloc.c:748
>> No locals.
>> #8  0x0000000400227bb0 in Fgnutls_format_certificate (cert=XIL(0xd97ad24)) at C:/emacs/git/emacs/master/src/gnutls.c:1616
>
> That's because any memory allocated by GnuTLS cannot be freed by Emacs
> via 'free' or 'xfree', it needs to be freed by calling 'gnutls_free'
> (the GnuTLS manual clearly says that, btw).  That crashes, because on
> Windows we use our own implementation of 'free', which uses a
> different heap.

Agreed, but master built from commit 1071a4f still crashes in the same
way:

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00000000051d6248 in ?? () from C:\msys64\mingw64\bin\libgnutls-30.dll
(gdb) bt
#0  0x00000000051d6248 in ?? () from C:\msys64\mingw64\bin\libgnutls-30.dll
#1  0x0000000400227be4 in Fgnutls_format_certificate (cert=XIL(0xd8e36e4)) at C:/emacs/git/emacs/master/src/gnutls.c:1619
#2  0x00000004001c2091 in funcall_subr (subr=0x4006667c0 <Sgnutls_format_certificate>, numargs=0x1, args=0xbfba20) at C:/emacs/git/emacs/master/src/eval.c:2876
[snipped]

Lisp Backtrace:
"gnutls-format-certificate" (0xbfba20)
"nsm-query-user" (0xbfc0a0)
"nsm-query" (0xbfc5b0)
"nsm-check-tls-connection" (0xbfcbc0)
"nsm-verify-connection" (0xbfd0c8)
"read-event" (0xbfdd78)
"sit-for" (0xbfe298)
"execute-extended-command" (0xbfea00)
"funcall-interactively" (0xbfe9f8)
"call-interactively" (0xbfeec0)
"command-execute" (0xbff3f8)

(gdb) f 1
#1  0x0000000400227be4 in Fgnutls_format_certificate (cert=XIL(0xd8e36e4)) at C:/emacs/git/emacs/master/src/gnutls.c:1619
1619      gnutls_free (out.data);

(gdb) info locals
err = 0x0
crt = 0x61947a0
crt_data = {
  data = 0xd8e8588 "-----BEGIN CERTIFICATE-----\nMIIFUTCCBDmgAwIBAgISBOm+yiBCrLLuPB59/zwFk1v7MA0GCSqGSIb3DQEBCwUA\nMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD\nExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw"...,
  size = 0x76f
}
out = {
  data = 0x60fc3f0 "X.509 Certificate Information:\n\tVersion: 3\n\tSerial Number (hex): 04e9beca2042acb2ee3c1e7dff3c05935bfb\n\tIssuer: CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US\n\tValidity:\n\t\tNot Before: Wed Aug 07 20"...,
  size = 0x101f
}
out_buf = 0x9ae8690 "X.509 Certificate Information:\n\tVersion: 3\n\tSerial Number (hex): 04e9beca2042acb2ee3c1e7dff3c05935bfb\n\tIssuer: CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US\n\tValidity:\n\t\tNot Before: Wed Aug 07 20"...
result = XIL(0x5a90003)


In Fgnutls_format_certificate, should out_buf be freed after calling
build_string ? Removing both xfree(out.data) and xfree(out_buf) from the
end of that function does give me a running emacs.

    AndyM






  reply	other threads:[~2019-08-26 17:45 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-23 10:38 bug#31946: 27.0.50; The NSM should warn about more TLS problems Lars Ingebrigtsen
2018-06-24 13:43 ` Lars Ingebrigtsen
2018-06-26  1:23 ` Noam Postavsky
2018-06-26  4:11   ` Jimmy Yuen Ho Wong
2018-06-26  6:26     ` Jimmy Yuen Ho Wong
2018-06-26 12:44       ` Noam Postavsky
2018-06-26 14:38       ` Eli Zaretskii
2018-07-03 15:08       ` Lars Ingebrigtsen
2018-07-04  1:34         ` Noam Postavsky
2018-07-08 14:20           ` Lars Ingebrigtsen
2018-07-08 14:21           ` Lars Ingebrigtsen
2018-07-08 14:22           ` Lars Ingebrigtsen
2018-07-08 18:34             ` Lars Ingebrigtsen
2018-07-08 18:50               ` Noam Postavsky
2018-07-08 20:01                 ` Lars Ingebrigtsen
2018-07-10  2:04                   ` Noam Postavsky
2018-07-22 11:05                     ` Lars Ingebrigtsen
2018-07-29 14:45                       ` Noam Postavsky
2018-07-08 18:36             ` Lars Ingebrigtsen
2018-07-08 19:20               ` Lars Ingebrigtsen
2018-07-08 14:23           ` Lars Ingebrigtsen
2018-06-26  9:27   ` Lars Ingebrigtsen
2018-06-26 14:42     ` Eli Zaretskii
2018-06-27  0:45       ` Noam Postavsky
2018-06-27  5:09         ` Jimmy Yuen Ho Wong
2018-06-27 12:07           ` Lars Ingebrigtsen
2018-06-27 12:20             ` Lars Ingebrigtsen
2018-06-27 15:16               ` Eli Zaretskii
2018-06-27 16:40                 ` Jimmy Yuen Ho Wong
2018-06-28 16:10                 ` Lars Ingebrigtsen
2018-06-28  0:14           ` Noam Postavsky
2018-06-28 15:58             ` Jimmy Yuen Ho Wong
2018-06-28 16:15               ` Lars Ingebrigtsen
2018-06-28 16:42                 ` Jimmy Yuen Ho Wong
2018-06-28 17:01                   ` Lars Ingebrigtsen
2018-06-28 18:15                     ` Jimmy Yuen Ho Wong
2018-06-29  5:21                       ` Jimmy Yuen Ho Wong
2018-06-29  5:25                         ` Jimmy Yuen Ho Wong
2018-06-30 17:28                           ` Jimmy Yuen Ho Wong
2018-06-30 20:30                             ` Noam Postavsky
2018-06-30 23:15                               ` Jimmy Yuen Ho Wong
2018-06-30 23:35                                 ` Noam Postavsky
2018-07-01 15:01                             ` Eli Zaretskii
2019-08-26  4:34 ` Lars Ingebrigtsen
2019-08-26 13:13   ` Andy Moreton
2019-08-26 16:07     ` Eli Zaretskii
2019-08-26 17:45       ` Andy Moreton [this message]
2019-08-26 18:12         ` Eli Zaretskii
2019-08-26 18:19           ` Andy Moreton
2019-08-26 19:36             ` Eli Zaretskii
2019-08-26 22:56               ` Andy Moreton
2019-08-27  7:23                 ` Eli Zaretskii
2019-08-27 15:25                   ` Andy Moreton
2019-08-27 15:50                     ` Eli Zaretskii
2019-08-27  8:01 ` bug#31946: 27.0.50; GnuTLS still crashes on MinGW Markus Weber
2019-08-27 15:00   ` Eli Zaretskii
2019-08-27 15:50     ` Eli Zaretskii
2019-08-29  8:05       ` mw
2019-08-29 12:20         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86zhjvrfbp.fsf@gmail.com \
    --to=andrewjmoreton@gmail.com \
    --cc=31946@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.