Skip to content

Fix issues related to frame symbolization and add support for older V8 engines. #633

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tsint
Copy link
Contributor

@tsint tsint commented Jul 18, 2025

Add support for frame symbolization in V8 engine's trusted sandbox mode, as well as compatibility with older versions of the V8 engine.
The frame symbolization issue under V8 engine's trusted sandbox mode can be verified by profiling the node inside the docker of langgenius/dify-web:1.4.0.
The log for frame symbolization failure looks like this: Bytecode positions: 0 bytes: 0xbf8965c1140 instance is 0xd4, but expected [0xba].

@tsint tsint requested review from a team as code owners July 18, 2025 10:06
@korniltsev
Copy link
Contributor

Would you like to add a coredump test for a sandboxed v8 process to avoid regressions in the future?

@tsint
Copy link
Contributor Author

tsint commented Jul 18, 2025

coredump test

Okay, I'll look into how to add a coredump test.

@tsint
Copy link
Contributor Author

tsint commented Jul 20, 2025

Would you like to add a coredump test for a sandboxed v8 process to avoid regressions in the future?

I looked into it, and this part of the unwind instructions comes from anonymously loaded executable code in memory (JIT/AOT compiled), so it's not possible to construct a coredump test for it.

@fabled
Copy link
Contributor

fabled commented Jul 21, 2025

I looked into it, and this part of the unwind instructions comes from anonymously loaded executable code in memory (JIT/AOT compiled), so it's not possible to construct a coredump test for it.

Anonymous pages are included in coredump. We have multiple such test cases. You can use e.g. tools/coredump utility to generate the test cases from a running process.

@tsint
Copy link
Contributor Author

tsint commented Jul 21, 2025

I looked into it, and this part of the unwind instructions comes from anonymously loaded executable code in memory (JIT/AOT compiled), so it's not possible to construct a coredump test for it.

Anonymous pages are included in coredump. We have multiple such test cases. You can use e.g. tools/coredump utility to generate the test cases from a running process.

I'm not sure how you did it. coredump new -pid essentially just calls gcore {pid} to generate a core file, which can't stop precisely at the desired address to generate the expected core file.

Even if I attach to the target process using gdb -pid, stop at a specific breakpoint (after heavily modifying the ebpf-profiler to get the offset of a anonymous page), and generate a core file, then use coredump new -core to create a testcase, many frames still show up as <unwinding aborted due to error native_no_pid_page_mapping>, making it impossible to get the desired testcase.

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.

3 participants