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

cpu/native: fix race in thread_yield_higher() [backport 2019.01] #10921

Commits on Feb 1, 2019

  1. cpu/native: fix race condition in thread_yield_higher()

    Error case:
    1. thread_yield_higher() stores the thread's ucontext
    2. creates an "isr ucontext" for isr_thread_yield, switches to it
    
    Case 1: no signals are pending, continues in isr_thread_yield()
    3a. sched_run is called
    4a. return to sched_active_thread ucontext
    
    Case 2: signals pending (the crashing scenario), continues in native_irq_handler()
    3b. handles signals
    4b. if sched_context_switch_request is set, call sched_run
    5b. return to sched_active_thread ucontext
    
    4b misses the call to sched_run(), leading to a possible return into a
    non-ready thread.
    
    (cherry picked from commit 62bb4cc)
    kaspar030 authored and miri64 committed Feb 1, 2019
    Configuration menu
    Copy the full SHA
    84a5c4f View commit details
    Browse the repository at this point in the history
  2. core/msg: add assert for problem identified in RIOT-OS#10881

    (cherry picked from commit 82b2362)
    kaspar030 authored and miri64 committed Feb 1, 2019
    Configuration menu
    Copy the full SHA
    b3ede8d View commit details
    Browse the repository at this point in the history