From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33198: 27.0.50; emacs_abort on EBADF during accept-process-output in non-main thread Date: Tue, 30 Oct 2018 08:50:19 +0200 Message-ID: <83lg6gkjx0.fsf@gnu.org> References: <87d0rsjteo.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1540882393 15422 195.159.176.226 (30 Oct 2018 06:53:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 06:53:13 +0000 (UTC) Cc: 33198@debbugs.gnu.org To: Gemini Lasswell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 30 07:53:09 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHNth-0003rE-Mp for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2018 07:53:05 +0100 Original-Received: from localhost ([::1]:51206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHNvo-00042X-5B for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2018 02:55:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHNrl-00085a-BZ for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 02:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHNri-00065z-1h for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 02:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48887) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHNrh-00065o-Tf for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 02:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gHNrh-0001xn-Pk for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 02:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Oct 2018 06:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33198-submit@debbugs.gnu.org id=B33198.15408822277500 (code B ref 33198); Tue, 30 Oct 2018 06:51:01 +0000 Original-Received: (at 33198) by debbugs.gnu.org; 30 Oct 2018 06:50:27 +0000 Original-Received: from localhost ([127.0.0.1]:53145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHNr9-0001wt-8F for submit@debbugs.gnu.org; Tue, 30 Oct 2018 02:50:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHNr7-0001wh-JP for 33198@debbugs.gnu.org; Tue, 30 Oct 2018 02:50:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHNqr-0005ZZ-W7 for 33198@debbugs.gnu.org; Tue, 30 Oct 2018 02:50:15 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHNqr-0005YR-NZ; Tue, 30 Oct 2018 02:50:09 -0400 Original-Received: from [176.228.60.248] (port=1146 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gHNqq-0002nV-KV; Tue, 30 Oct 2018 02:50:09 -0400 In-reply-to: <87d0rsjteo.fsf@runbox.com> (message from Gemini Lasswell on Mon, 29 Oct 2018 15:10:39 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151811 Archived-At: > From: Gemini Lasswell > Date: Mon, 29 Oct 2018 15:10:39 -0700 > > I've hit the emacs_abort at line 5510 in process.c a few times in the > last week. I haven't found a way to make it reproduce on demand. I > tried to narrow the code it's happening in down to a smaller test case, > without success. I'd appreciate suggestions for how to track down what > is going wrong. I suggest to instrument the code that determines which thread will listen to what descriptors in its pselect call. This happens inside compute_input_wait_mask and compute_non_keyboard_wait_mask, and the data those use is set by several add_*_fd functions. The instrumentation should output the descriptor, the thread ID, and what is it used for. Then I think you will be able to see where did the bad descriptor come from, and how it happened to be bad. You will also need to determine which descriptor is the bad one; the usual paradigm to do that is by calling 'fcntl (fd, F_GETFD)' on each descriptor on which pselect was asked to wait, and see which ones return -1 with erno = EBADFD.