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 21:44:57 +1100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000027549d06263c3685" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24452"; 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 11:47:29 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 1t8dZR-0006Dt-9q for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Nov 2024 11:47:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8dZ6-0007Gj-Eq; Wed, 06 Nov 2024 05:47:08 -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 1t8dZ1-0007GH-2c for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 05:47:07 -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 1t8dZ0-0006KE-Fv for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 05:47:02 -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=ljnY/GtuFfkfdLzmWobgZlJokK6aEt74be9DsclyRb8=; b=o+Pvp4uK/MYOFowTJkIDagg0qzGNVKtuheHoQbGR6CNMFe08lFb5rmx6U/LAzzFytbFcrQnfneJ30WV9HA5+N6Va35dizQtjmVP5HEnyKqqEpZIJsKvxW1PXer5z4lNWLbWZrcHtiDU/FK/0uHJ3YtF54eKNnOcZQn+Rh0uEhX9SJ2H03TMtZyMBQaqnqjmLRXR8S67cxn5yeud2E/+bURhXDm/4rXjGYNEEuGzFJV3js3m5FkVegqo7UTtxJbr1fgZWsexCTOaSUbuzgQWIbQGWSNeiwkkn3TH39pNAE8cIn66zT3tq02CVKKsp6Ln2Jk3g7NosBGLxKhOe7ylTFA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8dZ0-0000Z7-3Q for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 05:47: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 10:47: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.17308899772088 (code B ref 74224); Wed, 06 Nov 2024 10:47:02 +0000 Original-Received: (at 74224) by debbugs.gnu.org; 6 Nov 2024 10:46:17 +0000 Original-Received: from localhost ([127.0.0.1]:39769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8dYG-0000Xb-GE for submit@debbugs.gnu.org; Wed, 06 Nov 2024 05:46:16 -0500 Original-Received: from mail-lj1-f182.google.com ([209.85.208.182]:43444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8dY9-0000XN-Ul for 74224@debbugs.gnu.org; Wed, 06 Nov 2024 05:46:14 -0500 Original-Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2fb470a8b27so6887631fa.1 for <74224@debbugs.gnu.org>; Wed, 06 Nov 2024 02:46:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730889909; x=1731494709; 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=ljnY/GtuFfkfdLzmWobgZlJokK6aEt74be9DsclyRb8=; b=PkArGmFxmvRHMO8hrseZwH+mMqRXfqd7rhXgxIF9I82zujX715U027sGxUmSxAUBgE q4IkaHQjUTc3FYI+Dqnnj9v6WE2witq+UfWmqeE1zw6mSMronTAunYBJfFlEr70KJII7 TYCPBgDn7QEeIJ1M3CLQjkKMp6JcLUxmCIxIALK39mHhJjsPYQe72/2yYJZrpXppq3JN OYGqXsYbYJvFKya8mpwFpaL+qncbqIQanWbxeDhwY8EVPq7vBLB0m05h9mowuwc5v3tM PUMKjGaXfhDpChrp5KpkBBYwRlH1fX/wseWp1l77JJrFTUMgQJwsRCUGRxo7jNZ+1k2p T/PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730889909; x=1731494709; 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=ljnY/GtuFfkfdLzmWobgZlJokK6aEt74be9DsclyRb8=; b=M29ztES2JQLa87PM06MlrDr2MN2k6aVn+DjYPDxZ74O/b413Ic+5XlvILNl2hh381G srRcf0yYrnS3Xe9YpNpG/7hqx5tMuAKZqrF+erAjwN5fznyQcxb+hcfMGOANI1biWFsS u7xyWeV9Yee5aE5UIM7lfMfsqGMH9HCJ0Jzeb/FpMwBYhHFR0/aptB68FfN2Fk2bCFWV i3BbbfpCLPHTyjhjjvKTH4GCNzBQ8On4FiVdRQxbnOGWFtscKpp4X3HaDBZxH8FpToAW lOVJ/vwiwkY7goUqtiBsSLfXHdOFrbiBz+qSFRVsfLx9M1w976/5zwkcsP8Uz2cxUmxt SSpw== X-Gm-Message-State: AOJu0Yyvl+KRmPKiojlW72BD7MfX3szW/kjgKVZL4JOANFTGQeB0W5sp yJsU3YE74zUbU21efGXoEkT87nVtRBWZ3RakXJDNyd9HXYNNa2AXWd/LcU5X05GFb0j2Bxyc2OH px9XmqpD9AESRYr4Q26aSp5JdGAVHEhJA X-Google-Smtp-Source: AGHT+IHdNzmvrCxIYzSc7GEZB/kesFWsjSvLhJo5jvVmo+BwTgdG4sNJbJ5qjFQBaysIqv4fF6jEDhXWq4XzIqVKPMs= X-Received: by 2002:a05:651c:b08:b0:2fa:ce87:b7da with SMTP id 38308e7fff4ca-2ff0cd02995mr5238141fa.18.1730889908700; Wed, 06 Nov 2024 02:45:08 -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:294946 Archived-At: --00000000000027549d06263c3685 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > LGTM. Can you commit that yourself to the branch? I don't have a savannah account for emacs, but I have just registered and will chase up approvals. timers are cleaned up by cancel_atimer(), then they get put on a free list (`free_atimers` on line 132 in the snippet). It appears that we rely on the OS to cleanup at emacs shutdown. On Wed, Nov 6, 2024 at 9:36=E2=80=AFPM Gerd M=C3=B6llmann wrote: > Jeff Walsh writes: > > > #ifdef WINDOWSNT > > #define raise(s) w32_raise(s) > > @@ -132,7 +133,13 @@ start_atimer (enum atimer_type type, struct > timespec timestamp, > > free_atimers =3D t->next; > > } > > else > > - t =3D xmalloc (sizeof *t); > > + { > > +#ifdef HAVE_MPS > > + t =3D igc_xzalloc_ambig (sizeof *t); > > +#else > > + t =3D xmalloc (sizeof *t); > > +#endif > > + } > > > > /* Fill the atimer structure. */ > > memset (t, 0, sizeof *t); > > On second thought, and I don't know if it's relevant, do we need to > igc_xfree that? > --00000000000027549d06263c3685 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> LGTM. Can you commit that yourself to the branch= ?

I don't have a savannah account for emacs, b= ut I have just registered and will chase up approvals.

timers are cleaned up by cancel_atimer(), then they get put on a f= ree list (`free_atimers` on line 132 in the snippet).
It appears = that we rely on the OS to cleanup at emacs shutdown.


On= Wed, Nov 6, 2024 at 9:36=E2=80=AFPM Gerd M=C3=B6llmann <gerd.moellmann@gmail.com> wrote:
Jeff Walsh <fejfighter@gmail.com= > writes:

>=C2=A0 #ifdef WINDOWSNT
>=C2=A0 #define raise(s) w32_raise(s)
> @@ -132,7 +133,13 @@ start_atimer (enum atimer_type type, struct times= pec timestamp,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 free_atimers =3D t->next;
>=C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 else
> -=C2=A0 =C2=A0 t =3D xmalloc (sizeof *t);
> +=C2=A0 =C2=A0 {
> +#ifdef HAVE_MPS
> +=C2=A0 =C2=A0 =C2=A0 t =3D igc_xzalloc_ambig (sizeof *t);
> +#else
> +=C2=A0 =C2=A0 =C2=A0 t =3D xmalloc (sizeof *t);
> +#endif
> +=C2=A0 =C2=A0 }
>=C2=A0
>=C2=A0 =C2=A0 /* Fill the atimer structure.=C2=A0 */
>=C2=A0 =C2=A0 memset (t, 0, sizeof *t);

On second thought, and I don't know if it's relevant, do we need to=
igc_xfree that?
--00000000000027549d06263c3685--