Skip to content

Commit

Permalink
Guard direct memory writes during closing to avoid SEGV
Browse files Browse the repository at this point in the history
Fixes ChronicleEnterprise/Chronicle-Map-Enterprise#73
  • Loading branch information
alamar committed Oct 12, 2021
1 parent 1dfde0f commit 0a8e703
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,11 @@ public final void checkKey(final Object key) {
}
}

public void throwExceptionIfClosing() throws IllegalStateException {
if (this.isClosing())
throw new ChronicleHashClosedException(this.getClass().getName() + " closing", Jvm.getValue(this, "closedHere"));
}

@Override
public void throwExceptionIfClosed() throws IllegalStateException {
if (this.isClosed())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public byte identifier() {

@Override
public ModificationIterator acquireModificationIterator(final byte remoteIdentifier) {
throwExceptionIfClosed();
throwExceptionIfClosing();

ModificationIterator modificationIterator = modificationIterators.get(remoteIdentifier);
if (modificationIterator != null)
Expand Down

0 comments on commit 0a8e703

Please sign in to comment.