From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: eassert always aborts in eval.c in an optimized build Date: Sun, 27 Oct 2024 10:57:21 -0700 Organization: UCLA Computer Science Department Message-ID: References: <8634kiaq0b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26638"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 27 18:58:09 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t57Wi-0006oU-TT for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Oct 2024 18:58:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t57W5-0001CM-Fx; Sun, 27 Oct 2024 13:57:29 -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 1t57W4-0001C6-3n for emacs-devel@gnu.org; Sun, 27 Oct 2024 13:57:28 -0400 Original-Received: from mail.cs.ucla.edu ([131.179.128.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t57W2-0005gK-7C; Sun, 27 Oct 2024 13:57:27 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id C42F53C00FA8F; Sun, 27 Oct 2024 10:57:22 -0700 (PDT) Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id kXC0eAqLjlyK; Sun, 27 Oct 2024 10:57:22 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 83B543C00FAA7; Sun, 27 Oct 2024 10:57:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 83B543C00FAA7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1730051842; bh=XPzIpx4mLUJLRpn+MqXkPXanDJ08GjdaqdnVGVpPYX0=; h=Message-ID:Date:MIME-Version:To:From; b=fhmSVRCz23vVz8INORzGDC2etBZeqcKUvVeBWqfis6V0xHMo3zMbdV6PLMQfUzJ7W TBfwgJws9QD2W0m4U1btPkTg5sZRTNjFwxlnH3M8fY4Mo+0nd6SGhPyNnIh5Un8QwB FsLh91C2obLo5wt1Y7mAKeSOrsihEBdXZ4kS3qsBD/ouTDVEja7qoZ3HH8KZEaGfwv fOcy9YjqC0s4b+Ht7VW4JmruH6RUH85NOe+3lce++dIUJW9cTAandunqGWM0KorWVF Vgx/+1NAzpC+krzGeysxatDyS52z26+Ycm+Dx07GvFIS9Ak6HFQgwgmQ8m656yg1Nm 1K0VailMloJmg== X-Virus-Scanned: amavis at mail.cs.ucla.edu Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id zxEgmaECKkkq; Sun, 27 Oct 2024 10:57:22 -0700 (PDT) Original-Received: from [192.168.254.12] (unknown [47.150.137.250]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 686433C00FA8F; Sun, 27 Oct 2024 10:57:22 -0700 (PDT) Content-Language: en-US In-Reply-To: <8634kiaq0b.fsf@gnu.org> Received-SPF: pass client-ip=131.179.128.66; envelope-from=eggert@cs.ucla.edu; helo=mail.cs.ucla.edu X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324886 Archived-At: On 2024-10-27 01:50, Eli Zaretskii wrote: > Something is wrong with our definition/use of eassert in eval.c when > Emacs is compiled with optimizations and with --enable-checking: all > the functions in eval.c that assert pdl->kind's value are compiled > into code that always aborts. A quick look suggests that although the actual code is fine, GDB is confused and its "disassemble" and other commands think that the symbol "backtrace_function" stands for the address of just part of the backtrace_function code, not the address of the function's first instruction. If my guess is right, if you try to debug Emacs with GDB and use xbacktrace or similar commands, things will go haywire. You'll see symptoms like this: (gdb) p backtrace_function $1 = {Lisp_Object (union specbinding *)} 0x6ed5c ... whereas the shell command "nm emacs | grep backtrace_function" outputs this: 0000000000293cd0 T backtrace_function 000000000006ee78 t backtrace_function.cold 000000000006ed5c t backtrace_function.part.0 ... and we can see that GDB has the wrong "backtrace_function". Does this match the symptoms you're observing? If my guess is right, GDB should be fixed, and also we should look into patching Emacs to work around the GDB bug.