From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64423: 29.0.92; save-interprogram-paste-before-kill doesn't prevent streaming large selections Date: Mon, 03 Jul 2023 10:35:55 +0800 Message-ID: <87cz193eno.fsf@yahoo.com> References: <875y72ieq8.fsf@catern.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31376"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64423@debbugs.gnu.org To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 03 04:37:18 2023 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 1qG9RF-0007wW-HF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Jul 2023 04:37:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qG9R2-0005Jo-Km; Sun, 02 Jul 2023 22:37:05 -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 1qG9R1-0005Jd-8w for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2023 22:37:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qG9R1-0001vZ-0S for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2023 22:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qG9R0-0001Vg-DA for bug-gnu-emacs@gnu.org; Sun, 02 Jul 2023 22:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jul 2023 02:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64423 X-GNU-PR-Package: emacs Original-Received: via spool by 64423-submit@debbugs.gnu.org id=B64423.16883517775737 (code B ref 64423); Mon, 03 Jul 2023 02:37:02 +0000 Original-Received: (at 64423) by debbugs.gnu.org; 3 Jul 2023 02:36:17 +0000 Original-Received: from localhost ([127.0.0.1]:32973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qG9QH-0001UT-FH for submit@debbugs.gnu.org; Sun, 02 Jul 2023 22:36:17 -0400 Original-Received: from sonic306-22.consmr.mail.ne1.yahoo.com ([66.163.189.84]:34158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qG9QD-0001U8-Au for 64423@debbugs.gnu.org; Sun, 02 Jul 2023 22:36:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1688351766; bh=CmE4MxfrouYeRgyYIVLvMZrKirlfMtT/bglBkF//hps=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=r81Rpnp3LI3pJhMtvehaZ0k547GiZcg/mCiz/jVqCw/xfsRJkorMM4ugF+TQhG/OoohtQbUA1Sr7Lbo+0tn5iMm1U25q5brNMhD6347N/8UT+hSxdbKi/6niCaA4lt0y7p73fJfVwFBdcH+TTcHTknW4bN8+/NqDq2ojH3vWBF9c3wFqW7ZUk4ndUQCcr7BVu/9PRzpMj/8HNO9OFsjY91MHumRdwkeqIOMaagsEWLwC6TM1owS1bIluGWjf99tx+sappk+q08S9b2Ytivy9as+bHtslL/Ki3Jgu840AzDHEGOSat2g1LqntJcjEU2YSj/jX1eXR+Jqy3/trUaXgbQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1688351766; bh=7/otzJfX8FMZ1juwUA9nuwIlqmVPTRkapKd+KgYuWGE=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=B+M+/6s6ge6aNmZA8sL/VgcStDm2jz503OL37Qrvwyaho7PLuoGW6oGxCs9fB7WVRBTJUWwqpxVAP8g/qQqM6/oBclm2GRYv2OQiqH2lgNFmeHKumqymn3Z1bMApCn5picZ197hzh8UYKgZNI+5Fcm3ov8eh2NvaF2Xo3OKv2qrmWvQCDewwHSngot0qOK+6XwhMhTTy0Z0jwRiDoK8GBKNj8TMU2oOw57/+78rc3+oc+RPLXcBDcKC9uO4KEed9VjfiSneFM1RdJaBPZbPX6zTlTw+KQUsuIzghjk+dajVqrl+/sSWQchvpHnwK7lmhy+BmdFnwj9r09HSncFfZZA== X-YMail-OSG: bj9.nEEVM1ml4w2xyW0hjWjZaI6Uh3KkYjI4gMflqSaBUMcRHzmE7Ko1gISAd6i o7zLmXzmlsjszugcHLexX.WULWpQA2zruV1yjrZARsHFnO9paIslwRncjjjQKlkYeyMC0FB0VgF0 ywqxA2B1XkXOZvcUpFfRmkipUxDTjAZqM.H9SNbLwZSR90pKruPQiBQ4p3qzMzNZ9au3gFxXZIso 2LeDyokkdKT8JOfg8Oet5XqKxGpINYgaIGNtDVttqbLnrmkABdCNec4SxoMykPYmShFa0QSNJGcw S13QqFASdHJMKITj.xkWhdZ5k0RjiwkfOc5ZzGqOG6c_s7UPM80GQ4ejrF_R85WYscxDOBPX1Ouc tU5tWh3ts8mHwBe7fAnN1XTo5l1j49Uxz5YWhn5PUKS.kcQE.9YOj9kJFtbq0GXxPq1B0S5u.vgj iw3Nf1oS0MlOjaTFYz9t5cULbv3BDPyYcddCdFj6YGeBvbfnGP9gmxanBS9HvKvQFY.5vCdwwKB. RZ0ROfnwQX2nsBKCSVh5nbYPREHRbg9HUJQ5yfQK6yZnLbqkO8vC2FEmuXNt8rnrTQc5v.j.bLtA QK3IP33SQtCCBEmXU32x8m55AakNd788_B8lGsOfM8VM.qQzGLBhkzxchBprfGHKn4QRqn0cq_vZ UfQ_u0OLdvxYRIj2Wp.eFdLx3pgQLEDhaANRGkpUEsWgoT3TqmpubCNuqvjswn9T1CKXt5H.7XMr 5F0C_ftowm5VyObY5.YPBE1xDUibW.i1pyOFtIek8Ur29ZwUoXDtDxAH8Tj7w.VV.rbtWobihpsX F9m4VxkelmF2eSJtos05KnguBWBr66RhrQMiyDutQ1 X-Sonic-MF: X-Sonic-ID: fc6f2ac6-4200-4fdc-b6cf-2df6146d777e Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Mon, 3 Jul 2023 02:36:06 +0000 Original-Received: by hermes--production-sg3-67fd64777-szq9p (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 9c47b52b683a7bb4b4a2748f2e0b5b5a; Mon, 03 Jul 2023 02:35:59 +0000 (UTC) In-Reply-To: <875y72ieq8.fsf@catern.com> (sbaugh@catern.com's message of "Sun, 02 Jul 2023 14:13:04 +0000 (UTC)") X-Mailer: WebService/1.1.21612 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:264506 Archived-At: sbaugh@catern.com writes: > 1. emacs -Q under X, preferably X forwarded over ssh to make things slower. > 2. (setq save-interprogram-paste-before-kill 2000) (or any other integer) > 3. Copy some very large data in another X client, so the selection is > very large. > 4. (kill-new "foo") > 5. Observe Emacs hanging as it receives the entire large data from the > selection owner, and then after receiving it all, discards it because > it's more than 2000 bytes. > > Solution: receive_incremental_selection in xselect.c should support a > cap on the size of the selection it receives and truncate (or discard, > returning nil?) the selection if it's larger than that. And setting > save-interprogram-paste-before-kill to a numeric value should activate > this cap. This is not a bug because you can quit while Emacs is waiting for selection data to arrive from the owner. The ICCCM provides no means for the requestor to terminate an incremental selection transfer before it completes, and owners may become confused if Emacs abruptly stops responding to their property changes while a transfer is in progress. Emacs should avoid doing so unless the user explicitly quits (pointing to a problem with the selection owner anyway.) Additionally, the way we deal with potentially long-running data transfer operations in Emacs is not to apply a limit on the size of the data being transferred, but to make quitting possible within those transfers. What may be slow for you can in fact be perfectly acceptable for others who are connected to their X servers through faster connections.