Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1193290f3f3ae6a0845b47ba082dc85eb48d6d44
Choose a base ref
...
head repository: nodejs/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5f104e3218f7b71f6fa9ba3b98a272843685568c
Choose a head ref
  • 8 commits
  • 17 files changed
  • 6 contributors

Commits on Mar 30, 2022

  1. node-api: force env shutdown deferring behavior

    The finalizer normally never gets called while a reference is strong.
    However, during environment shutdown all finalizers must get called. In
    order to unify the deferring behavior with that of a regular
    finalization, we must force the reference to be weak when we call its
    finalizer during environment shutdown.
    
    Fixes: #37236
    Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
    PR-URL: #37303
    Backport-PR-URL: #42512
    Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
    Reviewed-By: Michael Dawson <midawson@redhat.com>
    2 people authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    171bb66 View commit details
    Browse the repository at this point in the history
  2. node-api: stop ref gc during environment teardown

    A gc may happen during environment teardown. Thus, during finalization
    initiated by environment teardown we must remove the V8 finalizer
    before calling the Node-API finalizer.
    
    Fixes: #37236
    PR-URL: #37616
    Backport-PR-URL: #42512
    Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
    Reviewed-By: Michael Dawson <midawson@redhat.com>
    gabrielschulhof authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    a2f4206 View commit details
    Browse the repository at this point in the history
  3. node-api: fix crash in finalization

    Refs: nodejs/node-addon-api#906
    Refs: #37616
    
    Fix crash introduced by #37616
    
    Signed-off-by: Michael Dawson <mdawson@devrus.com>
    
    PR-URL: #37876
    Backport-PR-URL: #42512
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    mhdawson authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    2aa9ca1 View commit details
    Browse the repository at this point in the history
  4. node-api: make reference weak parameter an indirect link to references

    As the cancellation of second pass callbacks are not reachable from the
    current v8 API, and the second pass callbacks are scheduled with
    NodePlatform's task runner, we have to ensure that the weak parameter
    holds indirect access to the v8impl::Reference object so that the object
    can be destroyed on addon env teardown before the whole node env is able
    to shutdown.
    
    PR-URL: #38000
    Backport-PR-URL: #42512
    Reviewed-By: Michael Dawson <midawson@redhat.com>
    Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
    legendecas authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    81b4dc8 View commit details
    Browse the repository at this point in the history
  5. src: fix finalization crash

    PR-URL: #38250
    Backport-PR-URL: #42512
    Fixes: #38040
    Reviewed-By: Beth Griggs <bgriggs@redhat.com>
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    jasnell authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    e707514 View commit details
    Browse the repository at this point in the history
  6. node-api: fix shutdown crashes

    Refs: nodejs/node-addon-api#906
    
    Ensure that finalization is not defered during shutdown.
    The env for the addon is deleted immediately after
    iterating the list of finalizers to be run. Defering
    causes crashes as the finalization uses the already
    deleted env.
    
    Signed-off-by: Michael Dawson <mdawson@devrus.com>
    
    PR-URL: #38492
    Backport-PR-URL: #42512
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
    Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
    mhdawson authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    a7224c9 View commit details
    Browse the repository at this point in the history
  7. node-api: avoid SecondPassCallback crash

    PR #38000 added
    indirection so that we could stop finalization in
    cases where it had been scheduled in a second
    pass callback but we were doing it in advance in
    environment teardown.
    
    Unforunately we missed that the code which tries
    to clear the second pass parameter checked if
    the pointer to the parameter (_secondPassParameter)
    was nullptr and that when the second pass callback
    was scheduled we set _secondPassParameter to nullptr
    in order to avoid it being deleted outside of the second
    pass callback. The net result was that we
    would not clear the _secondPassParameter contents
    and failed to avoid the Finalization in the second pass
    callback.
    
    This PR adds an additional boolean for deciding if
    the secondPassParameter should be deleted outside
    of the second pass callback instead of setting
    secondPassParameter to nullptr thus avoiding the
    conflict between the 2 ways it was being used.
    
    See the discussion starting at:
    #38273 (comment)
    for how this was discovered on OSX while trying to
    upgrade to a new V8 version.
    
    Signed-off-by: Michael Dawson <mdawson@devrus.com>
    
    PR-URL: #38899
    Backport-PR-URL: #42512
    Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    mhdawson authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    e23c04f View commit details
    Browse the repository at this point in the history
  8. node-api: cctest on v8impl::Reference

    PR-URL: #38970
    Backport-PR-URL: #42512
    Reviewed-By: Michael Dawson <midawson@redhat.com>
    Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
    legendecas authored and richardlau committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    5f104e3 View commit details
    Browse the repository at this point in the history
Loading