public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Nat! <nat@mulle-kybernetik.com>
To: libc-help@sourceware.org
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: Re: Problem with atexit and _dl_fini
Date: Mon, 10 Jun 2019 13:08:00 -0000	[thread overview]
Message-ID: <9497a5c2-0dc8-18fe-6120-deb551f7ddd8@mulle-kybernetik.com> (raw)
In-Reply-To: <cd53d1e5-530c-b327-9e79-69b02c3b701e@linaro.org>


On 10.06.19 13:48, Adhemerval Zanella wrote:
>
> On 09/06/2019 17:59, Nat! wrote:
>> Another datapoint to support my claim that _dl-fini breaks atexit. This time its very easy to reproduce ;)
>>
>> Here 's the README.md from the Github Repo https://github.com/mulle-nat/atexit-breakage-linux
>>
>>
>> ```
>>
>> # Shows another breakage involving `atexit` on linux
>>
>> Here the `atexit` callback is invoked mistakenly multiple times.
> This 'example' does not really show the issue because ldd script issues
> the loader multiple times, see below. You can check exactly what ldd is
> doing by calling with sh -x.

I agree it doesn't show the same issue, but it shows that something else 
is going very wrong. :) Or are you happy, that atexit is called multiple 
times ? Who's calling exit here anyway ? Check out the debugger output 
too (see updated README.md)


>
> I will try to use your instruction to run on docker to see what exactly
> is happening in your environment.

That's not necessary anymore. I managed to make it reproducible in a 
much simpler form just now.

The ld-so-breakage project is basically a recreation of the original 
"docker" scenario written from scratch. I try to explain in the README , 
what is going on. But if there are questions hit me up (maybe as an 
issue ?) :

     https://github.com/mulle-nat/ld-so-breakage


The "another datapoint" project shows how constructor/destructor don't 
pair up:

     https://github.com/mulle-nat/atexit-breakage-linux


And as a random bonus this project indicates to me that LD_PRELOAD 
doesn't do what its supposed to either:

     https://github.com/mulle-nat/LD_PRELOAD-breakage-linux


In total I think the state of affairs is pretty dismal. I didn't expect 
that much basic stuff not working on linux. With hindsight, I probably 
have wasted _weeks_ on these problems.

I still maintain that the concept to let `atexit` callbacks not run by 
`exit` is broken. An `atexit` callback is not the same as an 
`__attribute__((destructor))__`.


Ciao

    Nat!


  reply	other threads:[~2019-06-10 13:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-18 21:23 Nat!
2019-05-19 16:23 ` Florian Weimer
2019-05-19 19:37   ` Nat!
2019-05-21 20:43     ` Adhemerval Zanella
2019-05-22 10:22       ` Nat!
2019-05-22 15:01         ` Adhemerval Zanella
2019-05-22 15:29           ` Nat!
2019-05-22 19:35             ` Adhemerval Zanella
2019-05-29 21:16               ` Nat!
2019-06-09 20:59     ` Nat!
2019-06-10 11:48       ` Adhemerval Zanella
2019-06-10 13:08         ` Nat! [this message]
2019-06-10 20:27           ` Adhemerval Zanella
2019-06-11 18:39             ` Adhemerval Zanella
2019-06-11 20:20               ` Nat!
2019-06-11 22:40                 ` Nat!
2019-06-12  3:41                   ` Carlos O'Donell
2019-06-13 22:53                   ` Nat!
2019-06-14 12:29                     ` Manfred
2019-06-14 15:14                     ` Adhemerval Zanella
2019-06-11 18:53             ` Nat!

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

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

  git send-email \
    --in-reply-to=9497a5c2-0dc8-18fe-6120-deb551f7ddd8@mulle-kybernetik.com \
    --to=nat@mulle-kybernetik.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-help@sourceware.org \
    /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.
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).