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

feat: add ability to dump extism kernel memory and generate coredumps, cleanup kernel memory layout #539

Merged
merged 12 commits into from
Oct 25, 2023

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Oct 24, 2023

Fixes #537

  • Requires wasmtime 14.0.0 or greater for coredump serialization
  • Adds EXTISM_COREDUMP environment variable to write wasmtime coredump to a file when an error occurs
    • This will create a coredump from the main wasm module, which means it doesn't give us too much insight into the kernel
  • Adds EXTISM_MEMDUMP environment variable to write extism linear memory to a file when an error occurs
    • This gives us access to the kernel memory
  • Adds some missing profiling options
  • Converts timeouts to a Trap instead of a plain error, this helps us get better information about where the timeout occured
  • Some small improvements to error handling after a plugin call
  • Adds a test for coredump and memdump generation
  • Adds the ability to configure debug options using PluginBuilder
  • Fixes memory layout and a wasted page of memory in the kernel, found while debugging a memory dump

bhelx
bhelx previously approved these changes Oct 24, 2023
Copy link
Contributor

@bhelx bhelx left a comment

Choose a reason for hiding this comment

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

This is excellent !

github-actions bot and others added 2 commits October 24, 2023 13:37
Automated PR to update `runtime/src/extism-runtime.wasm` in PR #539

Co-authored-by: zshipko <zshipko@users.noreply.github.com>
Automated PR to update `runtime/src/extism-runtime.wasm` in PR #539

Co-authored-by: zshipko <zshipko@users.noreply.github.com>
@zshipko zshipko changed the title feat: add EXTISM_COREDUMP and EXTISM_MEMDUMP feat: add ability to dump extism kernel memory and generate coredumps, cleanup kernel memory layout Oct 24, 2023
@zshipko zshipko merged commit 4bd0ed6 into main Oct 25, 2023
34 checks passed
@zshipko zshipko deleted the coredump-improve-errors branch October 25, 2023 00:31
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.

feat: Add ability to dump memory to a file when an error occurs
2 participants