Skip to content

Fix thread_profile_frames crashing due to uninitialized PC #14311

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Aug 23, 2025

ZJIT leaves cfp->pc uninitialized in many instances, and the conditions
in thread_profile_frames() was outdated, leading sampling profilers to
crash.

Check cfp->pc for validity in a way that works for both YJIT and ZJIT.

Copy link

launchable-app bot commented Aug 23, 2025

Tests Failed

✖️1 test failed ✔️29114 tests passed

25/73 test sessions failed

❌ Test session #4893222 failedos:macos-14 workflow:macOS test_opts:--repeat-count:2 test_task:test-alldetails on CI
🔔 1 issue ✖️1 test failed ✔️28789 tests passed

❌ Test session #4893223 failedos:macos-14 workflow:macOS test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️27833 tests passed

❌ Test session #4893226 failedos:macos-14 workflow:macOS test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28808 tests passed

❌ Test session #4893229 failedos:macos-15 workflow:macOS test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28755 tests passed

❌ Test session #4893232 failedos:macos-14 ![workflow:YJIT macOS Arm64](https://img.shields.io/badge/workflow-YJIT macOS Arm64-blue.svg) test_opts:--enable-yjit test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28796 tests passed

❌ Test session #4893235 failedos:macos-14 workflow:macOS test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28774 tests passed

❌ Test session #4893238 failedos:macos-14 ![workflow:YJIT macOS Arm64](https://img.shields.io/badge/workflow-YJIT macOS Arm64-blue.svg) test_opts:--enable-yjit:dev test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️27910 tests passed

❌ Test session #4893241 failedos:macos-latest workflow:ModGC test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28755 tests passed

❌ Test session #4893244 failedos:ubuntu-24.04-arm workflow:Ubuntu test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28857 tests passed

❌ Test session #4893247 failedos:ubuntu-22.04 ![workflow:YJIT Ubuntu](https://img.shields.io/badge/workflow-YJIT Ubuntu-blue.svg) test_opts:--enable-yjit:dev test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28884 tests passed

❌ Test session #4893250 failedos:ubuntu-latest workflow:ModGC test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28813 tests passed

❌ Test session #4893251 failedos:ubuntu-22.04 workflow:Ubuntu test_opts:cppflags:-DVM_CHECK_MODE test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28862 tests passed

❌ Test session #4893253 failedos:ubuntu-22.04 workflow:Ubuntu test_opts:--enable-shared--enable-load-relative test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28811 tests passed

❌ Test session #4893257 failedos:ubuntu-22.04 ![workflow:YJIT Ubuntu](https://img.shields.io/badge/workflow-YJIT Ubuntu-blue.svg) test_opts:--enable-yjit:dev test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28887 tests passed

❌ Test session #4893258 failedos:ubuntu-22.04 workflow:Ubuntu test_opts:--disable-yjit test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️27724 tests passed

❌ Test session #4893265 failedos:ubuntu-24.04 workflow:Ubuntu test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️27943 tests passed

❌ Test session #4893268 failedos:ubuntu-22.04 ![workflow:YJIT Ubuntu](https://img.shields.io/badge/workflow-YJIT Ubuntu-blue.svg) test_opts:RUSTC:'rustc+1.58.0' test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28802 tests passed

❌ Test session #4893271 failedos:macos-latest workflow:ModGC test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28724 tests passed

❌ Test session #4893274 failedos:ubuntu-latest workflow:ModGC test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28749 tests passed

❌ Test session #4893277 failedos:macos-14 workflow:macOS test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28774 tests passed

❌ Test session #4893280 failedos:ubuntu-22.04 workflow:Ubuntu test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️27729 tests passed

❌ Test session #4893283 failedos:macos-13 workflow:macOS test_opts: test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28807 tests passed

❌ Test session #4893286 failedos:windows-2022 workflow:Windows test_opts:none test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28451 tests passed

❌ Test session #4893289 failedos:windows-2022 workflow:MinGW test_opts:none test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28461 tests passed

❌ Test session #4893292 failedos:windows-2025 workflow:Windows test_opts:none test_task:checkdetails on CI
🔔 1 issue ✖️1 test failed ✔️28433 tests passed

ZJIT leaves cfp->pc uninitialized in many instances, and the conditions
in thread_profile_frames() was outdated, leading sampling profilers to
crash.

Make sure to always pass a valid PC.
@XrXr XrXr force-pushed the fix-profiler-assumption branch from e2389db to 9d24c11 Compare August 23, 2025 02:55
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.

1 participant