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#46111: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking Date: Thu, 28 Jan 2021 15:58:09 +0200 Message-ID: <837dnxyxhq.fsf@gnu.org> References: <87sg6oyzi6.wl-me@enzu.ru> <6915951F-2A53-4B08-A48A-6683B99AA14A@gnu.org> <871re5vh7a.fsf@ultra.enzu.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5601"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46111@debbugs.gnu.org To: Ahmed Khanzada , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 28 15:02:28 2021 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 1l57sS-0001Jb-9m for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jan 2021 15:02:28 +0100 Original-Received: from localhost ([::1]:57052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l57sR-0002LJ-9T for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jan 2021 09:02:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l57p9-0000Da-H2 for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2021 08:59:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36077) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l57p7-0000s4-SU for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2021 08:59:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l57p7-0007hq-SC for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2021 08:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jan 2021 13:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46111 X-GNU-PR-Package: emacs Original-Received: via spool by 46111-submit@debbugs.gnu.org id=B46111.161184228829553 (code B ref 46111); Thu, 28 Jan 2021 13:59:01 +0000 Original-Received: (at 46111) by debbugs.gnu.org; 28 Jan 2021 13:58:08 +0000 Original-Received: from localhost ([127.0.0.1]:47621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l57oG-0007gb-Kn for submit@debbugs.gnu.org; Thu, 28 Jan 2021 08:58:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l57oE-0007g1-Od for 46111@debbugs.gnu.org; Thu, 28 Jan 2021 08:58:07 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42217) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l57o9-0000bY-0e; Thu, 28 Jan 2021 08:58:01 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1334 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l57o4-00050K-RL; Thu, 28 Jan 2021 08:57:58 -0500 In-Reply-To: <871re5vh7a.fsf@ultra.enzu.ru> (message from Ahmed Khanzada on Wed, 27 Jan 2021 20:06:01 -0800) 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:198790 Archived-At: > From: Ahmed Khanzada > Cc: > Date: Wed, 27 Jan 2021 20:06:01 -0800 > > Eli Zaretskii writes: > > > Thanks. However, could you please show the C-level backtrace from the SIGBUS crash, as displayed by GDB? I think we'd like to know which string has its data unaligned to cause this. > > Is the log below the information that you are looking for? Yes, thanks. > 4613 EMACS_UINT c = *p; > (gdb) next > > Program received signal SIGBUS, Bus error. > 0x000000455fe1dc6c in hash_string (ptr=0x47fa34d596 "DndProtocol", > len=11) at fns.c:4613 > 4613 EMACS_UINT c = *p; > (gdb) backtrace > #0 0x000000455fe1dc6c in hash_string (ptr=0x47fa34d596 "DndProtocol", > len=11) at fns.c:4613 > #1 0x000000455fe1dd48 in sxhash_string (ptr=0x47fa34d596 "DndProtocol", > len=11) at fns.c:4640 > #2 0x000000455fe1e36c in sxhash_obj (obj=0x47fa02f0bc, depth=0) at > fns.c:4759 > #3 0x000000455fe1e270 in sxhash (obj=0x47fa02f0bc) at fns.c:4741 > #4 0x000000455fe1c52c in hashfn_equal (key=0x47fa02f0bc, > h=0x47fa02eff0) at fns.c:4096 > #5 0x000000455fe1cf44 in hash_table_rehash (hash=0x47fa02eff5) at > fns.c:4342 > #6 0x000000455fdc5264 in hash_table_thaw (hash=0x47fa02eff5) at > pdumper.c:2652 > #7 0x000000455fdcd184 in thaw_hash_tables () at pdumper.c:5477 Stefan, any ideas? One possibility is to use memcpy instead of dereferencing a pointer. We could do that either unconditionally or when the original pointer is not aligned on 4/8-byte boundary.