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

docs(EXC-1744): Document canister backtraces #5185

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adambratschikaye
Copy link
Contributor

@adambratschikaye adambratschikaye commented Feb 12, 2025

EXC-1744: https://dfinity.atlassian.net/browse/EXC-1744

Thank you for your contribution to the IC Developer Portal. This repo contains the content for https://internetcomputer.org and the ICP Developer Documentation, https://internetcomputer.org/docs/.

If you are submitting a Pull Request for adding or changing content on the ICP Developer Documentation, please make sure that your contribution meets the following requirements:

@adambratschikaye adambratschikaye requested a review from a team as a code owner February 12, 2025 09:32
Comment on lines -16 to +17
docs/developer-docssmart-contracts/advanced-features/simd.mdx @dfinity/execution
docs/developer-docssmart-contracts/advanced-features/periodic-tasks.mdx @dfinity/execution
docs/developer-docs/smart-contracts/advanced-features/simd.mdx @dfinity/execution
docs/developer-docs/smart-contracts/advanced-features/periodic-tasks.mdx @dfinity/execution
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated change, just fixing a typo.

@github-actions github-actions bot added the documentation Changes to Developer Docs label Feb 12, 2025
Copy link

github-actions bot commented Feb 12, 2025

🤖 Here's your preview: https://hjalc-kqaaa-aaaam-abagq-cai.icp0.io


<MarkdownChipRow labels={["Intermediate", "Tutorial", "Motoko", "Rust"]} />

## Intro
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
## Intro


## Intro

Are you developing a Rust or Motoko <GlossaryTooltip>canister</GlossaryTooltip> encountering a confusing trap? Backtraces may help you pinpoint the location of the error. When canisters trap, ICP reports backtraces which contain the names of functions in the call stack. For example, if the following Rust canister accidentally performs an out of bounds access of stable memory:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Are you developing a Rust or Motoko <GlossaryTooltip>canister</GlossaryTooltip> encountering a confusing trap? Backtraces may help you pinpoint the location of the error. When canisters trap, ICP reports backtraces which contain the names of functions in the call stack. For example, if the following Rust canister accidentally performs an out of bounds access of stable memory:
When canisters trap, ICP reports backtraces that contain the names of functions in the call stack. Backtraces are added to the canister logs and if the caller has [access to canister logs](/docs/current/developer-docs/smart-contracts/maintain/logs#log-visibility) they will also be included in the message error response.
For example, if the following Rust canister accidentally performs an out of bounds access of stable memory:

}
```

then the resulting stable memory out of bounds error will also contain the following backtrace which can help determine that the error is in `inner_2` which is reached via `outer` and `inner`:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
then the resulting stable memory out of bounds error will also contain the following backtrace which can help determine that the error is in `inner_2` which is reached via `outer` and `inner`:
The resulting stable memory out of bounds error will also contain the following backtrace which can help determine that the error is in `inner_2` which is reached via `outer` and `inner`:

_wasm_backtrace_canister::outer
```

## Where to find backtraces
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
## Where to find backtraces


## Where to find backtraces

Backtraces are added to the canister logs and if the caller has [access to canister logs](/docs/current/developer-docs/smart-contracts/maintain/logs#log-visibility) they will also be included in the message error response.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Backtraces are added to the canister logs and if the caller has [access to canister logs](/docs/current/developer-docs/smart-contracts/maintain/logs#log-visibility) they will also be included in the message error response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes to Developer Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants