From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21380: 25.0.50; GTK-induced segfault when scheduling timer from window-configuration-change-hook Date: Wed, 02 Sep 2015 22:13:48 +0300 Message-ID: <83y4goab2r.fsf@gnu.org> References: <83mvx8252m.fsf@gnu.org> <83k2sc20k6.fsf@gnu.org> <83h9ng1ryx.fsf@gnu.org> <83a8t71qct.fsf@gnu.org> <837foaceid.fsf@gnu.org> <83vbbuawgy.fsf@gnu.org> <83a8t4c10v.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1441221386 18935 80.91.229.3 (2 Sep 2015 19:16:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 19:16:26 +0000 (UTC) Cc: 21380@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 02 21:16:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZXDVx-0005NK-N1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 21:16:09 +0200 Original-Received: from localhost ([::1]:40640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXDVx-0005Yi-IU for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 15:16:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXDVu-0005Wq-AJ for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 15:16:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXDVr-0007P6-45 for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 15:16:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXDVr-0007Oq-1J for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 15:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZXDVq-0003Kt-FL for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 15:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Sep 2015 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21380 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21380-submit@debbugs.gnu.org id=B21380.144122132712768 (code B ref 21380); Wed, 02 Sep 2015 19:16:02 +0000 Original-Received: (at 21380) by debbugs.gnu.org; 2 Sep 2015 19:15:27 +0000 Original-Received: from localhost ([127.0.0.1]:46765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXDVH-0003Js-BN for submit@debbugs.gnu.org; Wed, 02 Sep 2015 15:15:27 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:55412) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXDVB-0003Jf-V7 for 21380@debbugs.gnu.org; Wed, 02 Sep 2015 15:15:26 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NU200F00DEGN400@a-mtaout20.012.net.il> for 21380@debbugs.gnu.org; Wed, 02 Sep 2015 22:13:48 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NU200F8LDF0MF10@a-mtaout20.012.net.il>; Wed, 02 Sep 2015 22:13:48 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106096 Archived-At: > Date: Wed, 2 Sep 2015 16:09:53 +0000 > From: Pip Cet > Cc: 21380@debbugs.gnu.org > > > I think it's safe to assume that Lisp timers are only checked if atimers > are > > enabled. > > Those are two completely separate and independent features, so no, > it's not safe to make that assumption. Not sure why you need to > assume that, though. > > So we can call turn_on_atimers (true) without potentially enabling atimers in a > critical section. My confusion just grew a notch: one of these "atimers" is actually Lisp timers, right? If not, I'm afraid I don't see what you mean. > My assumption was that the reason we have both Lisp timers and atimers is that > atimers run strictly more often than Lisp timers. They can be more accurate, but I see no reason why they should run more often. > > If it isn't, I think the best way forward is to write > > block_input_and_atimers () and lock atimers with a counter just like > input is. > > Not sure I follow you. Are you saying that just calling block_input > followed by turn_on_atimers is somehow not enough to prevent some Lisp > from changing Vtimer_list under our feet? > > > I'm not saying that, no, but if another function disables atimers, then runs > Lisp timers, then does something critical that needs atimers to be disabled, it > might break. We didn't need to disable atimers until now, except when manipulating the atimers themselves. The function we are discussing, which copies Lisp timers, is the first one in need of this. So I don't yet see the need for a counter, but I don't object to one, either. > > --- a/src/fns.c > > +++ b/src/fns.c > > @@ -744,6 +744,9 @@ concat (ptrdiff_t nargs, Lisp_Object *args, > > /* Store this element into the result. */ > > if (toindex < 0) > > { > > + if (NILP (tail)) > > + break; > > + > > Is this part still needed? > > As far as I know, the other two fixes are sufficient. It's needed in case > someone calls copy_sequence on a list that's messed with by code run from a > hook from QUIT, and merely succeeds in avoiding a segfault and producing > incorrect results instead, so I'm not at all sure it should go in. Right.