From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Elias Martenson Newsgroups: gmane.emacs.bugs Subject: bug#25178: 26.0.50; Crash when pressing C-g in TTY mode Date: Wed, 14 Dec 2016 11:09:12 +0800 Message-ID: References: <83bmwhccib.fsf@gnu.org> <838trjbrcq.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6324145566055705986==" X-Trace: blaine.gmane.org 1481685016 21401 195.159.176.226 (14 Dec 2016 03:10:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 03:10:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 25178@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 14 04:10:12 2016 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 1cGzxJ-000482-TU for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 04:10:10 +0100 Original-Received: from localhost ([::1]:45254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGzxM-00015Q-Hv for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Dec 2016 22:10:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGzxG-0000wc-1g for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2016 22:10:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGzxC-0000zI-NS for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2016 22:10:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54091) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGzxC-0000zE-KR for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2016 22:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cGzxC-0008KA-8A for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2016 22:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Elias Martenson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2016 03:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25178-submit@debbugs.gnu.org id=B25178.148168495331936 (code B ref 25178); Wed, 14 Dec 2016 03:10:02 +0000 Original-Received: (at 25178) by debbugs.gnu.org; 14 Dec 2016 03:09:13 +0000 Original-Received: from localhost ([127.0.0.1]:41257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGzwP-0008J0-Ig for submit@debbugs.gnu.org; Tue, 13 Dec 2016 22:09:13 -0500 Original-Received: from mail.murex.com ([194.98.51.42]:64219 helo=ix-ironport.murex.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGzwN-0008Iq-UV for 25178@debbugs.gnu.org; Tue, 13 Dec 2016 22:09:12 -0500 X-IronPort-AV: E=Sophos;i="5.33,344,1477954800"; d="scan'208";a="32861704" Original-Received: from unknown (HELO FR-FRDC1-HC-V1.fr.murex.com) ([10.0.0.1]) by ix-ironport.murex.com with ESMTP; 14 Dec 2016 04:09:09 +0100 Original-Received: from SG-SGDC1-HC-V2.sg.murex.com (172.21.65.12) by FR-FRDC1-HC-V1.fr.murex.com (172.21.43.213) with Microsoft SMTP Server (TLS) id 14.3.279.2; Wed, 14 Dec 2016 04:09:08 +0100 Original-Received: from em-desktop (172.21.72.4) by SG-SGDC1-HC-V2.sg.murex.com (172.21.65.43) with Microsoft SMTP Server (TLS) id 14.3.279.2; Wed, 14 Dec 2016 11:09:06 +0800 In-Reply-To: <838trjbrcq.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Dec 2016 20:45:25 +0200") Original-MIME-Version: 1.0 X-Originating-IP: [172.21.72.4] 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:127021 Archived-At: --===============6324145566055705986== Content-Type: text/plain Eli Zaretskii writes: > > From: Elias Martenson > > CC: <25178@debbugs.gnu.org> > > Date: Tue, 13 Dec 2016 11:07:08 +0800 > > > > Here is the actual stack trace from the core dump generated during the > > crash: > > > > Machine ID: 50467f3a69eb4dbea19c8a2972949839 > > Hostname: em-desktop > > Storage: /var/lib/systemd/coredump/core.emacs.50067.45a62f2ad9804a0b81fed25ad8faffab.21460.1481598260000000000000.lz4 > > Message: Process 21460 (emacs) of user 50067 dumped core. > > > > Stack trace of thread 21460: > > #0 0x00007fec16127f5f raise (libpthread.so.0) > > #1 0x0000000000553c66 terminate_due_to_signal (emacs-26.0.50) > > #2 0x00000000005783c1 handle_fatal_signal (emacs-26.0.50) > > #3 0x0000000000578392 deliver_thread_signal (emacs-26.0.50) > > #4 0x00000000005783f8 deliver_fatal_thread_signal (emacs-26.0.50) > > #5 0x00000000005785ae handle_sigsegv (emacs-26.0.50) > > #6 0x00007fec16128080 __restore_rt (libpthread.so.0) > > #7 0x00007fec161296a0 __lll_unlock_elision (libpthread.so.0) > > #8 0x0000000000677a94 sys_mutex_unlock (emacs-26.0.50) > > #9 0x000000000067638d release_global_lock (emacs-26.0.50) > > #10 0x0000000000676d75 really_call_select (emacs-26.0.50) > > #11 0x00000000005d4a02 flush_stack_call_func (emacs-26.0.50) > > #12 0x0000000000676e2b thread_select (emacs-26.0.50) > > #13 0x0000000000651168 wait_reading_process_output (emacs-26.0.50) > > #14 0x00000000004252be sit_for (emacs-26.0.50) > > #15 0x000000000055bc48 read_char (emacs-26.0.50) > > Hmm... Is calling pthread_mutex_unlock twice in a row, without an > intervening call to pthread_mutex_lock, supposed to segfault? Posix > seems to say the result is undefined behavior, but AFAICT by looking > in the glibc sources, its implementation triggers a crash in that > case. > > Strangely, I don't see this on the GNU/Linux system to which I have > access, although Emacs definitely calls pthread_mutex_unlock twice in > a row in the scenario of this bug report. Is this some change in > latest versions of glibc? Calling pthread_mutex_unlock() twice has to be undefined behaviour. In fact, it can never work. Imagine what would happen if a different thread called pthread_mutex_lock() on the mutex between two the two unlock calls. In that case, you'd be unlocking a mutex help by a different thread which is obviously very dangerous. Regards, Elias --===============6324145566055705986== Content-Type: multipart/alternative; boundary="===============1627906692444614660==" MIME-Version: 1.0 Content-Disposition: inline --===============1627906692444614660== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ******************************* This e-mail contains information for the intended recipient only. It may co= ntain proprietary material or confidential information. If you are not the = intended recipient you are not authorised to distribute, copy or use this e= -mail or any attachment to it. Murex cannot guarantee that it is virus free= and accepts no responsibility for any loss or damage arising from its use.= If you have received this e-mail in error please notify immediately the se= nder and delete the original email received, any attachments and all copies= from your system. --===============1627906692444614660== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable

*= ******************************

This e-mail con= tains information for the intended recipient only. It may contain proprieta= ry material or confidential information. If you are not the intended r= ecipient you are not authorised to distribute, copy or use this e-mail= or any attachment to it.