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

Fix #337, fix memory corruption produced by misplaced memset() #338

Merged
merged 1 commit into from
Feb 25, 2020

Commits on Jan 2, 2020

  1. Fix nasa#337: fix memory corruption produced by misplaced memset()

    Calling memset too late after assigning the `sem` variable in the code of
    `OS_BinSemCreate_Impl` caused the data pointed to by `sem` to get corrupted.
    
    The issue was not caught by the existing test suite for POSIX OSAL when running
    on Linux. However running the test suite on macOS revealed the anomalies
    in the behavior of `pthread_cond_destroy()` which was working on the corrupted
    memory as was demonstrated in:
    
    Calling pthread_cond_destroy results in “Function not implemented” ENOSYS on macOS,
    https://stackoverflow.com/questions/59560940/calling-pthread-cond-destroy-results-in-function-not-implemented-enosys-on-mac?noredirect=1#comment105301077_59560940
    
    The original commit that introduced the issue is:
    
    nasa@bfa7a33
    stanislaw committed Jan 2, 2020
    Configuration menu
    Copy the full SHA
    fe93928 View commit details
    Browse the repository at this point in the history