Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v6.24] Cling: prevent double release of Transactions #153

Commits on Mar 31, 2021

  1. [cling] Fix alignment of Transaction allocation:

    new of a char array might not have the correct alignment to hold a Transaction.
    Allocate a Transaction itself directly, instead of in-place constructing it in
    the character array.
    
    Each Transaction in the pool is thus constructed through `new Transaction(S)`
    and destructed through `delete T`, which is nicely symmetrical. The use of
    `::operator new` and `::operator delete` isn't actually necessary.
    
    While I'm at it, improve the assert message's wording.
    Axel-Naumann committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    a9a5c80 View commit details
    Browse the repository at this point in the history
  2. [cling] Move PushTransactionRAII out of Interpreter:

    This will allow Transaction remembering its RAII to not depend on Interpreter.
    Axel-Naumann committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    b9fd635 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c229ee9 View commit details
    Browse the repository at this point in the history
  4. [cling] Transaction needs to know its RAII:

    This will allow the Intrepreter to prevent unload() on
    Transactions held by RAIIs.
    Axel-Naumann committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    f71aae8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9328faf View commit details
    Browse the repository at this point in the history
  6. [cling] Prevent double delete / double TransactionPool-ing:

    When a Transaction is unloaded for which *also* a ScopedTransactionRAII
    is waiting, the latter will potentially access a deleted Transaction.
    It can be deleted due to the Pool being full. Even if it is not deleted
    (as is the case in root-project#7657 )
    it will get pushed into the Pool once by unload() and a second time by
    the RAII!
    
    The two options to track this case were full-blown ref counting or noting
    that a Transaction is attached to an RAII scope. If that is the case,
    freeing the Transaction must be skipped, as the RAII will take care of it.
    Axel-Naumann committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    f27d942 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    574e88c View commit details
    Browse the repository at this point in the history
  8. [cling] Assert released transaction is != last in pool:

    a cheap way to notice what went wrong in root-project#7657.
    Axel-Naumann committed Mar 31, 2021
    Configuration menu
    Copy the full SHA
    1847b1d View commit details
    Browse the repository at this point in the history