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#63614: 29.0.91; PGTK Emacs crashes after clearing the clipboard Date: Fri, 26 May 2023 08:33:52 +0800 Message-ID: <875y8grkwf.fsf@yahoo.com> References: <87zg5ssnoz.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19129"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63614@debbugs.gnu.org To: Leonardo =?UTF-8?Q?Hern=C3=A1ndez_?= =?UTF-8?Q?Hern=C3=A1ndez?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 26 02:35:21 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 1q2LQP-0004t9-64 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 May 2023 02:35:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2LQA-00015J-DH; Thu, 25 May 2023 20:35:06 -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 1q2LQ8-00013b-Bb for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 20:35:04 -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 1q2LQ7-0004FW-Ba for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 20:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2LQ6-0004Uw-8k for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 20:35: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: Fri, 26 May 2023 00:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63614 X-GNU-PR-Package: emacs Original-Received: via spool by 63614-submit@debbugs.gnu.org id=B63614.168506125317224 (code B ref 63614); Fri, 26 May 2023 00:35:02 +0000 Original-Received: (at 63614) by debbugs.gnu.org; 26 May 2023 00:34:13 +0000 Original-Received: from localhost ([127.0.0.1]:48422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2LPJ-0004Tj-8g for submit@debbugs.gnu.org; Thu, 25 May 2023 20:34:13 -0400 Original-Received: from sonic302-22.consmr.mail.ne1.yahoo.com ([66.163.186.148]:45094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2LPG-0004TT-Ad for 63614@debbugs.gnu.org; Thu, 25 May 2023 20:34:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685061243; bh=B6yer2Eqfg1f+9/2Bcizk02Qnlakkss3/qBkFOukXJU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=ImeR3XBFPfX3TZ2XqVR6FGXzZTtyPEswQb7hqOrvncEUmJYxUYxBs+wGOite60e1aCWpTWDLHaIMym1peFdNOtrKK7bGArE5BMvxF6B1BqC4iqQUkNCCtiKgJmHgd6amqjMF2M4Ifk0M2uX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yVnKACV 2o4E4x0H7glM6w8pANYQSGQK9ZH3RQzjWyn89oc_Z4eZQHoExobbj1gxi2e1_dBuTccmBYJP579_ ux_RdaIoXCqgDRSbuqj5LjfWlJYPBy4xVQ6dTvtt62U8qteVwU5stzQQsGEgya8rG2RasC.mLlVD AGY17EFvFhtsuc5zPr7I.h3tEf6IRztc8QeFxjA.w.IIundzQIhyEylvJsZJBrvkFfIkYFCk_xWQ E55_M16Qbf2SXGp6rDyRQr9BiVtEnl.hTLWhvSZDcySaYh0CEAIzwvXQqWM26j_smvVcFT7QmTL3 j4.pbqfwsfctdoJNchiXkxy_W0f1bJ6bhOLVACbczcUk1oyWcbzD8Q6mT4ihPGhe4p0lRwEvMWcP VXvdEGQ_sNxo1oatEn5UrX5j3cnr7wJ5_8jqQ2QrgvN7v0GSoS9WbiFIuVvSC.YPwUwMHkbgOTxX qDwuvF1PPkYgRrjhTTPARbzG7IrrEhpGaElGg4Zk8_ X-Sonic-MF: X-Sonic-ID: 575fb88b-699d-4747-bbda-6c76e81d0f63 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Fri, 26 May 2023 00:34:03 +0000 Original-Received: by hermes--production-sg3-748897c457-h9s95 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 25e38892844d6790a41388aa05d5da3b; Fri, 26 May 2023 00:33:58 +0000 (UTC) In-Reply-To: ("Leonardo =?UTF-8?Q?Hern=C3=A1ndez_?= =?UTF-8?Q?Hern=C3=A1ndez?="'s message of "Thu, 25 May 2023 20:27:18 +0000") X-Mailer: WebService/1.1.21495 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:262395 Archived-At: Leonardo Hern=C3=A1ndez Hern=C3=A1ndez writes: > On Thu, May 25, 2023 at 04:35:56AM -0600, Po Lu wrote: >> OK, thanks. Does the crash still happen with this? >>=20 >> diff --git a/src/pgtkterm.c b/src/pgtkterm.c >> index b8c626d81d8..bbe68f04adc 100644 >> --- a/src/pgtkterm.c >> +++ b/src/pgtkterm.c >> @@ -6606,8 +6606,7 @@ pgtk_selection_event (GtkWidget *widget, GdkEvent = *event, >>=20 >> if (event->type =3D=3D GDK_PROPERTY_NOTIFY) >> pgtk_handle_property_notify (&event->property); >> - else if (event->type =3D=3D GDK_SELECTION_CLEAR >> - || event->type =3D=3D GDK_SELECTION_REQUEST) >> + else if (event->type =3D=3D GDK_SELECTION_REQUEST) >> { >> f =3D pgtk_find_selection_owner (event->selection.window); >>=20 > > The crash does not happen when copying text from outside emacs, > however it crashes when pasting text killed from emacs, > for example, open `emacs -Q` kill some text and try to paste that > text outside emacs (just run `wl-paste`) What if you apply this change? diff --git a/src/pgtkterm.c b/src/pgtkterm.c index b8c626d81d8..bfad949941b 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -376,11 +376,16 @@ mark_pgtkterm (void) for (i =3D 0; i < n; i++) { union buffered_input_event *ev =3D &evq->q[i]; - mark_object (ev->ie.x); - mark_object (ev->ie.y); - mark_object (ev->ie.frame_or_window); - mark_object (ev->ie.arg); - mark_object (ev->ie.device); + + if (ev->ie.type !=3D SELECTION_CLEAR_EVENT + && ev->ie.type !=3D SELECTION_REQUEST_EVENT) + { + mark_object (ev->ie.x); + mark_object (ev->ie.y); + mark_object (ev->ie.frame_or_window); + mark_object (ev->ie.arg); + mark_object (ev->ie.device); + } } =20 for (dpyinfo =3D x_display_list; dpyinfo;