Skip to content

Conversation

@xujuntwt95329
Copy link
Collaborator

And fix a double free issue when starting debug server failed

may cause exception thrown. */
if ((func = wasm_runtime_lookup_wasi_start_function(module_inst))) {
#if WASM_ENABLE_DEBUG_INTERP != 0
wasm_runtime_start_debug_instance(exec_env);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should check the return value?

Copy link
Contributor

Choose a reason for hiding this comment

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

And after the following wasm_runtime_call_wasm, shall we destroy the debug instance?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This API return the actual bind port number, or 0 if the debug instance not created. We don't check the return value here, because when user execute iwasm w/o -g={ip}:{port}, the API will return 0, but we still want the program to be executed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And after the following wasm_runtime_call_wasm, shall we destroy the debug instance?

We don't need to destroy the debug instance, it will be automatically destroyed when the corresponding cluster is destroyed.

}

#if WASM_ENABLE_DEBUG_INTERP != 0
wasm_runtime_start_debug_instance(exec_env);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@wenyongh wenyongh merged commit 68fd645 into bytecodealliance:main Jan 26, 2022
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
And fix a double free issue when starting debug server failed
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