Subject: Re: bug#46256: [feature/native-comp] AOT eln files ignored if run from build tree

From: Pip Cet <[email-masked]>
Date: Mon, 8 Mar 2021 13:52:49 +0000

On Mon, Mar 8, 2021 at 1:26 PM Eli Zaretskii <[email-masked]> wrote:
> > From: Pip Cet <[email-masked]>
> > Date: Sun, 7 Mar 2021 22:16:58 +0000
> > Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
> > > If the CU was GC'ed the eln should have been dlclosed.
> >
> > Wait, I thought this was on Windows?
>
> Yes, and...?

No dlclose() on Windows. FreeLibrary() is documented to behave
differently from dlclose(), and I don't have a Windows system to test
whether it's actually different in practice.

> > > If that's the
> > > case at the next load we should get a fresh handle
> >
> > You're assuming
> > 1. FreeLibrary() succeeded
> > 2. The module's refcount was 1
> > 3. The module wasn't pinned.
> >
> > If any of these assumptions is violated, the behavior would be
> > precisely as observed.
>
> Why would any of the above assumptions be violated?

I have several suspicions, including "because the second compilation
unit referring to the same handle hasn't been collected". Because that
is definitely a bug, and one we should fix, and then we can debug this
issue more if and when it reappears.

Pip