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

Fix watchpoint segfault when using debug interpreter without server #1806

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

cimacmillan
Copy link
Contributor

@cimacmillan cimacmillan commented Dec 12, 2022

Summary

In a previous PR I had introduced memory watchpoint support. This adds two linked lists containing watchpoint locations that are checked on variable reads/writes. However, there is an edge-case where one could be using the WASM_ENABLE_DEBUG_INTERP, but not within a debugging instance.

In this, the interpreter attempts to read the debugging instance lists which are not initialised. This results in a segmentation fault in bh_list_first_elem

This change checks whether the interpreter is running within a debugging instance. If not, it assigns the list pointers to null and bh_list_first_elem handles this gracefully

@cimacmillan
Copy link
Contributor Author

@wenyongh @lum1n0us Can we either include this in the WAMR 1.1.2 release, or omit the previous PR from the release until this is merged? #1762

@cimacmillan cimacmillan force-pushed the cmmacmil/watchpoint_fix branch from be45fb7 to e8fc477 Compare December 12, 2022 16:14
@wenyongh
Copy link
Contributor

@wenyongh @lum1n0us Can we either include this in the WAMR 1.1.2 release, or omit the previous PR from the release until this is merged? #1762

Sure, let's merge this PR before release 1.1.2.

@wenyongh wenyongh merged commit ca0b5cf into bytecodealliance:main Dec 13, 2022
wenyongh pushed a commit to wenyongh/wasm-micro-runtime that referenced this pull request Dec 14, 2022
@wenyongh
Copy link
Contributor

@cimacmillan, @loganek The WAMR-1.1.2 was created:
https://github.com/bytecodealliance/wasm-micro-runtime/releases/tag/WAMR-1.1.2

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