From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hans van den Bogert Newsgroups: gmane.emacs.bugs Subject: bug#42140: 26.3; sigsegv when using nss-docker Date: Tue, 30 Jun 2020 22:15:42 +0200 Message-ID: References: <356361b1-9b17-eab5-108c-1d02b7ea73ce@gmail.com> <83k0zozhnl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37401"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: 42140@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 30 23:19:27 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqNf4-0009eA-Ji for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jun 2020 23:19:26 +0200 Original-Received: from localhost ([::1]:58040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqNf3-0002EJ-5j for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jun 2020 17:19:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqNeg-0002Dz-Nu for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 17:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqNeg-00008S-Ep for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 17:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jqNeg-0006mB-AK for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 17:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hans van den Bogert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jun 2020 21:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42140 X-GNU-PR-Package: emacs Original-Received: via spool by 42140-submit@debbugs.gnu.org id=B42140.159355191226008 (code B ref 42140); Tue, 30 Jun 2020 21:19:02 +0000 Original-Received: (at 42140) by debbugs.gnu.org; 30 Jun 2020 21:18:32 +0000 Original-Received: from localhost ([127.0.0.1]:51785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqNeB-0006lP-AD for submit@debbugs.gnu.org; Tue, 30 Jun 2020 17:18:32 -0400 Original-Received: from mail-ed1-f45.google.com ([209.85.208.45]:44082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqMfX-0005EC-6T for 42140@debbugs.gnu.org; Tue, 30 Jun 2020 16:15:54 -0400 Original-Received: by mail-ed1-f45.google.com with SMTP id by13so7538906edb.11 for <42140@debbugs.gnu.org>; Tue, 30 Jun 2020 13:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5jGjWwTHiEyK6y//sbAp4i2JU2JlosInx+VwbgAkTyU=; b=X8Ts9QtAFVLK2B7f3ji5jnBAYP5dyBKrNuONRa5q9ddKIhWlpUFpUQRa5xbpBl5Bln kjFnzFE8iI7RBQTxARn3zKqOTqbFlQVIv6FsvFjjmRIMZ6mP7Om6G08QVoIHRwKtGsQK 1jrYlHd2k4Szt+nVGg3hps2h2d0BD6ZyjaAPhx1ZHv1vBvwY2kkt96GIZ5C3UYi075j3 KmnFni3lDCZ3Me57OMSJkOTzYTv0kpa5j0VzMod6b6TYzonmb0knj3VWBl48nbF3IpLu 914h8Y80wuCvvpyaSqjp2ctOxAhDg3bEevRTXLg1MyHuqdSgL25tw1PUJWq5jFX2dcGh hBYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5jGjWwTHiEyK6y//sbAp4i2JU2JlosInx+VwbgAkTyU=; b=M06K0jhG2sWGKr+dUL70mz77SyWtStZ6pbiJqp0vdZDtDb0YYj98aEe+FfMplTtU5M /9r/nFvkrsGnjBQZln2rkUaX3/6zTTYbOez9ogR0TyBFH0wmsyUYNZZy10rIAuMFN3Kk Ei0EAX3ZFCFPzpE/zCv5cb67NFTyx4wO5LLP9Y3m9LCRb2YrlXInwDApHmtkaoQSI7Op 9LYS5glXeLTseKOqfSnFQuJ4fVkOqAfFWYt0lx+H74z3qW497v1S+p6A8r6XKYHfs1IZ a6XsFP12nqzhATtkK1zIMNzh1VGEFhCXBp1j9agLGHT+oagaWvmjm2aePxyw3S2om2Xa BriQ== X-Gm-Message-State: AOAM530FmL9YOhRROM2TyWNObabDe2i4DeMqUGOoHK5IxmMt7Ximr7HR 1cYCyiPnfV3/dBs/hZO19CH1++fMM6s= X-Google-Smtp-Source: ABdhPJxjyC9iUvR3Q7jBihDhz85ylC1QvFLyMnc1fbWu24zGvzhna3Zi+JwTRCI+Gd5nxeDM9DqdrQ== X-Received: by 2002:aa7:d744:: with SMTP id a4mr24862612eds.94.1593548143680; Tue, 30 Jun 2020 13:15:43 -0700 (PDT) Original-Received: from [192.168.1.148] (235-131-158-163.dynamic.caiway.nl. [163.158.131.235]) by smtp.gmail.com with ESMTPSA id j19sm4083253edt.44.2020.06.30.13.15.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2020 13:15:43 -0700 (PDT) In-Reply-To: <83k0zozhnl.fsf@gnu.org> Content-Language: en-US X-Mailman-Approved-At: Tue, 30 Jun 2020 17:18:29 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182584 Archived-At: On 6/30/20 5:40 PM, Eli Zaretskii wrote: > Emacs is not multithreaded. If you never start any additional Lisp > threads, only one thread ever runs (not counting GTK threads, but > those aren't new in Emacs 26). > > The backtrace seems to suggest its a problem in nss-docker, since the > crash is in its code. Are you sure this is an Emacs problem? > Emacs is not multithreaded. You are right, poor choice of words; concurrent seems to be the proper word. The release notes of v26 do note the change to an async network layer: Release note v26 snippet --->8--- ** The networking code has been reworked so that it's more asynchronous than it was (when specifying :nowait t in 'make-network-process'). How asynchronous it is varies based on the capabilities of the system, but on a typical GNU/Linux system the DNS resolution, the connection, and (for TLS streams) the TLS negotiation are all done without blocking the main Emacs thread. To get asynchronous TLS, the TLS boot parameters have to be passed in (see the manual for details). --->8--- > If you never start any additional Lisp > threads, only one thread ever runs (not counting GTK threads, but > those aren't new in Emacs 26). I am an extreme novice wrt to emacs development, but I have to disagree, in contrast to v25, I can see this async change in the debug prints which I added to `_nss_docker_*_r` functions; the order of internal method calls can interleave between `_nss_docker_gethostbyname2_r` invocations. Further, Ithink I see 2 threads for 2 name resolves (is this what you meant with 'additional lisp threads'?): ``` Thread 7 (Thread 0x7fffd8ce7b40 (LWP 18899)): #0 0x00007fffd8acecd5 in _nss_docker_gethostbyname3_r (name=Python Exception Cannot access memory at address 0x7fffd8ccd388: #1 0x00007fffd8acf518 in _nss_docker_gethostbyname2_r (name=0x2d72768 "orgmode.org", af=10, result=0x7fffd8ce67d0, buffer=0x7fffd8ce6a40 "\377\002", buflen=1024, errnop=0x7fffd8ce7948, herrnop=0x7fffd8ce79ac) at libnss_docker.c:340 #2 0x00007fffebf70f9f in gaih_inet (name=name@entry=0x2d72768 "orgmode.org", service=, req=req@entry=0x2d72738, pai=pai@entry=0x7fffd8ce69c8, naddrs=naddrs@entry=0x7fffd8ce69c4, tmpbuf=tmpbuf@entry=0x7fffd8ce6a30) at ../sysdeps/posix/getaddrinfo.c:873 #3 0x00007fffebf72ce4 in __GI_getaddrinfo (name=, service=, hints=0x2d72738, pai=pai@entry=0x2d72718) at ../sysdeps/posix/getaddrinfo.c:2300 #4 0x00007fffecb5a058 in handle_requests (arg=) at gai_misc.c:317 #5 0x00007fffecd646db in start_thread (arg=0x7fffd8ce7b40) at pthread_create.c:463 #6 0x00007fffebf8c88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ... Thread 5 (Thread 0x7fffd8f51b40 (LWP 18897)): #0 0x00007fffd8acecd5 in _nss_docker_gethostbyname3_r (name=0x2e6f732e312e302d , af=2002936162, result=0x6e672d78756e696c, buffer=0x2d34365f3638782f , buflen=7091318039310988591, errnop=0x312e6f732e312e, herrnop=0x302d77626162696c, ttlp=0x302e6f732e6563, canonp=0x697672657373746e) at libnss_docker.c:72 #1 0x00007fffd8acf518 in _nss_docker_gethostbyname2_r (name=0x338a068 "elpa.gnu.org", af=10, result=0x7fffd8f507d0, buffer=0x7fffd8f50a40 "\377\002", buflen=1024, errnop=0x7fffd8f51948, herrnop=0x7fffd8f519ac) at libnss_docker.c:340 #2 0x00007fffebf70f9f in gaih_inet (name=name@entry=0x338a068 "elpa.gnu.org", service=, req=req@entry=0x338a038, pai=pai@entry=0x7fffd8f509c8, naddrs=naddrs@entry=0x7fffd8f509c4, tmpbuf=tmpbuf@entry=0x7fffd8f50a30) at ../sysdeps/posix/getaddrinfo.c:873 #3 0x00007fffebf72ce4 in __GI_getaddrinfo (name=, service=, hints=0x338a038, pai=pai@entry=0x338a018) at ../sysdeps/posix/getaddrinfo.c:2300 #4 0x00007fffecb5a058 in handle_requests (arg=) at gai_misc.c:317 #5 0x00007fffecd646db in start_thread (arg=0x7fffd8f51b40) at pthread_create.c:463 #6 0x00007fffebf8c88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ``` If someone could help me point out where the libc/nss code is called on the emacs side, I can debug this further. Because tbh, I'm having difficulty pin-pointing that.