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#56372: 29.0.50; [PATCH] Avoid BadMatch X11 error Date: Mon, 04 Jul 2022 18:10:00 +0800 Message-ID: <87r1319ojr.fsf@yahoo.com> References: <87czemtfv0.fsf@dick> <87r131fpmm.fsf@dick> 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="5088"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: 56372@debbugs.gnu.org To: dick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 04 12:11:12 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 1o8J2s-00019D-H3 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 12:11:10 +0200 Original-Received: from localhost ([::1]:46422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8J2r-00020y-9s for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 06:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8J2k-00020q-Ti for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 06:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52215) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8J2k-0002Vv-Kx for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 06:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8J2k-0006AB-FX for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 06:11: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, 04 Jul 2022 10:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56372 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56372-submit@debbugs.gnu.org id=B56372.165692941923623 (code B ref 56372); Mon, 04 Jul 2022 10:11:02 +0000 Original-Received: (at 56372) by debbugs.gnu.org; 4 Jul 2022 10:10:19 +0000 Original-Received: from localhost ([127.0.0.1]:46112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8J23-00068x-5V for submit@debbugs.gnu.org; Mon, 04 Jul 2022 06:10:19 -0400 Original-Received: from sonic303-21.consmr.mail.ne1.yahoo.com ([66.163.188.147]:36136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8J1y-00068T-Ck for 56372@debbugs.gnu.org; Mon, 04 Jul 2022 06:10:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1656929408; bh=0v5aVfA/gyNUPhrbdFT26NLyjKrDhwZsX1PKSuXwyyw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=uWz5uyHH3ioKM6Ab8NwJKVJKux0Q8oP98ofktb/0zdyGecNwnnqsMRX6wZhply3A8S4xcj2eEHW5Tc2BN3SpdYVERRKueWGa4h8h196xtaXPdfqV5wp5GDfZhHlPfqDXqm9UIjf1Cc3+M2weTXv9+BooXmJPnEg7BZECqWW3XGA5+DZNRUKzoJIOw6gTFJ0nHGCLjCVgtepAi9x8cIWRDtnwZhfl3UihWGW+KQ7tfLRVlhfEgBMRxy8l+MRoaT2fZgh/RSk6rLJPQv+cEF5u4ptfTlMruR7ZWEmG8Xqk4ELroJcex1fjocIvJuK+y/LMyeI+qx1skeTjZcQMjyFjBg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1656929408; bh=GGe4p544WSvG9eTWkLBcV5HnG0gvA7xyBS4ruPmxRey=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=VsXFDx6Wcx4bUjSwRKfYblozozv1u8/KyL1eigf5XQSIK290u1jQnkNPcHEmMPatrILDot15uklyWP8CguJv/iE6h/SuMrOvzQvqm2vhwggiAU6WdNWnTtbdZU+17HRDfh2OEjEX7YvlFXBZJ0t3+1M6RSSz7LWHYWgsfwqPIttlU6hlnZqNgsuSxNPRvkU0UDTNQihOq3/X4EvKevo2pnba3YDCB6KWjR0OTJtvCB2jYC2iQ20FHGIVPnSxADFbRQ1xY7ogwT0Wmdy8PRN4PEuz6+W8E0BjIW2pOBiVyK8lmre/DMcyELAxnOyxpvdT764fs5y6zjGNjiGfjsiAvg== X-YMail-OSG: NDlTjeIVM1mdK5wGWwvPMqLaI0WaMke89JRzO1VWjj5u4pMdNS3K_RQMryScbnz 30z5sw3Kp.vkBRJFuTvfk6VCEzOTZ6tqnCm61cY1TLFB9AjEwpncvPOTVVEh7g5iYJS2WDlhxagn 5bGpYf7BEqf6M2FoLHplHacp7.HslOnWPWBsn_KdvUtd_78m9NNeBkSGCvXk0oK52oeHiuC9sTk8 ogKv5x9eaDdYe5Q0QhQtysY5LtUflw3gRiXGb_ZPAxyXLBsHNYmhvxZkE8KmvXoQFEomLn8pklVf vObem1hH5sYqH97vC9PmSlCX96X64xqW9vxFJWXRtbKWnsasShaVxESCCyw0DHNfKsekmmtTp7Mn 6oXnLzggBgJMWhZv9z0GMVvoKKXksSNceqIU0vlOyVa.dinNSVlbAJ37N3At4gr2OrgyQj2VcZ92 bpQeNdId9ik2o0YAj3_JEG9UXKvskxFeRI2qmhM6CjD1Pa8Lz27zxF.2O_eZBnFMzf9Ni..EMus1 MP.4P9r69sdFQ6SKJ.ujl251Ux9lQ.rtq4.MS4GOv4jesXa_FwSSXG3G19iIm3q6nIYjkSNEeELR zZxrNyj95vC0Sy7sdyXVMYxPVbC1Y5sTBAO7T5Mai0fXUkir9cCIDORyk1D8NTc1D3YXbwH86HmH EvI3obpFctV5rG26.pRw_jewwlWX9tSDb03kGsDBf1w3u6Ue7nWq7qjhBrQMbLQBV2FZOyvkYsnf LtVw2VonDfXsLJ5IMl_txkK76YXDhx4R9vyaCcGtAo6HGjkzWr0v2E10uwjnKybYgKk6DFPDcc6S XPGQE.YlD.LvqC6sz_UDJ0k4wnvkyF6Sv0enPnm43Y X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Mon, 4 Jul 2022 10:10:08 +0000 Original-Received: by hermes--canary-production-sg3-67975bbd4b-zlmw9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c4298eb82b3ac8a016391805f4b3a815; Mon, 04 Jul 2022 10:10:05 +0000 (UTC) In-Reply-To: <87r131fpmm.fsf@dick> (dick's message of "Mon, 04 Jul 2022 00:50:09 -0400") X-Mailer: WebService/1.1.20381 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" Xref: news.gmane.io gmane.emacs.bugs:236038 Archived-At: dick writes: >>>From 5d2442a836a5641f8f1c2b4a844fe510a77bd8c5 Mon Sep 17 00:00:00 2001 > From: dickmao > Date: Mon, 4 Jul 2022 00:47:34 -0400 > Subject: [PATCH] Avoid segfault > > * src/xterm.c (x_connection_closed): Avoid segfault. > --- > src/xterm.c | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/src/xterm.c b/src/xterm.c > index c5acb450837..464887da975 100644 > --- a/src/xterm.c > +++ b/src/xterm.c > @@ -23518,17 +23518,18 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) > > fprintf (stderr, "X error handlers currently installed:\n"); > > - for (failable = dpyinfo->failable_requests; > - failable < dpyinfo->next_failable_request; > - ++failable) > - { > - if (failable->end) > - fprintf (stderr, "Ignoring errors between %lu to %lu\n", > - failable->start, failable->end); > - else > - fprintf (stderr, "Ignoring errors from %lu onwards\n", > - failable->start); > - } > + if (dpyinfo) > + for (failable = dpyinfo->failable_requests; > + failable < dpyinfo->next_failable_request; > + ++failable) > + { > + if (failable->end) > + fprintf (stderr, "Ignoring errors between %lu to %lu\n", > + failable->start, failable->end); > + else > + fprintf (stderr, "Ignoring errors from %lu onwards\n", > + failable->start); > + } > > for (stack = x_error_message; stack; stack = stack->prev) > fprintf (stderr, "Trapping errors from %lu\n", That piece of code is already inside "if (dpyinfo)" -- in fact, your patch misses a use-after-free, which has already been fixed on master.