GNU bug report logs - #68690
Segmentation fault building with native-comp

Previous Next

Package: emacs;

Reported by: john muhl <jm <at> pub.pink>

Date: Wed, 24 Jan 2024 16:44:02 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 68690 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: eliz <at> gnu.org, jm <at> pub.pink, 68690 <at> debbugs.gnu.org
Subject: Re: bug#68690: Segmentation fault building with native-comp
Date: Thu, 25 Jan 2024 10:58:03 -0500
>> I wonder if a puthash while being in a DOHASH (which is the ASAN failure
>> I showed) is something we should pursue. I don't think that's something
>> that's guaranteed to work in a meaningful way. WDYT?

The original DOHASH's comment indeed said it didn't support that
operation, yet the code used DOHASH to implement `maphash`, which *does*
support such operations, and it used DOHASH in places which perform such
operations, so I think it's clear we do want to support `puthash` there.

> BTW, I'm using the code below for CL packages, which have a hash table.
> A bit less hideous ;-)

Nice.

The motivation for the change from `DOHASH (h, i)` to `DOHASH (h, k, v)`
was not only to offer cleaner code but also to avoid reloading
`h->key_and_value` and `h->table_size` at every iteration
(`h->key_and_value` is particularly annoying because it's on the
critical path to load `key` and `value`).


        Stefan





This bug report was last modified 1 year and 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.