From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#54458: 27.2; erc-dcc-get: Re-entering top level after C stack overflow Date: Sun, 10 Apr 2022 14:31:33 -0700 Message-ID: <875yng39sa.fsf__27737.6998144732$1649626350$gmane$org@neverwas.me> References: <78459EAB-314B-4122-8E3B-7F82685D0DBA@acm.org> <83a6da9vm8.fsf@gnu.org> <87r16m46uf.fsf@neverwas.me> <4DA2DB05-D902-42DF-860D-87617FBB74C8@acm.org> <83k0cc907r.fsf@gnu.org> <5A8EE4CF-6F5E-4119-8765-8E301E2BE935@acm.org> <87czi435nh.fsf@neverwas.me> <87mth8rst7.fsf@neverwas.me> <98F3182F-80A4-4131-8E9C-E1576908DF96@acm.org> <87sfqygccz.fsf@neverwas.me> <87h77aozgw.fsf@gmail.com> <87wng67xxd.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4745"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , emacs-erc@gnu.org, bandali@gnu.org, 54458@debbugs.gnu.org To: Fernando de Morais Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 10 23:32:24 2022 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 1ndfAW-00015J-0p for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Apr 2022 23:32:24 +0200 Original-Received: from localhost ([::1]:33142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ndfAU-0005o9-Mq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Apr 2022 17:32:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ndfAE-0005mS-Fq for bug-gnu-emacs@gnu.org; Sun, 10 Apr 2022 17:32:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ndfAA-0002j0-11 for bug-gnu-emacs@gnu.org; Sun, 10 Apr 2022 17:32:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ndfA9-0003QD-U1 for bug-gnu-emacs@gnu.org; Sun, 10 Apr 2022 17:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Apr 2022 21:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54458 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54458-submit@debbugs.gnu.org id=B54458.164962630813132 (code B ref 54458); Sun, 10 Apr 2022 21:32:01 +0000 Original-Received: (at 54458) by debbugs.gnu.org; 10 Apr 2022 21:31:48 +0000 Original-Received: from localhost ([127.0.0.1]:41755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndf9w-0003Pk-1i for submit@debbugs.gnu.org; Sun, 10 Apr 2022 17:31:48 -0400 Original-Received: from mail-108-mta191.mxroute.com ([136.175.108.191]:40807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ndf9u-0003PV-71 for 54458@debbugs.gnu.org; Sun, 10 Apr 2022 17:31:46 -0400 Original-Received: from filter006.mxroute.com ([140.82.40.27] 140.82.40.27.vultrusercontent.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta191.mxroute.com (ZoneMTA) with ESMTPSA id 1801563b193000fe85.002 for <54458@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sun, 10 Apr 2022 21:31:36 +0000 X-Zone-Loop: 1493301e98f46237dc0e62bbf5967d1757ce0191fb71 X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=yeIoYw4u6V268PGOTzwoayHSWnTfV1pA+iX21zp6OP8=; b=lEnRv4GRLtPq+aIIUmD26FFUDQ LtsypQahfTyxwOBpzprRD6YL4ce2Fhyc6gZfZDil6zzWcw5+/dcxBPTk8nGXE44wGu92fn1yluZan 52C4ywW0J8VWw6DwCr4VUoA8tCR3toHR2udP6wH+NfMcm6hbI2TMlqMxryDV7eHRFG4sAFgHZXecY L5Z/UTvBdlh6mAXiCRoHIgIxPViHZe33PkliKytAAXLrCokHtLv92161Vv6JsXlclkVLjNpSrDBrS SongTD11UIU5z3bP/tarO031orN9OThB8zDfZafKQwSDqZ9ZLebR3nm+T9frWGDcZ4UH1wpvAFgZO ty2ww1sA==; In-Reply-To: <87wng67xxd.fsf@neverwas.me> (J. P.'s message of "Sun, 03 Apr 2022 12:46:06 -0700") X-AuthUser: masked@neverwas.me 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" Xref: news.gmane.io gmane.emacs.bugs:229688 Archived-At: --=-=-= Content-Type: text/plain Hi Fernando, In your initial report, you mentioned having trouble receiving multiple files. > If I transfer multiple files (three or four), sometimes with sizes > smaller than those mentioned above, the C stack overflow hits way > earlier. Did you mean successively or simultaneously? Because when attempting the latter, I can't even get off the ground. Specifically, when I try to get two transfers going [1], the first freezes the moment the second starts. And no further packets are exchanged for the first connection. So, as far as simultaneous transfers are concerned, it may be that the changes you so kindly tried didn't introduce a regression after all and that a preexisting (though possibly related) bug has emerged. >> The only different behaviors I noticed in Emacs was the fact that it >> stops responding when transfers go beyond a certain percentage of >> completion (I couldn't be sure of the number, but in my experiments it >> happens above 45%) and the impossibility of transferring more than one >> file at the same time. That last part sounds like it may be similar to what I ran into. If so, we may be in luck. It appears that, with a couple simple tweaks, I'm able to successfully complete simultaneous transfers of large files. However, retaining a responsive Emacs is another issue. Assuming the sender misbehaves and the changes you last tried are also applied, I lose control of Emacs the instant a send is blocked and only regain it once all (simultaneous) transfers have completed, which seems more or less in line with what you describe [2]. When you get a chance, please try the proposed multi-file fix, even though it does nothing for the unresponsiveness problem. Also, if it's not too much trouble, would you mind doing something like # tcpdump -i eno1 -Uw ./dump 'host 93.184.216.34 and tcp port 9899' from before connecting until the unresponsiveness starts and then uploading ./dump somewhere (like an s3 bucket)? Thanks. [1] On Emacs 29, without any of the proposed changes applied: a. Start two emacs -Q instances, a sender and a receiver b. Start two helper scripts, each serving a different large file c. Offer both files on the sender d. Accept both files on the receiver [2] To be clear, I'm still able to issue a quit signal, which results in a message about an error in the process filter. However, it does nothing to interrupt the actual process (info "(emacs) Quitting"). And, FWIW, the first blocked send attempt never actually returns to the calling process filter, at least in my crude simulation. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-Allow-matching-against-string-values-in-erc-dcc-memb.patch >From f54f32465ed3d7a3206a98987943de13c39aa479 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sat, 9 Apr 2022 23:32:22 -0700 Subject: [PATCH 3/3] Allow matching against string values in erc-dcc-member * lisp/erc/erc-dcc.el (erc-dcc-member): Be more tolerant in the catch-all case by testing for equality instead of identity. (erc-dcc-do-GET-command): Pass filename when querying `erc-dcc-member'. --- lisp/erc/erc-dcc.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 636e5b20b1..c6871aefd3 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -196,7 +196,7 @@ erc-dcc-member (erc-extract-nick test) (erc-extract-nick val))) ;; not a nick - (eq test val) + (equal test val) (setq cont nil)))) (if cont (setq result elt) @@ -507,7 +507,7 @@ erc-dcc-do-GET-command re-join the arguments, separated by a space. PROC is the server process." (setq file (and file (mapconcat #'identity file " "))) - (let* ((elt (erc-dcc-member :nick nick :type 'GET)) + (let* ((elt (erc-dcc-member :nick nick :type 'GET :file file)) (filename (or file (plist-get elt :file) "unknown"))) (if elt (let* ((file (read-file-name -- 2.35.1 --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=serve.py Content-Transfer-Encoding: base64 IiIiSG9zdGlsZSBEQ0MtU0VORCBlbmRwb2ludAoKVXNhZ2U6IHB5dGhvbiB0aGlzX3NjcmlwdC5w eSAuL2Jsb2IuYmluIFtzdGFydmV8aWdub3JlXSBbcG9ydF0KCkJ5IGRlZmF1bHQsIHNpbXVsYXRl IGEgcGVkYW50aWMgY2xpZW50IHRoYXQgd2FpdHMgb24gY2hlY2tzdW1zLiAgV2l0aApgYHN0YXJ2 ZWBgLCBkb24ndCB3YWl0IGZvciByZWFkIHJlY2VpcHRzIGJlZm9yZ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g c2VudDogaW50LCByZWNlaXZlZDogaW50KToKICAgICAgICB0cnk6CiAgICAgICAgICAgIHdoaWxl IGcgOj0gYXdhaXQgYXN5bmNpby53YWl0X2ZvcihzZWxmLnJlYWQoKSwgdGltZW91dD0xKToKICAg ICAgICAgICAgICAgIHJlY2VpdmVkICs9IGdbMV0KICAgICAgICBleGNlcHQgYXN5bmNpby5UaW1l b3V0RXJyb3I6CiAgICAgICAgICAgIHBhc3MKICAgICAgICBwcmludCgiXG5TZW50ICVkIGJ5dGVz IiAlIHNlbnQpCiAgICAgICAgcHJpbnQoIlNhdyAlZCByZXBvcnRzIiAlIChyZWNlaXZlZCAvLyA0 KSkKICAgICAgICBzZWxmLndyaXRlci5jbG9zZSgpCiAgICAgICAgYXdhaXQgc2VsZi53cml0ZXIu d2FpdF9jbG9zZWQoKQoKICAgIGFzeW5jIGRlZiBoYW5kbGUoc2VsZik6CiAgICAgICAgc2VudCA9 IHJlY2VpdmVkID0gMAogICAgICAgIHByaW50KGYiQ29ubmVjdGlvbiBmcm9tIHtzZWxmLndyaXRl ci5nZXRfZXh0cmFfaW5mbygncGVlcm5hbWUnKSFyfSIpCgogICAgICAgIHdpdGggc2VsZi5maWxl Lm9wZW4oInJiIikgYXMgZjoKICAgICAgICAgICAgd2hpbGUgY2h1bmsgOj0gZi5yZWFkKDMyNzY4 KToKICAgICAgICAgICAgICAgIHNlbGYud3JpdGVyLndyaXRlKGNodW5rKQogICAgICAgICAgICAg ICAgYXdhaXQgc2VsZi53cml0ZXIuZHJhaW4oKQogICAgICAgICAgICAgICAgc2VudCArPSBsZW4o Y2h1bmspCiAgICAgICAgICAgICAgICBpZiBzZWxmLm1vZGUgaXMgTW9kZS5zdGFydmU6CiAgICAg ICAgICAgICAgICAgICAgY29udGludWUKICAgICAgICAgICAgICAgIGxhc3QgPSBjdXIgPSAwCiAg ICAgICAgICAgICAgICB3aGlsZSBjdXIgPCBzZW50OgogICAgICAgICAgICAgICAgICAgIGxhc3Qs IG4gPS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