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#30182: Update Date: Wed, 24 Jan 2018 21:13:50 +0200 Message-ID: <83tvvbm5n5.fsf@gnu.org> References: <87k1wdqc4q.fsf@gmail.com> <87inbxqc1l.fsf@gmail.com> <5A631B7F.3030308@gmx.at> <878tcs3j23.fsf@gmail.com> <5A634E53.7010205@gmx.at> <87mv182bzk.fsf@gmail.com> <83a7x7sww6.fsf@gnu.org> <87efmj27d5.fsf@gmail.com> <83vafvqjbf.fsf@gnu.org> <87inbvxdz8.fsf@gmail.com> <5A65AB97.1030401@gmx.at> <87po62kk10.fsf@gmail.com> <831sih23rh.fsf@gnu.org> <5A663490.3050409@gmx.at> <87r2qh5lya.fsf@gmail.com> <83po60zgyf.fsf@gnu.org> <877es8cxmv.fsf@gmail.com> <83fu6wo5bd.fsf@gnu.org> <5A6782A5.8040808@gmx.at> <834lncny6z.fsf@gnu.org> <5A68464A.1060703@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1516821202 5923 195.159.176.226 (24 Jan 2018 19:13:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Jan 2018 19:13:22 +0000 (UTC) Cc: m.sujith@gmail.com, 30182@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 24 20:13:17 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 1eeQTu-0000pY-Fh for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jan 2018 20:13:10 +0100 Original-Received: from localhost ([::1]:39684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeQVt-0002DW-B5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jan 2018 14:15:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeQVm-0002D2-TI for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 14:15:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeQVi-0002HZ-3T for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 14:15:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeQVh-0002HT-W8 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 14:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eeQVh-0006Pc-Lo for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 14:15:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Jan 2018 19:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30182 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30182-submit@debbugs.gnu.org id=B30182.151682124924569 (code B ref 30182); Wed, 24 Jan 2018 19:15:01 +0000 Original-Received: (at 30182) by debbugs.gnu.org; 24 Jan 2018 19:14:09 +0000 Original-Received: from localhost ([127.0.0.1]:41279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeQUr-0006OD-3J for submit@debbugs.gnu.org; Wed, 24 Jan 2018 14:14:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeQUp-0006O0-VF for 30182@debbugs.gnu.org; Wed, 24 Jan 2018 14:14:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeQUg-0001bG-6y for 30182@debbugs.gnu.org; Wed, 24 Jan 2018 14:14:02 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeQUg-0001bA-32; Wed, 24 Jan 2018 14:13:58 -0500 Original-Received: from [176.228.60.248] (port=3026 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eeQUe-00079l-JS; Wed, 24 Jan 2018 14:13:57 -0500 In-reply-to: <5A68464A.1060703@gmx.at> (message from martin rudalics on Wed, 24 Jan 2018 09:39:38 +0100) 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:142471 Archived-At: > Date: Wed, 24 Jan 2018 09:39:38 +0100 > From: martin rudalics > CC: m.sujith@gmail.com, 30182@debbugs.gnu.org > > >> We don't know whether `timer-list' had actually 5 elements when > >> running the above code. > > > > If it didn't, then the 5th element could have only been added by > > another thread. > > Why another thread? How else can a data structure change while the main thread is running code that doesn't modify the data structure? > Fmake_list does > > for (EMACS_INT size = XFASTINT (length); 0 < size; size--) > { > val = Fcons (init, val); > rarely_quit (size); > } > > so IIUC rarely_quit is eventually called with size zero. Now we have > > rarely_quit (unsigned short int count) > { > if (! count) > maybe_quit (); > > which, if count is zero, calls maybe_quit which according to > > if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) > process_quit_flag (); > else if (pending_signals) > process_pending_signals (); > > may call process_pending_signals which does > > do_pending_atimers (); > > which may eventually do a schedule_atimer. > > So IMHO the problem is not that rarely_quit "just throws to top-level" > but might add a timer on the fly while the timer list is copied. atimers and timers are two very different creatures, and I don't think I see how atimers could be relevant to our issue. If you do, please tell what I'm missing in this picture.