Stream: git-wasmtime

Topic: wasmtime / issue #3118 Debug info are no longer valid aft...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2021 at 08:36):

shingfeel opened issue #3118:

I use nginx to process http requests. and load wasm file, set "wasmtime_config_debug_info_set" flag, compile modules and link modules in main process. Then fork and call wasm func in child process.
When i use a debugger: gdb -p [pid] to attach to child process and want to beak point in wasm function. It failed with:"Function "xxxxxx" not defined"。It seem's debuger can't find debug_info in child process.
I wonder why debuger work fine in main process and don't work in child process?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2021 at 18:57):

alexcrichton commented on issue #3118:

Wasmtime manually has to tell GDB about code that we've generated (along with debuginfo), but maybe GDB doesn't preserve this information across forks? Wasmtime doesn't do anything after a fork to re-inform GDB about dynamically generated code.

My guess is that GDB "forgets" about dynamically loaded code after a fork and we'd have to re-inform it of code, but that's just a hunch and I don't actually know how gdb works in this regard.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 29 2021 at 03:14):

shingfeel commented on issue #3118:

thank @alexcrichton for your answer.

It seems GDB really "forgets" to dynamically loaded code after fork. in my code, recompile wasm module after fork and GDB now working correctly.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 29 2021 at 03:14):

shingfeel closed issue #3118:

I use nginx to process http requests. and load wasm file, set "wasmtime_config_debug_info_set" flag, compile modules and link modules in main process. Then fork and call wasm func in child process.
When i use a debugger: gdb -p [pid] to attach to child process and want to beak point in wasm function. It failed with:"Function "xxxxxx" not defined"。It seem's debuger can't find debug_info in child process.
I wonder why debuger work fine in main process and don't work in child process?


Last updated: Nov 22 2024 at 17:03 UTC