Skip to content

Fix possible IndexOutOfBoundsException in MarkFile constructor which creates the parent directory#337

Merged
vyazelenko merged 1 commit into
aeron-io:masterfrom
wojciech-adaptive:mark-file-ioobe
Jun 26, 2025
Merged

Fix possible IndexOutOfBoundsException in MarkFile constructor which creates the parent directory#337
vyazelenko merged 1 commit into
aeron-io:masterfrom
wojciech-adaptive:mark-file-ioobe

Conversation

@wojciech-adaptive
Copy link
Copy Markdown
Contributor

java.lang.IndexOutOfBoundsException: index=16 length=8 capacity=16
	at org.agrona.AbstractMutableDirectBuffer.boundsCheck0(AbstractMutableDirectBuffer.java:1732)
	at org.agrona.concurrent.UnsafeBuffer.getLongVolatile(UnsafeBuffer.java:382)
	at org.agrona.MarkFile.isActive(MarkFile.java:713)
	at org.agrona.MarkFile.ensureDirectoryExists(MarkFile.java:424)
	at org.agrona.MarkFile.<init>(MarkFile.java:92)

ensureDirectoryExists maps a subregion of the mark file, so we need to change absolute offsets into relative ones.

…creates the parent directory.

java.lang.IndexOutOfBoundsException: index=16 length=8 capacity=16
	at org.agrona.AbstractMutableDirectBuffer.boundsCheck0(AbstractMutableDirectBuffer.java:1732)
	at org.agrona.concurrent.UnsafeBuffer.getLongVolatile(UnsafeBuffer.java:382)
	at org.agrona.MarkFile.isActive(MarkFile.java:713)
	at org.agrona.MarkFile.ensureDirectoryExists(MarkFile.java:424)
	at org.agrona.MarkFile.<init>(MarkFile.java:92)

ensureDirectoryExists maps a subregion of the mark file,
so we need to change absolute offsets into relative ones.
@vyazelenko vyazelenko merged commit c006bc9 into aeron-io:master Jun 26, 2025
24 checks passed
@wojciech-adaptive wojciech-adaptive deleted the mark-file-ioobe branch June 26, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants