Skip to content

Conversation

cgswords
Copy link
Contributor

@cgswords cgswords commented Feb 1, 2025

Description

This sets limits for arenas and the string interner, producing errors if allocation fails.

Test plan

All tests still pass


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@cgswords cgswords requested a review from tzakian February 1, 2025 00:00
Copy link

vercel bot commented Feb 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 5, 2025 3:54am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 3:54am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 3:54am

@cgswords cgswords temporarily deployed to sui-typescript-aws-kms-test-env February 1, 2025 00:01 — with GitHub Actions Inactive
@cgswords cgswords force-pushed the cgswords/vm_pointer_singatures branch from 9730949 to 87b80cc Compare February 1, 2025 00:07
Copy link
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

Overall looks good, although I'm worried there might be a possible leak in alloc_slice

Comment on lines 55 to 59
std::ptr::copy_nonoverlapping(items.as_ptr(), mut_ptr, len);
}

// Prevent the original vector from dropping its data
std::mem::forget(items);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right to me. Since we're copying the elements of items over and then the std::mem::forget on items will leak them. I think this should be an explicit drop no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed -- see the follow-on PR.

@cgswords
Copy link
Contributor Author

cgswords commented Feb 5, 2025

There does appear to be a possible memory leak. I have updated bumpalo and reverted the change in this PR. There will be a new PR that does things appropriately.

@cgswords cgswords force-pushed the cgswords/vm_arena_limits branch from ca7cf22 to dbcd7d5 Compare February 5, 2025 03:53
@cgswords cgswords temporarily deployed to sui-typescript-aws-kms-test-env February 5, 2025 03:53 — with GitHub Actions Inactive
@cgswords cgswords changed the base branch from cgswords/vm_pointer_singatures to cgsworsd/vm_rewrite_jit_opt February 5, 2025 03:54
@cgswords cgswords merged commit 6af05ef into cgsworsd/vm_rewrite_jit_opt Feb 5, 2025
29 of 50 checks passed
@cgswords cgswords deleted the cgswords/vm_arena_limits branch February 5, 2025 03:55
cgswords added a commit that referenced this pull request Feb 5, 2025
…interner (#21050)

## Description 

This sets limits for arenas and the string interner, producing errors if allocation fails.

## Test plan 

All tests still pass

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
cgswords added a commit that referenced this pull request Feb 5, 2025
)

This sets limits for arenas and the string interner, producing errors if allocation fails.

All tests still pass

---

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] gRPC:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
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