You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug#27675005 NDB::DROPEVENTOPERATION() CAUSED CRASH, - GCC CODE GEN. BUG?
When Ndb::DropEventOperation() decided to clean up any pending event,
it failed to correctly clear the 'tail' pointer to the list of 'Gci_ops'
being deleted and discarded. Thus the 'tail' pointer refers a deleted
Gci_ops object.
Later arriving Gci_ops may then be inserted as 'next' Gci_ops
to this deleted object, causing memory corription and other havoc.
Root cause is that we explicitely called the EventBufData_list d'tor
from NdbEventBuffer::free_list() as a convinient way of releasing any
Gci_op / Gci_ops in the 'list'. This d'tor also updated the head and
tail pointer of the list as each contained element is deleted.
However, with the (new) 'dead storage elimination'-optimization
introduced in gcc 6.0, the updated 'head' and 'tail' in the destructed
'list' is not considered persistent after the destruction, thus
the code is eliminated by the optimizer.
This patch replace the explicit call to the d'tor by calling the
new method ::delete_gci_ops(). This methods essentially does the
same as the d'tor, which now is also changed to call this method.
Not calling the d'tor, disalowes the compiler to do dse-optimization
of the cleared head / tail pointer, which removes the root cause.
Also introduce a Gci_ops d'tor which takes over delete[] of
Gci_op contained within it. This replace part of the
'delete' code from delete_next_gci_ops()
(cherry picked from commit f22bdc5f0be4145f352527c7b4124a6d434a4678)
0 commit comments