From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71694: 30.0.50; heap-use-after-free in tty_defined_color Date: Fri, 21 Jun 2024 17:22:42 +0300 Message-ID: <864j9ml6j1.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3923"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71694@debbugs.gnu.org To: Daniel Clemente Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 21 18:25:21 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 1sKh4j-0000hP-EN for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jun 2024 18:25:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKh4V-00021R-4e; Fri, 21 Jun 2024 12:25:07 -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 1sKh4R-00020N-Vo for bug-gnu-emacs@gnu.org; Fri, 21 Jun 2024 12:25:03 -0400 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 1sKh4R-0004L9-L8 for bug-gnu-emacs@gnu.org; Fri, 21 Jun 2024 12:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sKh4Q-0000aX-Pm for bug-gnu-emacs@gnu.org; Fri, 21 Jun 2024 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Jun 2024 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71694 X-GNU-PR-Package: emacs Original-Received: via spool by 71694-submit@debbugs.gnu.org id=B71694.17189871002229 (code B ref 71694); Fri, 21 Jun 2024 16:25:02 +0000 Original-Received: (at 71694) by debbugs.gnu.org; 21 Jun 2024 16:25:00 +0000 Original-Received: from localhost ([127.0.0.1]:43121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKh4O-0000Zs-FE for submit@debbugs.gnu.org; Fri, 21 Jun 2024 12:25:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKh4M-0000ZY-Mr for 71694@debbugs.gnu.org; Fri, 21 Jun 2024 12:24:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKfA5-0003w6-LI; Fri, 21 Jun 2024 10:22:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3j1aw9xqeCZ3QHGkKKLZcPWcIwL4MFPalz7aipZ9SNw=; b=eShYoeu8yUQ1 KVirWxoy7bAg5MHn+W9t7ebOx9Emlxc/rER9oAmUrrPkkqka6bQHP9GKxlNtZ2gKSANqJsPEdCHL/ DIRuo2izGbCQlSR4qkN28zbszSR88SuWAc/fx5HaEebSgdJgys3hhCC839YaFxUfXkXtsYmkKuCVh k/mMNwjWS6QR71UhFvpMtz8bMgiQNLQkI++as1TBFBnsKfofib+XB90jgcOtcjR6YJp2DGavJFDVe eQ5Gs0IC0CmlQaRk86Ilg4WsR/IcYf/B86AecCVgsFG0pU5Ff2zMR5DUfzqrEkExIwr9BlhpPLmZB HxlO19ks41PTdlHBw0mhNw==; In-Reply-To: (message from Daniel Clemente on Fri, 21 Jun 2024 10:47:01 +0000) 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:287620 Archived-At: > From: Daniel Clemente > Date: Fri, 21 Jun 2024 10:47:01 +0000 > > I enabled -fsanitize. I'm using an X terminal to run TTY Emacs inside. > I opened the daemon inside gdb with emacs --fg-daemon -Q > > I don't remember what exactly I was doing here, but it only involved > slowly opening 2 or 3 terminals like this > urxvt -e "emacsclient" "-c" "-e" '(dired "~")' > and then I might have opened 2 or 3 with this (in the same session) > xterm -e "emacsclient" "-c" "-e" '(dired "~")' > Plus switching between them and closing them. > However that's not a reproduction formula, it's just what I was doing > when this crash randomly happened. I don't know how to reproduce this > yet. > > ================================================================= > ==9677==ERROR: AddressSanitizer: heap-use-after-free on address > 0x625000123b30 at pc 0x55555695b2c9 bp 0x7fffffff9900 sp > 0x7fffffff98f8 > READ of size 1 at 0x625000123b30 thread T0 > #0 0x55555695b2c8 in tty_defined_color /w/emacs/src/xfaces.c:1115 I think this is bogus: -fsanitize doesn't understand the Emacs memory management, in particular what's going in GC when we relocate strings. In any case, the line numbers seem off: line 1115 of xfaces.c is a comment. Are your sources in sync with the Git repository?