From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71223: 30.0.50; stack overflow after very fast opening and closing of frames Date: Mon, 27 May 2024 21:15:19 +0300 Message-ID: <86zfsbt93c.fsf@gnu.org> References: <86msobv3yy.fsf@gnu.org> <86le3vv3cc.fsf@gnu.org> <86a5kbuvq5.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1681"; mail-complaints-to="usenet@ciao.gmane.io" Cc: n142857@gmail.com, 71223@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 27 20:16:33 2024 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 1sBetd-0000EZ-9G for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 May 2024 20:16:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBetD-0006YA-Ah; Mon, 27 May 2024 14:16:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBesz-0006OT-3R for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 14:15:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBesy-0006Zv-QC for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 14:15:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sBet7-0000ZA-Iy for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 14:16: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: Mon, 27 May 2024 18:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71223 X-GNU-PR-Package: emacs Original-Received: via spool by 71223-submit@debbugs.gnu.org id=B71223.17168337572165 (code B ref 71223); Mon, 27 May 2024 18:16:01 +0000 Original-Received: (at 71223) by debbugs.gnu.org; 27 May 2024 18:15:57 +0000 Original-Received: from localhost ([127.0.0.1]:45237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBet2-0000Yr-Fn for submit@debbugs.gnu.org; Mon, 27 May 2024 14:15:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBet0-0000Ye-Lx for 71223@debbugs.gnu.org; Mon, 27 May 2024 14:15:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBesk-0006Xr-GA; Mon, 27 May 2024 14:15:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qG6p11Ujm+0MUdXSqW9f6D9nEIkdKmcw/m15IvmBbGM=; b=eQYZt+WpJvP4 EdWAIm95Uy9/eVpc8eetwvSY8JwE5K+sid8/iVB2wo4xeKBZ5MZEd8n6WuB0vOUn040a2FTlm8QDi 7enZzyvQgerfGOAqMaDRlxv0QPhtMAhdQgeNrtRRANzLskL/pXVJ9GU148vx+GO1rOWZ3Du+l3Tu2 tqm308i0G4v81eQhcf6+nseRt2B70SRmYpsvifgnIhUZQc3lXuD7DgjaF9P5N2ZWbSS27DHfoXiP1 cHIlq/HS809n27stYzRo8B02o5coI5Z8y7usnisk3ajsMbub483Nr0hrlOM0q7MLx2cZScOYt5Ed7 y1PvxUlZwgxbP13ZV6QK/Q==; In-Reply-To: (message from Stefan Monnier on Mon, 27 May 2024 13:49:24 -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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286065 Archived-At: > From: Stefan Monnier > Cc: n142857@gmail.com, 71223@debbugs.gnu.org > Date: Mon, 27 May 2024 13:49:24 -0400 > > >> > +(defun server--sit-for (proc seconds) > >> > + "Like `sit-for', but disable filter of process PROC and don't redisplay." > >> > + (let ((orig-filter (process-filter proc))) > >> > + (unwind-protect > >> > + (progn > >> > + (set-process-filter proc nil) > >> > + (sit-for seconds t)) > >> > + (set-process-filter proc orig-filter)))) > >> > >> Hmm... (set-process-filter proc nil) means that any process output will > >> be sent to the process's buffer rather than to the filter, which doesn't > >> sound right (it will make us miss that process output, basically). > >> > >> If we want this to work well we need to store the process output we > >> receive during the `sit-for` and call the process filter in it afterwards. > > > > At this point we don't expect any output from the process, and if it > > comes, don't want to know about it nor process it. > > Why don't we want to process it? Because the session is being closed, and there's nothing the process can tell us that is of interest. > > The problem here is that the process filter calls sit-for, which reads > > process output, which also calls the process filter, etc., etc. -- a > > That was my understanding, indeed. But that seems to contradict: > > At this point we don't expect any output from the process, and if it > comes, don't want to know about it nor process it. > > Oh... wait I think I understand: it's the same process-filter but not > the same process. Exactly! > So your `set-process-filter` won't make a difference and my > suggestion to suspend reception of this process's output won't help > either. Hmm... > >> I think a better option here is to run the `delete-process` from > >> a timer, so we can *really* return immediately. > > Then, in the scenario of this bug report, we could have large amounts > > of processes we haven't chance to delete yet, because timers were not > > run before the next connection starts. > > Sure. I don't see why that would be a problem, tho. It will be on Windows, I think. But feel free to suggest a patch along these lines, and let's see if it solves the problem.