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

wasmedge-quickjs cross-canister call memory leaks should be fixed #2319

Open
Tracked by #2396
lastmjs opened this issue Dec 12, 2024 · 0 comments
Open
Tracked by #2396

wasmedge-quickjs cross-canister call memory leaks should be fixed #2319

lastmjs opened this issue Dec 12, 2024 · 0 comments
Milestone

Comments

@lastmjs
Copy link
Member

lastmjs commented Dec 12, 2024

In the stable version of Azle we have addressed a major memory leak with cross canister calls by cleaning up the global resolve and reject callbacks in a destructor in the on cleanup from ICP after every cross-canister call. We should apply these fixes to the experimental version of Azle as well.

Here's an example of an error found during fuzz testing that I believe was caused in part by this:

- [ ] fixed

canister: async_await functional

This is a similar error to the first one above...I wonder if they are the same error? This one looks easier to debug, so I say fix this one first.

```bash
  requestId: ArrayBuffer {
    [Uint8Contents]: <fc 7d 64 75 2f b9 db 6a dc 50 cb a4 a4 ee 84 70 80 cf e9 e0 24 38 64 15 6c 46 a4 7a 56 84 80 d5>,
    byteLength: 32
  },
  response: {
    ok: true,
    status: 200,
    statusText: 'OK',
    body: { status: 'replied', certificate: [Uint8Array] },
    headers: [ [Array], [Array], [Array], [Array] ]
  },
  reject_code: 5,
  reject_message: 'Error from Canister bkyz2-fmaaa-aaaaa-qaaaq-cai: Canister called `ic0.trap` with message: Panic occurred: already borrowed: BorrowMutError at src/build/experimental/commands/compile/wasm_binary/rust/experimental_canister_template/src/ic/call_raw.rs:46.\n' +
    'Consider gracefully handling failures from this canister or altering the canister to handle exceptions. See documentation: http://internetcomputer.org/docs/current/references/execution-errors#trapped-explicitly',
  error_code: 'IC0503'
}
@lastmjs lastmjs added this to the 1.0 milestone Dec 12, 2024
@lastmjs lastmjs mentioned this issue Dec 12, 2024
5 tasks
@lastmjs lastmjs mentioned this issue Dec 30, 2024
76 tasks
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

No branches or pull requests

1 participant