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

test(CALL): zero size, huge return at offset, huge call data offset, huge return data offset #1448

Open
wants to merge 20 commits into
base: arith-dev
Choose a base branch
from

Conversation

lorenzogentile404
Copy link
Collaborator

No description provided.

@lorenzogentile404 lorenzogentile404 linked an issue Oct 22, 2024 that may be closed by this pull request
@OlivierBBB
Copy link
Collaborator

OlivierBBB commented Oct 22, 2024

This, or something related, should be blowing up in the first of the tests, the one about zeroSizeHugeReturnAtOffset

public static MemorySpan returnDataRequestedSegment(final MessageFrame frame) {
switch (OpCode.of(frame.getCurrentOperation().getOpcode())) {
case CALL, CALLCODE -> {
long offset = Words.clampedToLong(frame.getStackItem(5));
long length = Words.clampedToLong(frame.getStackItem(6));
return MemorySpan.fromStartLength(offset, length);
}
case DELEGATECALL, STATICCALL -> {
long offset = Words.clampedToLong(frame.getStackItem(4));
long length = Words.clampedToLong(frame.getStackItem(5));
return MemorySpan.fromStartLength(offset, length);
}
default -> throw new IllegalArgumentException(
"returnDataRequestedSegment called outside of a *CALL");
}
}

@letypequividelespoubelles @lorenzogentile404

Comment on lines 189 to 192
System.out.println("callDataOffset: " + callDataOffset);
System.out.println("callDataSize: " + callDataSize);
System.out.println("returnAtOffset: " + returnAtOffset);
System.out.println("returnDataSize: " + returnAtCapacity);
Copy link
Collaborator

@OlivierBBB OlivierBBB Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Comment on lines 176 to 179
System.out.println("callDataOffset: " + callDataOffset);
System.out.println("callDataSize: " + callDataSize);
System.out.println("returnAtOffset: " + returnAtOffset);
System.out.println("returnAtCapacity: " + returnAtCapacity);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't explain the HUB tracing not blowing up 🤔.

@OlivierBBB
Copy link
Collaborator

@lorenzogentile404 We also need simple unit tests that trigger this behaviour.

@lorenzogentile404 lorenzogentile404 changed the title 1444 failing tests for testmxprandomadvanced test(CALL): zero size, huge return at offset and huge return data offset Nov 28, 2024
@lorenzogentile404
Copy link
Collaborator Author

At this point, the purpose of this PR is just adding some tests as described in the title. Fixed to MXP tests have been already merged into arith-dev by @DavePearce.

@lorenzogentile404 lorenzogentile404 changed the title test(CALL): zero size, huge return at offset and huge return data offset test(CALL): zero size, huge return at offset, huge call data offset, huge return data offset Nov 28, 2024
@lorenzogentile404 lorenzogentile404 enabled auto-merge (squash) December 11, 2024 14:27
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.

Failing Tests for testMxpRandomAdvanced()
3 participants