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

deps: update to uvwasi 0.0.5 #31432

Closed
wants to merge 5 commits into from
Closed

deps: update to uvwasi 0.0.5 #31432

wants to merge 5 commits into from

Commits on Jan 23, 2020

  1. deps: update to uvwasi 0.0.5

    This version improves file descriptor renumbering, and as a result
    fixes uvwasi_fd_renumber().
    cjihrig committed Jan 23, 2020
    Configuration menu
    Copy the full SHA
    978f477 View commit details
    Browse the repository at this point in the history
  2. deps: uvwasi: cherry-pick ea73af5

    Original commit message:
    
        unlock all fd mutexes in reverse order
    
        Some functions acquire mutexes for multiple file descriptors.
        This commit ensures that the mutexes are released in the
        reverse order that they are aquired.
    cjihrig committed Jan 23, 2020
    Configuration menu
    Copy the full SHA
    6ec9a92 View commit details
    Browse the repository at this point in the history
  3. deps: uvwasi: cherry-pick c3bef8e

    Original commit message:
        prevent locking fd table while holding a mutex
    
        uvwasi_path_rename(), uvwasi_path_link(),
        uvwasi_path_open(), and uvwasi_fd_renumber() operate
        on multiple file descriptors. uvwasi_fd_renumber() has
        been updated prior to this commit, and is not relevant
        here. The other three functions would perform the
        following locking operations:
    
        - lock the file table
        - acquire a file descriptor mutex
        - unlock the file table
        - unlock the file table again
        - acquire another file descriptor mutex
        - unlock the file table
        - unlock the two mutexes
    
        Attempting to acquire the second mutex introduced
        the possibility of deadlock because another thread
        could attempt to acquire the first mutex while
        holding the file table lock.
    
        This commit ensures that multiple mutexes are either:
        - acquired in a single lock of the file table
        - or, only acquired after releasing previously held mutexes
    
        Fixes: nodejs/uvwasi#89
    cjihrig committed Jan 23, 2020
    Configuration menu
    Copy the full SHA
    0d0c835 View commit details
    Browse the repository at this point in the history
  4. deps: uvwasi: cherry-pick eea4508

    Original commit message:
    
        prevent race conditions with uvwasi_fd_close()
    
        uvwasi_fd_close() performed the following operations:
    
        - lock the file descriptor mutex
        - close the file
        - release the file descriptor mutex
        - call the file table's remove() function
    
        Once the fd's mutex is released, another thread could
        acquire it before the fd is removed from the file
        table. If this happens, remove() could destroy a held
        mutex.
    
        This commit updates uvwasi_fd_close() to perform the
        entire sequence while holding the file table's lock,
        preventing new acquisitions of the fd's mutex.
    
        Fixes: nodejs/uvwasi#88
    cjihrig committed Jan 23, 2020
    Configuration menu
    Copy the full SHA
    2fe7459 View commit details
    Browse the repository at this point in the history
  5. test: add wasi test for freopen()

    This test provides missing coverage for __wasi_fd_renumber().
    cjihrig committed Jan 23, 2020
    Configuration menu
    Copy the full SHA
    1dc6d2f View commit details
    Browse the repository at this point in the history