unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ahmed Khanzada <me@enzu.ru>, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 46111@debbugs.gnu.org
Subject: bug#46111: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking
Date: Thu, 28 Jan 2021 15:58:09 +0200	[thread overview]
Message-ID: <837dnxyxhq.fsf@gnu.org> (raw)
In-Reply-To: <871re5vh7a.fsf@ultra.enzu.ru> (message from Ahmed Khanzada on Wed, 27 Jan 2021 20:06:01 -0800)

> From: Ahmed Khanzada <me@enzu.ru>
> Cc: 
> Date: Wed, 27 Jan 2021 20:06:01 -0800
> 
> Eli Zaretskii <eliz@gnu.org> 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.





  reply	other threads:[~2021-01-28 13:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26  6:37 bug#46111: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking Ahmed Khanzada
2021-01-26  6:57 ` Ahmed Khanzada
2021-01-26 11:15   ` Eli Zaretskii
2021-01-28  4:06     ` Ahmed Khanzada
2021-01-28 13:58       ` Eli Zaretskii [this message]
2021-01-28 15:09       ` Stefan Monnier
2021-01-28 15:19         ` Eli Zaretskii
2021-01-28 15:44           ` Stefan Monnier
2021-01-28 15:52             ` Stefan Monnier
2021-01-28 16:17               ` Stefan Monnier
2021-01-28 16:22                 ` Andreas Schwab
2021-01-28 17:22                 ` Eli Zaretskii
2021-01-28 17:30                   ` Stefan Monnier
2021-01-28 16:04             ` Andreas Schwab
2021-01-28 16:14               ` Stefan Monnier
2021-01-26  9:36 ` Philipp Stephani
2021-01-26 11:12   ` Eli Zaretskii
2021-01-26 11:17     ` Andreas Schwab
2021-01-26 11:43       ` Eli Zaretskii
2021-01-26 11:49         ` Andreas Schwab
2021-01-26 15:36           ` Eli Zaretskii
2021-01-27  7:42       ` Richard Stallman
2021-01-27  8:24         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837dnxyxhq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=46111@debbugs.gnu.org \
    --cc=me@enzu.ru \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).