Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Problem with calling tx_free() when transaction is already aborted #516

Closed
igchor opened this issue Nov 4, 2019 · 1 comment · Fixed by #932
Closed

Problem with calling tx_free() when transaction is already aborted #516

igchor opened this issue Nov 4, 2019 · 1 comment · Fixed by #932
Assignees
Labels
Priority: 1 showstopper Type: Bug Something isn't working Type: Feature New feature or request

Comments

@igchor
Copy link
Contributor

igchor commented Nov 4, 2019

Problem

In some cases, when we have complex object which holds several other objects (which allocate some memory) we can end up calling tx_free() inside of aborted transaction which will crash the application.

For example, if inside of a constructor of top level object we are constructing it's sub elements and construction of nth sub element fails (for example, because of out-of-memory), destructors of all already constructed objects will be called. If inside of those destructors we call free, application will crash.

This problem occurs for example inside segment_vector.

Solution

One solution would be to use no_abort flag for transactions. An abort would be done only in the outermost level. Inner transactions would not abort - only propagate appropriate exceptions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Priority: 1 showstopper Type: Bug Something isn't working Type: Feature New feature or request
Projects
None yet
3 participants