Skip to content
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

fork: fix return value not being set in child #627

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

Conversation

badochov
Copy link
Contributor

@badochov badochov commented Nov 28, 2024

Fixes a return value not being set in child during fork on ARM(7a,8r) and SPARC.

The problem was caused by threads_setupUserValue using current thread stack to obtain context, while in fork we return using parents stack.

JIRA: RTOS-979

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: ia32, zynq-qemu

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

proc/process.c Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Nov 28, 2024

Unit Test Results

7 958 tests  ±0   7 416 ✅ ±0   40m 35s ⏱️ +30s
  470 suites ±0     542 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 9f9bd46. ± Comparison against base commit 07519a2.

♻️ This comment has been updated with latest results.

@badochov badochov force-pushed the badochov/fork branch 2 times, most recently from ce17193 to 5b85b47 Compare November 28, 2024 15:22
@badochov badochov marked this pull request as ready for review November 28, 2024 15:26
@badochov badochov force-pushed the badochov/fork branch 2 times, most recently from f7d3ef0 to 5035acc Compare November 28, 2024 15:56
syscalls.c Show resolved Hide resolved
@badochov badochov force-pushed the badochov/fork branch 9 times, most recently from e61a857 to 85f9607 Compare November 29, 2024 12:45
hal/armv7a/_interrupts.S Outdated Show resolved Hide resolved
hal/armv8r/_interrupts.S Outdated Show resolved Hide resolved
hal/sparcv8leon/_traps.S Outdated Show resolved Hide resolved
Due to exiting on different stack than current's thread in fork in child
the return value was not set by threads_setupUserReturn.

JIRA: RTOS-979
Copy link
Member

@lukileczo lukileczo left a comment

Choose a reason for hiding this comment

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

LGTM

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