From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeff Walsh Newsgroups: gmane.emacs.bugs Subject: bug#74224: [PATCH][scratch/igc] pgtk: fix crashing bug in atimer used for checking scaling Date: Wed, 6 Nov 2024 20:30:02 +1100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000003faf0806263b2a5f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37622"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74224@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 06 10:32:37 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 1t8cOy-0009ek-K9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Nov 2024 10:32:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8cOe-0004ml-DX; Wed, 06 Nov 2024 04:32:16 -0500 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 1t8cOa-0004lt-Qj for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 04:32:13 -0500 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 1t8cOS-0000Iu-0X for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 04:32:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=SK+OLKQfyvDrYmiq8KcpHZ5JIJC2kYyG7iTArIfx5zo=; b=hY6kBqg101iak6TcXa8ESwBPQFR0tc/rnUIJEagi+93Q34RUWxbSMAJ83EuCnz1X4aXwq7PHDv9b+J9A1JHVhnSAYAFOUg4ORLhrzZAkWIQUAj/4UM1If/VPvJU0d7UIMQzxGWzPnPKAgJXW3ERb00tzcUAzTsdHytrfZJ6cHRkXUz0HZ040U/vE+71rZVj55B5WTxu2f1YYNyj/UF4OPVU1a6N0tiHjQwcufuaENVDV6Z3JS9PVP3bm02yDyR4F6i1Qq02lJ+NqgEAwWMy7AUAjTU6OWOOzO/IXvIrLRhvROYvFkjpb6yFI0/7wiWoStSNr23MX2hBNG/Wq89J3lA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8cOQ-0005kB-V2 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 04:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jeff Walsh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Nov 2024 09:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74224 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74224-submit@debbugs.gnu.org id=B74224.173088547822006 (code B ref 74224); Wed, 06 Nov 2024 09:32:02 +0000 Original-Received: (at 74224) by debbugs.gnu.org; 6 Nov 2024 09:31:18 +0000 Original-Received: from localhost ([127.0.0.1]:39645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8cNi-0005ir-7Q for submit@debbugs.gnu.org; Wed, 06 Nov 2024 04:31:18 -0500 Original-Received: from mail-lj1-f177.google.com ([209.85.208.177]:52583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8cNf-0005ih-Ek for 74224@debbugs.gnu.org; Wed, 06 Nov 2024 04:31:17 -0500 Original-Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2feeb1e8edfso56198891fa.1 for <74224@debbugs.gnu.org>; Wed, 06 Nov 2024 01:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730885414; x=1731490214; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VC5o2hMRDXvqcMao+TNuh7NZ7XlClOmx24Odg7cF8PY=; b=YzahiEnR9WX62gFaJIqmEL9SOca4l3QGTn4qfre486EjO/6LbR54vJt1cYibHpMFq9 vv30aobp3eIfZ+1Kj13CfCQGw+4IBTYFZRW3RRxxwg4ceofRN2D++GczZI266vwMpCYH HYEBPHvVV8IEbbHDpygVsjhvx4vV2v/b2H0SYonRMc88bqUAkYlbu+hg6nMgGiQR9EtE WaD+zNNXDoD0xm61bAMYDnCYdQnpDqGwz7tR9KK9DWbcyE72Gyjzs0MMk/eovZRyo6FY 4mnGs2VemfbneB1RINWSYo3spVWgyxMOtYJZ1JWBQh6OMIY0Lt1Wyvg7sRCzl/SHfDmv OOEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730885414; x=1731490214; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VC5o2hMRDXvqcMao+TNuh7NZ7XlClOmx24Odg7cF8PY=; b=Fzh3cxBJOpKACfNKq0bNr9pIFypgGzl1Q3oJMt/YHbb33FVL6lGKd48q8WAkLBIz47 JlvLEPZmg/QolijvYtGjxZFYmb0oJCCBfILITw4UKTz6F1Zewu+0eiVj8myg6fKmLNxq f9HpEXJTA3SR8v4qFUq0hcJ2id9O/Q1dP+OFapnlPGDCjyxJnF8Gkt2Hz7fvyE66r1h6 LoTJKO3VwdmEsYyxaUiHS9F0kCax/ckqMmqskxemRKpGm/KCdWrjgNP1Q+ic2YqYFOoM WzE7FtkYl9dl2o7z3wH64osE4HsfsjUpCzbTsxHZLV1lCbU61u1lu8WKZxbs1O826bjT oAyg== X-Gm-Message-State: AOJu0YwAtiet3ka6613ts2CA72a2f/J8ZLU9FF3FoKde7lAHADb4UcmS oroOvel3Kz+ytyjQ0cKUQAn6j41jKDbWMM8c8/laX2t+wvhwvBa75BRYPN2ofrk4p7XhrHa8GSG E/b3r+2Td9CavLGdgnLIlfTTxcFk= X-Google-Smtp-Source: AGHT+IFnDt6T3L4Qkd61BVObNJj7Vgf1gJYi39J5nqmqCqGGXFMBp9xwLfVpeI89u24IomjV+XgdbP5CVOqK7pM7/Eo= X-Received: by 2002:a05:651c:1148:b0:2fb:61c0:137 with SMTP id 38308e7fff4ca-2fedb82fc8fmr161008491fa.40.1730885413995; Wed, 06 Nov 2024 01:30:13 -0800 (PST) In-Reply-To: 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:294942 Archived-At: --0000000000003faf0806263b2a5f Content-Type: multipart/alternative; boundary="0000000000003faf0706263b2a5d" --0000000000003faf0706263b2a5d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Gerd, No problems, I'd love to see this go in one day, it's just hard enough to carve out time to debug crash dumps I got overzealous with the change in pgtkterm.c, with the call from `lispstpcpy` (and your explanation there makes sense) looking at xterm, I see we have not marked that as a root , which is where I think that code was ported from originally. I have attached an updated patch, using a rebuilt igc-emacs from that commit, which is holding up. Thanks, On Wed, Nov 6, 2024 at 7:56=E2=80=AFPM Gerd M=C3=B6llmann wrote: > Fejfighter writes: > > > This patch marks 2 outstanding ambiguous roots and appears to solve > > crashing bugs I had been experiencing with igc/mps and pgtk. > > > > I have run this locally today, and I would have normally faced crashes > > at timer expiration, this appears to be holding up. > > Thanks for the report, Jeff! Nice to see that someone besides me is > using this :-). > > I think I see why the change in atimer.c is necessary: pgtk stores a > struct frame * as client_data in an atimer structure. That's a Lisp > object that can move during GC. Understood. > > The other change in pgtkterm.c I don't understand. AFAICS, x_id_name of > the display_info structure is indeed only used as a character buffer > into which characters from Lisp strings are memcpy'd. Could you please > explain that one? (I'm macOS only, so I don't know anything about pgtk, > if that matters.) > --0000000000003faf0706263b2a5d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi Gerd,

No problems, I'd love to see this go in one day, it= 9;s just hard enough to carve out time to debug crash dumps

<= /div>
I got overzealous with the change in pgtkterm.c, with the call fr= om `lispstpcpy` (and your explanation there makes sense)
look= ing at xterm, I see we have not marked that as a root , which is where I th= ink that code was ported from originally.

I have a= ttached an updated patch, using a rebuilt igc-emacs from that commit, which= is holding up.

Thanks,

=
On Wed= , Nov 6, 2024 at 7:56=E2=80=AFPM Gerd M=C3=B6llmann <gerd.moellmann@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Fejfighter <fejfighter@gmail.com>= writes:

> This patch marks 2 outstanding ambiguous roots and appears to solve > crashing bugs I had been experiencing with igc/mps and pgtk.
>
> I have run this locally today, and I would have normally faced crashes=
> at timer expiration, this appears to be holding up.

Thanks for the report, Jeff! Nice to see that someone besides me is
using this :-).

I think I see why the change in atimer.c is necessary: pgtk stores a
struct frame * as client_data in an atimer structure. That's a Lisp
object that can move during GC. Understood.

The other change in pgtkterm.c I don't understand. AFAICS, x_id_name of=
the display_info structure is indeed only used as a character buffer
into which characters from Lisp strings are memcpy'd. Could you please<= br> explain that one? (I'm macOS only, so I don't know anything about p= gtk,
if that matters.)
--0000000000003faf0706263b2a5d-- --0000000000003faf0806263b2a5f Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Mark-atimer-allocation-as-ambiguous-root.patch" Content-Disposition: attachment; filename="0001-Mark-atimer-allocation-as-ambiguous-root.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m35ods6g0 RnJvbSAwODA1NDFhZTU0NjNlZGE5YjIwZDllYzkyY2I0MTIwMmJhMjFkODdjIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKZWZmIFdhbHNoIDxmZWpmaWdodGVyQGdtYWlsLmNvbT4KRGF0 ZTogVHVlLCA1IE5vdiAyMDI0IDIzOjA5OjU2ICsxMTAwClN1YmplY3Q6IFtQQVRDSF0gTWFyayBh dGltZXIgYWxsb2NhdGlvbiBhcyBhbWJpZ3VvdXMgcm9vdAoKKiBzcmMvYXRpbWVyLmMgKHN0YXJ0 X2F0aW1lcik6IFRpbWUgY291bGQgYmUgcGFzc2VkIGEgbGlzcCBvYmplY3QgZm9yCmRhdGEsIHdl IHNob3VsZCBhbGxvY2F0ZSB0aGlzIGFzIGFuIGFtYmlndW91cyByb290Ci0tLQogc3JjL2F0aW1l ci5jIHwgOSArKysrKysrKy0KIDEgZmlsZSBjaGFuZ2VkLCA4IGluc2VydGlvbnMoKyksIDEgZGVs ZXRpb24oLSkKCmRpZmYgLS1naXQgYS9zcmMvYXRpbWVyLmMgYi9zcmMvYXRpbWVyLmMKaW5kZXgg ODI1M2FlM2ExNjYuLjViZDI4MmEzMTBkIDEwMDY0NAotLS0gYS9zcmMvYXRpbWVyLmMKKysrIGIv c3JjL2F0aW1lci5jCkBAIC0xNyw2ICsxNyw3IEBACiBhbG9uZyB3aXRoIEdOVSBFbWFjcy4gIElm IG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogCiAjaW5jbHVk ZSA8Y29uZmlnLmg+CisjaW5jbHVkZSAiaWdjLmgiCiAKICNpZmRlZiBXSU5ET1dTTlQKICNkZWZp bmUgcmFpc2UocykgdzMyX3JhaXNlKHMpCkBAIC0xMzIsNyArMTMzLDEzIEBAIHN0YXJ0X2F0aW1l ciAoZW51bSBhdGltZXJfdHlwZSB0eXBlLCBzdHJ1Y3QgdGltZXNwZWMgdGltZXN0YW1wLAogICAg ICAgZnJlZV9hdGltZXJzID0gdC0+bmV4dDsKICAgICB9CiAgIGVsc2UKLSAgICB0ID0geG1hbGxv YyAoc2l6ZW9mICp0KTsKKyAgICB7CisjaWZkZWYgSEFWRV9NUFMKKyAgICAgIHQgPSBpZ2NfeHph bGxvY19hbWJpZyAoc2l6ZW9mICp0KTsKKyNlbHNlCisgICAgICB0ID0geG1hbGxvYyAoc2l6ZW9m ICp0KTsKKyNlbmRpZgorICAgIH0KIAogICAvKiBGaWxsIHRoZSBhdGltZXIgc3RydWN0dXJlLiAg Ki8KICAgbWVtc2V0ICh0LCAwLCBzaXplb2YgKnQpOwotLSAKMi40Ny4wCgo= --0000000000003faf0806263b2a5f--