Index | Thread | Search

From:
Alexander Bluhm <bluhm@openbsd.org>
Subject:
Re: ld.so not calling destructor
To:
ASOU Masato <takeasou.masato@gmail.com>
Cc:
tech@openbsd.org, Philip Guenther <guenther@openbsd.org>
Date:
Thu, 13 Feb 2025 10:13:14 +0100

Download raw body.

Thread
On Thu, Feb 13, 2025 at 04:25:07PM +0900, ASOU Masato wrote:
> On Wed, Feb 12, 2025 at 9:56???PM Alexander Bluhm <alexander.bluhm@gmx.net> wrote:
> >
> > On Fri, Jan 17, 2025 at 02:24:12PM +0900, ASOU Masato wrote:
> > > On Fri, Jan 17, 2025 at 2:19???PM ASOU Masato <takeasou.masato@gmail.com> wrote:
> > > > I applied your patch and following diff:
> >
> > With a slightly different patch for ld.so, only run-regress-prog1
> > of regress is failing.  I moved down the call to _dl_unlink_children()
> > a bit.  Also with this fix, a workaround a patch for llvm-openmp
> > can be removed.  It seems that the callbacks are called in the right
> > order now.
> >
> > Nevertheless, the failing regress looks relevant regarding ordering
> > of destructors and needs more thoughts.
> >
> > bluhm
> 
> Maybe I found the cause of this problem.  I think it's a problem with
> the `next' and `prev' opelations below:
> 
> struct elf_object {
> </snip>
>         struct elf_object *next;
>         struct elf_object *prev;
> 
> Please give me some more time.

Take your time.  I am very happy that you are helping.

Note that I have removed patch-runtime_src_kmp_runtime_cpp from
llvm-openmp port that deals with the wrong callback order.  I think
it was only necessary because I messed up the ordering in my first
ld.so diff.  If we need it in the end, we can put it back.

bluhm