Re: Counting static __cxa_atexit calls

2022-08-24 Thread Michael Matz via Gcc
Hello, On Wed, 24 Aug 2022, Florian Weimer wrote: > > On Wed, 24 Aug 2022, Florian Weimer wrote: > > > >> > Isn't this merely moving the failure point from exception-at-ctor to > >> > dlopen-fails? > >> > >> Yes, and that is a soft error that can be handled (likewise for > >> pthread_create).

Re: Counting static __cxa_atexit calls

2022-08-24 Thread Florian Weimer via Gcc
* Michael Matz: > Hello, > > On Wed, 24 Aug 2022, Florian Weimer wrote: > >> > Isn't this merely moving the failure point from exception-at-ctor to >> > dlopen-fails? >> >> Yes, and that is a soft error that can be handled (likewise for >> pthread_create). > > Makes sense. Though that actually

Re: Counting static __cxa_atexit calls

2022-08-24 Thread Michael Matz via Gcc
Hello, On Wed, 24 Aug 2022, Florian Weimer wrote: > > Isn't this merely moving the failure point from exception-at-ctor to > > dlopen-fails? > > Yes, and that is a soft error that can be handled (likewise for > pthread_create). Makes sense. Though that actually hints at a design problem with

Re: Counting static __cxa_atexit calls

2022-08-24 Thread Florian Weimer via Gcc
* Michael Matz: > Hello, > > On Tue, 23 Aug 2022, Florian Weimer via Gcc wrote: > >> We currently have a latent bug in glibc where C++ constructor calls can >> fail if they have static or thread storage duration and a non-trivial >> destructor. The reason is that __cxa_atexit (and >>

Re: Counting static __cxa_atexit calls

2022-08-23 Thread Michael Matz via Gcc
Hello, On Tue, 23 Aug 2022, Florian Weimer via Gcc wrote: > We currently have a latent bug in glibc where C++ constructor calls can > fail if they have static or thread storage duration and a non-trivial > destructor. The reason is that __cxa_atexit (and > __cxa_thread_atexit_impl) may have to

Re: Counting static __cxa_atexit calls

2022-08-23 Thread Nick Clifton via Gcc
Hi Florian, What would be the most ELF-flavored way to implement this? After the final link, I expect that the count (or counts, we need a separate counter for thread-local storage) would show up under a new dynamic tag in the dynamic segment. This is actually a very good fit because older

Counting static __cxa_atexit calls

2022-08-23 Thread Florian Weimer via Gcc
We currently have a latent bug in glibc where C++ constructor calls can fail if they have static or thread storage duration and a non-trivial destructor. The reason is that __cxa_atexit (and __cxa_thread_atexit_impl) may have to allocate memory. We can avoid that if we know how many such static