Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-11 Thread RazvanN via Digitalmars-d-learn
On Thursday, 10 January 2019 at 23:04:37 UTC, Steven Schveighoffer wrote: On 1/10/19 5:12 PM, RazvanN wrote: On Thursday, 10 January 2019 at 15:04:25 UTC, Steven Schveighoffer wrote: On 1/8/19 7:54 AM, RazvanN wrote: [...] That is a thread-local static destructor. Are any shared static dest

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/10/19 5:12 PM, RazvanN wrote: On Thursday, 10 January 2019 at 15:04:25 UTC, Steven Schveighoffer wrote: On 1/8/19 7:54 AM, RazvanN wrote: [...] That is a thread-local static destructor. Are any shared static destructors accessing the array? No, there aren't. Indeed, the problem is as

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread RazvanN via Digitalmars-d-learn
On Thursday, 10 January 2019 at 15:04:25 UTC, Steven Schveighoffer wrote: On 1/8/19 7:54 AM, RazvanN wrote: [...] That is a thread-local static destructor. Are any shared static destructors accessing the array? No, there aren't. Indeed, the problem is as Johan as said: the loadedDSOs shoul

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/8/19 7:54 AM, RazvanN wrote: Hi all, I am working on issue 14650 [1] and I would like to implement a solution where static destructors are destroying global variables. However, I have the following problem in druntime/src/rt/sections_elf_shared: struct ThreadDSO {     DSO* _pdso;    

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-10 Thread RazvanN via Digitalmars-d-learn
On Tuesday, 8 January 2019 at 14:30:24 UTC, Johan Engelen wrote: On Tuesday, 8 January 2019 at 12:54:11 UTC, RazvanN wrote: [...] Great! (I am _extremely_ surprised that dtors are not called for globals.) [...] Thanks! This is really helpful! RazvanN

Re: Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-08 Thread Johan Engelen via Digitalmars-d-learn
On Tuesday, 8 January 2019 at 12:54:11 UTC, RazvanN wrote: Hi all, I am working on issue 14650 [1] Great! (I am _extremely_ surprised that dtors are not called for globals.) and I would like to implement a solution where static destructors are destroying global variables. However, I have t

Segfault when adding a static destructor in druntime/src/rt/sections_elf_shared.d

2019-01-08 Thread RazvanN via Digitalmars-d-learn
Hi all, I am working on issue 14650 [1] and I would like to implement a solution where static destructors are destroying global variables. However, I have the following problem in druntime/src/rt/sections_elf_shared: struct ThreadDSO { DSO* _pdso; static if (_pdso.sizeof == 8) uint _