Skip to content

Conversation

@prabakaranklst
Copy link
Contributor

@prabakaranklst prabakaranklst commented Dec 10, 2025

Parent Task-->spwans -----------> Task-A
           -->join_all
                                  Waker Data ptr ------> Task-B (External task, different type)
                                                         Waker Data ptr ----------------------------------> Parent Task

For the above scenario with safety worker enabled in runtime, after polling of Task-A which return error, it is detected as safety error and a safety waker is created from normal waker and wake() function is called. In the wake function, the waker data ptr is typecasted as (parent) task and further try to clone. But, there is no valid pointer in the task vtable for clone() and it results in segmentation fault.

As fix, a thread local safety error flag is set instead of creating safety waker. When the wake function is called, it goes through Task-B and then our wake() function is executed. In this wake(), the safety error flag is checked and the task is scheduled on either safety or normal worker.

Notes for Reviewer

Pre-Review Checklist for the PR Author

  • PR title is short, expressive and meaningful
  • Commits are properly organized
  • Relevant issues are linked in the References section
  • Tests are conducted
  • Unit tests are added

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  • All open points are addressed and tracked via issues

References

Closes #18

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: a814506e-47a8-4e29-b6fc-0246048530f6
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'rust_qnx8_toolchain+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-eQOopREOYCL5vtTb6c1cwZrql4GVrJ1FqgxarQRe1xs="
DEBUG: Repository rust_qnx8_toolchain+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.7.1, but got bazel_skylib@1.8.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_rust', the root module requires module version rules_rust@0.61.0, but got rules_rust@0.67.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.2.14 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.0.3, but got aspect_rules_lint@1.5.3 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'buildifier_prebuilt', the root module requires module version buildifier_prebuilt@7.3.1, but got buildifier_prebuilt@8.2.0.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_process', the root module requires module version score_process@1.2.1, but got score_process@1.3.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'googletest', the root module requires module version googletest@1.14.0, but got googletest@1.14.0.bcr.1 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_crates', the root module requires module version score_crates@0.0.5, but got score_crates@0.0.6 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (53 packages loaded, 10 targets configured)

Analyzing: target //:license-check (143 packages loaded, 1974 targets configured)

Analyzing: target //:license-check (154 packages loaded, 7069 targets configured)

INFO: Analyzed target //:license-check (157 packages loaded, 9085 targets configured).
[1 / 1] no actions running
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 209 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 24.491s, Critical Path: 0.41s
INFO: 14 processes: 5 disk cache hit, 9 internal.
INFO: Build completed successfully, 14 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link

The created documentation from the pull request is available at: docu-html

@prabakaranklst prabakaranklst force-pushed the prabakaran_fix_crash_due_to_safety_tasks branch from 383e198 to 2d1640f Compare December 10, 2025 14:09
@prabakaranklst prabakaranklst force-pushed the prabakaran_fix_crash_due_to_safety_tasks branch 2 times, most recently from 09a7db9 to 75b4719 Compare December 17, 2025 12:18
@pawelrutkaq pawelrutkaq force-pushed the prabakaran_fix_crash_due_to_safety_tasks branch from 75b4719 to 792e4e7 Compare December 18, 2025 09:50
@prabakaranklst prabakaranklst force-pushed the prabakaran_fix_crash_due_to_safety_tasks branch from 792e4e7 to 8d8d7b1 Compare December 23, 2025 08:42
@prabakaranklst prabakaranklst force-pushed the prabakaran_fix_crash_due_to_safety_tasks branch from 8d8d7b1 to d14d4e5 Compare December 23, 2025 09:28
@prabakaranklst prabakaranklst force-pushed the prabakaran_fix_crash_due_to_safety_tasks branch from d14d4e5 to c3b2561 Compare December 23, 2025 09:29
Fixed bugs related to handling and scheduling safety task.
eclipse-score#18
eclipse-score#20
eclipse-score#39
@prabakaranklst prabakaranklst force-pushed the prabakaran_fix_crash_due_to_safety_tasks branch from c3b2561 to 3e7796d Compare December 23, 2025 09:49
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.

Bug: Crash after queuing 30 tasks for the safety worker

2 participants