https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101692

--- Comment #3 from Eugene Zhiganov <zed at lab127 dot karelia.ru> ---
I have reorginized my data - now references to EventSource class
and it's derivatives (timers, sockets, signals) are stored
in explicitly named data members of other classes.

That did not help, still crashes.

Then I added destructor for EventSource class to see,
if it is called or not. And it is...

sample output of a program...
-------------------------------------
'RX-0 @ IDLE' got 'M1' from 'CLIENT-2'
rx.RxSm.rxIdleM1 : fd = 12
'RX-0' registered 12 (esrc.Io)

!!! esrc.EventSource.~this() : esrc.ClientSocket // call of the destructor
!!! esrc.EventSource.~this() : esrc.Timer        // call of the destructor

'RX-0 @ IDLE' got 'M0' from 'SELF'
'RX-0' enabled 12 (esrc.Io, oneshot)
ecap.EventQueue.wait, n = 1, event @ 7FFE506B486C
ecap.EventQueue.wait, n = 1, event @ 7FFE506B486C, event source @ 7FB726991F40
Segmentation fault (core dumped)
------------------------------------

So now I understand, why the crash is happening -
an object reference, obtained from epoll_wait()
is invalid, because the object was already removed by GC.

But I do not understand, why GC destructs these objects...

Reply via email to