GNU bug report logs - #41242
Port feature/native-comp to Windows

Previous Next

Package: emacs;

Reported by: Nicolas Bértolo <nicolasbertolo <at> gmail.com>

Date: Wed, 13 May 2020 19:28:01 UTC

Severity: wishlist

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nicolas Bértolo <nicolasbertolo <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 41242 <at> debbugs.gnu.org
Subject: bug#41242: Port feature/native-comp to Windows - Determine the emacs root dir...
Date: Sat, 30 May 2020 13:25:48 -0300
[Message part 1 (text/plain, inline)]
> I guess this should then go into master right?  Probably also others
> likes to review it, in case should not be discussed in this thread.

Ok, later I will open a bug report about it.

> - We can't use "gensym" for register_native_comp_unit() because the dynamic
>   library may not have been loaded yet when loading a dump file.

> The code LGTM, I just think instead of make_fixum you could use make_int
> to have some more room (not sure how much is realistic this scenario but
> comes for free).

See new attached patch.

> I'll look into.

Thanks.

> I think this issue deserves to be precisely understood.

I was not even close. The code crashes when iterating over the
`all_loaded_comp_units_h` weak hash table. We get a SIGSEGV when iterating over
a native compilation unit that has already been swept by the GC. For some
reason the hash table does not get updated. Maybe the code I used to iterate
over the hash table is not ok for weak hash tables?

=============
  struct Lisp_Hash_Table *h = XHASH_TABLE (all_loaded_comp_units_h);

  for (ptrdiff_t i = 0; i < HASH_TABLE_SIZE (h); ++i)
    {
      Lisp_Object k = HASH_KEY (h, i);
      if (!EQ (k, Qunbound))
        {
          Lisp_Object val = HASH_VALUE (h, i);
          struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (val);
          dispose_comp_unit (cu, false);
        }
    }
=============

Thanks, Nico.
[0001-Do-not-call-gensym-too-early-when-loading-a-dump-fil.patch (application/octet-stream, attachment)]

This bug report was last modified 5 years and 42 days ago.

Previous Next


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