Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
This repository was 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

Description

@igchor

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.

Activity

  1. lukaszstolarczuk commented on Jul 7, 2020

    @lukaszstolarczuk
    Member

    ref. #723 (support for no_abort)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions