nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.24k stars 29.41k forks source link

postject sometimes cannot inject the SEA blob on Windows, resulting in flaky test #49630

Open joyeecheung opened 1 year ago

joyeecheung commented 1 year ago

Refs: https://github.com/nodejs/reliability/issues/663

And from a recent run that includes https://github.com/nodejs/node/pull/49543 https://ci.nodejs.org/job/node-test-binary-windows-js-suites/23086/RUN_SUBSET=1,nodes=win2016-COMPILED_BY-vs2022-x86/console

14:07:48     Start injection of NODE_SEA_BLOB in C:\workspace\node-test-binary-windows-js-suites\node\test\.tmp.944\sea.exe...
14:07:48     Error: Aborted(). Build with -sASSERTIONS for more info.

It looks like sometimes postject is unable to inject the blob? cc @RaisinTen

RaisinTen commented 1 year ago

My Windows setup is not working right now. I can try to take a look in a couple of days.

joyeecheung commented 1 year ago

It can also fail on Linux during loading, I suspect we need https://chromium-review.googlesource.com/c/v8/v8/+/4608330 to fix it, but that seems separate from the postject failure on Windows

joyeecheung commented 1 year ago

Not sure why but this has stopped showing up in the CI..

richardlau commented 1 year ago

Showed up in https://ci.nodejs.org/job/node-test-binary-windows-js-suites/23422/RUN_SUBSET=2,nodes=win2016-COMPILED_BY-vs2022-x86/

anonrig commented 1 year ago

Showed up in https://ci.nodejs.org/job/node-test-binary-windows-js-suites/23881/

joyeecheung commented 11 months ago

I am not sure why they are still showing up in reliability reports after https://github.com/nodejs/node/pull/50223 but they are still flaky, and it appears that other SEA tests are flaky too probably due to the same reason https://github.com/nodejs/reliability/issues/718 - SIGSEGV when executing the SEA, on RHEL, Windows and macOS. Maybe we should open a separate issue because the original issue happened during injection.

joyeecheung commented 7 months ago

This also shows up for the asset test on Windows: https://ci.nodejs.org/job/node-test-binary-windows-js-suites/26136/RUN_SUBSET=2,nodes=win2016-COMPILED_BY-vs2022-x86/console. I suspect that postject may have trouble injecting slightly bigger files under certain circumstances.

14:23:39     Start injection of NODE_SEA_BLOB in C:\workspace\node-test-binary-windows-js-suites\node\test\.tmp.960\sea.exe...
14:23:39     Error: Aborted(). Build with -sASSERTIONS for more info.

We could probably investigate building it with ASSERTIONS.

joyeecheung commented 7 months ago

I wonder if we just skip the test if any of the following failed:

  1. Copy
  2. Inject
  3. Code sign

In those cases, the failures are unlikely to be fixable by Node.js core anyway...though it might still be useful to know when it fails 100% which indicates that something is wrong with our workflow. Not sure how we can know that in single tests though.