-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
n-api: investigate breakage #12279
n-api: investigate breakage #12279
Conversation
The failed test 332 is:
which is unrelated to |
(closed by accident) |
CI: https://ci.nodejs.org/job/node-test-pull-request/7275/ |
It does seem to be that commit/PR. Here is another run on current master: https://ci.nodejs.org/job/node-test-binary-windows/7558/ I wonder if something got changed after CI was run in that PR. |
I'd like to see which combination of value/constructor causes the |
Yaaaaay! It seems I can reproduce the problem locally - albeit on a super-slow Windows VM 🎉 |
Sure enough, if I comment out the line that actually caches |
Added a bunch of printfs, and I'm |
I'm able to repro on my machine. send me your current diff, I believe my round trip will be much shorter. |
@refack Thanks! |
Wow! It looks like the persistent works if I keep retrieving the symbol, even if I don't use the freshly retrieved value. Now I'm confused. |
My latest suspicion: https://github.com/nodejs/node/blob/master/src/node_api.cc#L2188 In these two places we do |
... and the second place is that runs most often, because we will have the symbol cached after the first time every time. Running my slow turnaround now. |
I'm surprised that using an uninitialized variable in an if-statement hasn't generated a warning. |
Would a macro like this: #define NAPI_CALL(theCall) \
do { \
napi_status status = theCall; \
if (status != napi_ok) return status; \
} while(0) get optimized down to what we have now without a perf hit? If so, I will replace all this status retrieval and checking. |
Initialize status to napi_generic_failure and only check it after having made an actual N-API call. This fixes up 8fbace1.
e7a7a5c
to
8db5a0b
Compare
Made obsolete by #12283 |
Initialize status to napi_generic_failure and only check it after having made an actual N-API call. This fixes up 8fbace1. PR-URL: #12283 Ref: #12279 Reviewed-By: Refael Ackermann <[email protected]>
Initialize status to napi_generic_failure and only check it after having made an actual N-API call. This fixes up 8fbace1. PR-URL: nodejs#12283 Ref: nodejs#12279 Reviewed-By: Refael Ackermann <[email protected]>
Initialize status to napi_generic_failure and only check it after having made an actual N-API call. This fixes up 8fbace1. Backport-PR-URL: #19447 PR-URL: #12283 Ref: #12279 Reviewed-By: Refael Ackermann <[email protected]>
Check to see If this will turn the CI green, that will mean that #12240 breaks on windowsNow the suspect is lines L2186-L2187 in node_api.cc 8fbace1/#12246.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
n-api,test