From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#46111: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking Date: Thu, 28 Jan 2021 10:09:21 -0500 Message-ID: References: <87sg6oyzi6.wl-me@enzu.ru> <6915951F-2A53-4B08-A48A-6683B99AA14A@gnu.org> <871re5vh7a.fsf@ultra.enzu.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10303"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46111@debbugs.gnu.org To: Ahmed Khanzada Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 28 16:12:29 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 1l58yD-0002Yr-4V for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jan 2021 16:12:29 +0100 Original-Received: from localhost ([::1]:59128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58yC-0006d6-3L for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Jan 2021 10:12:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58vp-0005Uk-WF for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2021 10:10:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37819) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58vp-0000c0-OU for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2021 10:10:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l58vp-0001Sh-JM for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2021 10:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jan 2021 15:10: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.16118465715579 (code B ref 46111); Thu, 28 Jan 2021 15:10:01 +0000 Original-Received: (at 46111) by debbugs.gnu.org; 28 Jan 2021 15:09:31 +0000 Original-Received: from localhost ([127.0.0.1]:49365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l58vL-0001Rv-9Y for submit@debbugs.gnu.org; Thu, 28 Jan 2021 10:09:31 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l58vJ-0001Rh-3z for 46111@debbugs.gnu.org; Thu, 28 Jan 2021 10:09:29 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D47CC4403AE; Thu, 28 Jan 2021 10:09:23 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8AFDB440536; Thu, 28 Jan 2021 10:09:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1611846562; bh=qqSijwYZi8CeySEJnjCYMxyA7g5dLBM5juoClqP0XYQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=IsWtIfMG9BqBavRQ6za62w2c4uD464Hig5BBiOGUpQGfmTZZnPvFPlQ03UiUlYvjm w51nySp2k8Pios1C1FZyBIpHQjXrFzUjA8cJJmTbjJRweEOStC9wZveXYx4bOBILIi jaP0XlbKOPms2vljeV40E3BFlmyhIeE4834pXNlvfXHQ/y+ZTUrBSWBR3Ngc2c7JcZ lv9ribRb7M8Oe3OYz57nYsomSG3nC6JT/GPCNxoHLGOJAiX/CK5MuXMG8xaLDCQN6K Gq8ZkUP3BeBxNNJeBQ+h1TPklRyhuhvWCXcfaocAic9bK9gFeUwCsXGu8IB4pnYIj7 BxiKlmbkqVjmQ== Original-Received: from alfajor (69-196-141-46.dsl.teksavvy.com [69.196.141.46]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1A9231201A9; Thu, 28 Jan 2021 10:09:22 -0500 (EST) In-Reply-To: <871re5vh7a.fsf@ultra.enzu.ru> (Ahmed Khanzada's message of "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:198795 Archived-At: > Starting program: /home/enzuru/src/emacs/src/bootstrap-emacs > > Breakpoint 1, hash_string (ptr=0x47fa34d596 "DndProtocol", len=11) at > fns.c:4602 > 4602 EMACS_UINT const *p = (EMACS_UINT const *) ptr; > (gdb) info args > ptr = 0x47fa34d596 "DndProtocol" > len = 11 > (gdb) next > 4603 EMACS_UINT const *end = (EMACS_UINT const *) (ptr + len); > (gdb) next > 4604 EMACS_UINT hash = len; > (gdb) next > 4607 ptrdiff_t step = 1 + ((end - p) >> 3); > (gdb) next > 4611 while (p <= end - 1) > (gdb) next > 4613 EMACS_UINT c = *p; > (gdb) next > > Program received signal SIGBUS, Bus error. Hmm... so it's doing a dereference at address 0x47fa34d596 and getting a bus error? I have two questions here: - I'd guess that the bus error is due to alignment restrictions. What hardware is this running on? Last I checked, the computer architecture community had agreed (many years ago already) that (except for very small CPUs maybe, those not able to run Emacs) it's better to have the hardware support unaligned memory accesses (it took more time to get there than the consensus on branch delay slots, admittedly), so I'd be curious if there is still moderately recent hardware that insists on signaling an error. - AFAICT from the backtrace, `ptr` points to a plain normal ELisp string's content, yet these are supposed to be aligned, so what's going on here (this question is not directed at you ;-) Stefan