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

addons/openssl-binding/test very flaky on ARM #30786

Open
rvagg opened this issue Dec 4, 2019 · 33 comments
Open

addons/openssl-binding/test very flaky on ARM #30786

rvagg opened this issue Dec 4, 2019 · 33 comments
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI. flaky-test Issues and PRs related to the tests with unstable failures on the CI.
Milestone

Comments

@rvagg
Copy link
Member

rvagg commented Dec 4, 2019

(Edit: see comment below for recommendations if you are running into related problems on your ARMv7 platforms)

arm-fanned has been offline for quite some time now since they've needed some heavy work, nodejs/build#1840

but I'm bringing them back online now, and it seems that at least one thing has crept in while it was offline. addons/openssl-binding/test is flaky on the Pi 3's. So far I've only seen it fail there but it could be elsewhere too, there haven't been enough runs to be sure.

Error output (@guybedford's run just now) from https://ci.nodejs.org/job/node-test-binary-arm-12+/2928/

Error in out/Release/node': corrupted double-linked list: 0x045ed160`

/cc @addaleax and @danbev since e66a2ac looks like a possible candidate.

@rvagg rvagg added build Issues and PRs related to build files or the CI. arm Issues and PRs related to the ARM platform. flaky-test Issues and PRs related to the tests with unstable failures on the CI. labels Dec 4, 2019
@addaleax
Copy link
Member

addaleax commented Dec 4, 2019

@rvagg Is there anything in particular that makes you suspect that commit?

@addaleax
Copy link
Member

addaleax commented Dec 4, 2019

valgrind doesn’t report anything suspicious for me.

Can you maybe point me to a host where this reproduces consistently on which I could debug?

@rvagg
Copy link
Member Author

rvagg commented Dec 6, 2019

@addaleax a very rough guess points me to that commit. arm-fanned has been offline since about July so I was looking at the history of openssl-binding during that time and that's it: https://github.com/nodejs/node/commits/master/test/addons/openssl-binding

Of course it could be elsewhere, or in OpenSSL itself. I'll try and get you instructions for getting in and reproducing but it's a pretty complicated setup for both getting in and running stuff, so give me some time to sort that out. It will probably be made easier when you have nodejs/build onboarding and have your .ssh/config setup properly from Ansible so you have ip addresses, ssh keys and jump hosts all configured for you.

@richardlau
Copy link
Member

Opened a PR to mark the test flaky for now: #30838

richardlau added a commit that referenced this issue Dec 7, 2019
PR-URL: #30838
Refs: #30786
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
targos pushed a commit that referenced this issue Dec 9, 2019
PR-URL: #30838
Refs: #30786
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
@addaleax

This comment has been minimized.

@addaleax
Copy link
Member

It seems like, in some way, the buffer->GetBackingStore() call in the addon is problematic; the addon crashes when the rest of the function is commented out, but doesn’t crash when that line is also commented out.

I’m still trying to find out more, but sadly my ability to read ARM assembly isn’t close to where it’s for x86/x64, so it might take a while (esp. given that re-compiling Node.js isn’t practical on the CI machines on which we run the tests).

@addaleax
Copy link
Member

addaleax commented Dec 24, 2019

We build the Node.js binary for arm-fanned CI with -march=armv7-a, but not the addons. Apparently, for std::shared_ptr these two options are ABI-incompatible (I’m assuming they use different kinds of atomics/locks depending on whether the flag is set, but I haven’t dug in that far). I don’t know what this looks like in the release CI.

I think this means we either have to find a way to hide this implementation detail – and that may be somewhat costly – or we have to pick one ABI, either -march=armv7-a or not, and then stick with that. Choosing to always enable the flag would imply dropping armv6 support entirely, instead of it being experimental, I think.

@nodejs/build @nodejs/platform-arm

@addaleax addaleax added this to the 14.0.0 milestone Dec 26, 2019
targos pushed a commit that referenced this issue Jan 14, 2020
PR-URL: #30838
Refs: #30786
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
@mscdex
Copy link
Contributor

mscdex commented Feb 3, 2020

FWIW I'm still seeing this addon test failure in CI, despite the commit to mark it as flaky having landed awhile back.

@richardlau
Copy link
Member

FWIW I'm still seeing this addon test failure in CI, despite the commit to mark it as flaky having landed awhile back.

@mscdex That job did mark the openssl-binding test as flaky (notice https://ci.nodejs.org/job/node-test-binary-arm-12+/4122/RUN_SUBSET=addons,label=pi2-docker/ is yellow and not red).

The job was failed because these subjobs hit an NFS issue:
https://ci.nodejs.org/job/node-test-binary-arm-12+/4122/RUN_SUBSET=0,label=pi2-docker/console
https://ci.nodejs.org/job/node-test-binary-arm-12+/4122/RUN_SUBSET=0,label=pi3-docker/console
https://ci.nodejs.org/job/node-test-binary-arm-12+/4122/RUN_SUBSET=3,label=pi3-docker/console

20:18:22 + git clean -fdx
20:18:26 warning: failed to remove out/Release/.nfs00000000002ca76a00000793: Device or resource busy
20:18:26 Removing out/junit

@rvagg
Copy link
Member Author

rvagg commented Feb 5, 2020

FYI looking into fixing the -march inconsistency is high(ish) on my TODO list, I don't have time right now but it's in my list at least. I don't want to block anyone else from doing it (please!), but I thought it worth flagging that this isn't being ignored.

BethGriggs pushed a commit that referenced this issue Feb 6, 2020
PR-URL: #30838
Refs: #30786
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
@mmarchini mmarchini mentioned this issue Mar 13, 2020
15 tasks
@addaleax
Copy link
Member

addaleax commented Apr 3, 2020

@rvagg @nodejs/platform-arm I’d like to see us make a decision before v14.0.0 because we’ll be stuck with that decision for the next three years.

@rvagg
Copy link
Member Author

rvagg commented Apr 3, 2020

@addaleax so do you think that it's defaulting to compiling addons targetting plain armv7? I don't even know where that would be set for addons, in gyp perhaps?

armv7-a does bring a bunch more features along with it over plain armv7: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-march-2 but it's also likely that we end up with less optimal binaries on a platform where performance is felt acutely. We've been getting away with armv7-a without too many compatibility constraints so I think it's safe to assume that most of where our binaries are run on armv7 that the CPUs are compatible at -a level.

Switching march will mean tweaking https://github.com/nodejs/build/blob/8b1f0a6d530063f0aa6b9ea6d5ff579010914e1d/ansible/roles/cross-compiler/files/cc-selector.sh to handle versioning, which probably means introducing another label in Jenkins and VersionSelectorSwitch to switch on it properly unless we're willing to force this change across all Node versions.

The corollary is that if we change addons to build with armv7-a (somehow) then that'd be a breaking change for node-gyp, and that probably wouldn't make it into 14 anyway because npm is still stuck on node-gyp 5 (while we're planning on pushing out a 7!).

I've got the Pi cluster back online, just running some tests to make sure it's solid before I re-enable it. But I don't really know how we should solve this problem.

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Apr 9, 2020
* default to `-march=armv7` and `-mfpu=neon` when targeting armv7.
  Any Cortex-A capable of running V8 supports at least that.

* remove the `--arm-fpu=...` configure option. It was added to support
  Debian's armel port (armv5, for the purpose of this discussion) but
  V8 (and therefore Node.js) dropped support for armv5 in early 2016.

* remove the `--arm-float-abi=...` configure option. There should never
  be a reason to build in soft or softp mode; armv6 is the bare minimum
  nowadays and supports VFP.

Fixes: nodejs#30786
@addaleax addaleax pinned this issue Apr 16, 2020
@rvagg
Copy link
Member Author

rvagg commented Apr 17, 2020

@bnoordhuis any chance we could slip something in before 14.x that forced -march=armv7-a when armv7 is supplied to configure? I see you have bnoordhuis@64a4910, did that work out?

@bnoordhuis
Copy link
Member

#32704 (comment) - it's causing weird floating-point stability issues that I don't quite understand.

targos added a commit to addaleax/node that referenced this issue Apr 20, 2020
BethGriggs pushed a commit that referenced this issue Apr 20, 2020
Refs: #30786

PR-URL: #32885
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
BethGriggs added a commit that referenced this issue Apr 20, 2020
- (SEMVER-MAJOR) crypto: move pbkdf2 without digest to EOL
  (James M Snell) [#31166](#31166)
- (SEMVER-MAJOR) fs: deprecate closing FileHandle on garbage collection
  (James M Snell) [#28396](#28396)
- (SEMVER-MAJOR) http: move OutboundMessage.prototype.flush to EOL
  (James M Snell) [#31164](#31164)
- (SEMVER-MAJOR) lib: move GLOBAL and root aliases to EOL
  (James M Snell) [#31167](#31167)
- (SEMVER-MAJOR) os: move tmpDir() to EOL
  (James M Snell)[#31169](#31169)
- (SEMVER-MAJOR) src: remove deprecated wasm type check
  (Clemens Backes) [#32116](#32116)
- (SEMVER-MAJOR) stream: move \_writableState.buffer to EOL
  (James M Snell) [#31165](#31165)
- (SEMVER-MINOR) doc: deprecate process.mainModule
  (Antoine du HAMEL) [#32232](#32232)
- (SEMVER-MINOR) doc: deprecate process.umask() with no arguments
  (Colin Ihrig) [#32499](#32499)

- src: migrate to new V8 ArrayBuffer API (Thang Tran)
  [#30782](#30782)

It is possible that this change will impact some native addons using
`ArrayBuffer`.

- (SEMVER-MAJOR) build: update macos deployment target to 10.13 for 14.x
  (AshCripps)[#32454](#32454)
- (SEMVER-MAJOR) doc: update cross compiler machine for Linux armv7
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: update Centos/RHEL releases use devtoolset-8
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: remove SmartOS from official binaries
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) win: block running on EOL Windows versions
  (João Reis) [#31954](#31954)

It is expected that there will be an ABI mismatch on ARM between the
Node.js binary and native addons.
- [#30786](#30786)

- (SEMVER-MAJOR) deps: update V8 to 8.1.307.20
  (Matheus Marchini) [#32116](#32116)

- cli, report: move --report-on-fatalerror to stable
  (Colin Ihrig) [#32496](#32496)
- deps: upgrade to libuv 1.37.0
  (Colin Ihrig) [#32866](#32866)
- fs: add fs/promises alias module
  (Gus Caplan) [#31553](#31553)
- module: remove experimental modules warning
  (Guy Bedford) [#31974](#31974)

PR-URL: #32181
BethGriggs added a commit that referenced this issue Apr 20, 2020
Deprecations:

- (SEMVER-MAJOR) crypto: move pbkdf2 without digest to EOL
  (James M Snell) [#31166](#31166)
- (SEMVER-MAJOR) fs: deprecate closing FileHandle on garbage collection
  (James M Snell) [#28396](#28396)
- (SEMVER-MAJOR) http: move OutboundMessage.prototype.flush to EOL
  (James M Snell) [#31164](#31164)
- (SEMVER-MAJOR) lib: move GLOBAL and root aliases to EOL
  (James M Snell) [#31167](#31167)
- (SEMVER-MAJOR) os: move tmpDir() to EOL
  (James M Snell)[#31169](#31169)
- (SEMVER-MAJOR) src: remove deprecated wasm type check
  (Clemens Backes) [#32116](#32116)
- (SEMVER-MAJOR) stream: move \_writableState.buffer to EOL
  (James M Snell) [#31165](#31165)
- (SEMVER-MINOR) doc: deprecate process.mainModule
  (Antoine du HAMEL) [#32232](#32232)
- (SEMVER-MINOR) doc: deprecate process.umask() with no arguments
  (Colin Ihrig) [#32499](#32499)

ECMAScript Modules - Experimental Warning Removal:

- module: remove experimental modules warning
  (Guy Bedford) [#31974](#31974)

In Node.js 13 we removed the need to include the --experimental-modules
flag, but when running EcmaScript Modules in Node.js, this would still
result in a warning ExperimentalWarning: The ESM module loader is
experimental.

As of Node.js 14 there is no longer this warning when using ESM in
Node.js. However, the ESM implementation in Node.js remains
experimental. As per our stability index: “The feature is not subject
to Semantic Versioning rules. Non-backward compatible changes or
removal may occur in any future release.” Users should be cautious when
using the feature in production environments.

Please keep in mind that the implementation of ESM in Node.js differs
from the developer experience you might be familiar with. Most
transpilation workflows support features such as optional file
extensions or JSON modules that the Node.js ESM implementation does not
support. It is highly likely that modules from transpiled environments
will require a certain degree of refactoring to work in Node.js. It is
worth mentioning that many of our design decisions were made with two
primary goals. Spec compliance and Web Compatibility. It is our belief
that the current implementation offers a future proof model to
authoring ESM modules that paves the path to Universal JavaScript.
Please read more in our documentation.

The ESM implementation in Node.js is still experimental but we do believe
that we are getting very close to being able to call ESM in Node.js
“stable”. Removing the warning is a huge step in that direction.

Migrate to new V8 ArrayBuffer API:

- src: migrate to new V8 ArrayBuffer API (Thang Tran)
  [#30782](#30782)

It is possible that this change will impact some native addons using
`ArrayBuffer`.

Toolchain and Compiler Upgrades:

- (SEMVER-MAJOR) build: update macos deployment target to 10.13 for 14.x
  (AshCripps)[#32454](#32454)
- (SEMVER-MAJOR) doc: update cross compiler machine for Linux armv7
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: update Centos/RHEL releases use devtoolset-8
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: remove SmartOS from official binaries
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) win: block running on EOL Windows versions
  (João Reis) [#31954](#31954)

It is expected that there will be an ABI mismatch on ARM between the
Node.js binary and native addons. Native addons are only broken if they
interact with `std::shared_ptr`. This is expected to be fixed in a
later version of Node.js 14.
- [#30786](#30786)

Update to V8 8.1:

- (SEMVER-MAJOR) deps: update V8 to 8.1.307.20
  (Matheus Marchini) [#32116](#32116)

Other Notable Changes:

- cli, report: move --report-on-fatalerror to stable
  (Colin Ihrig) [#32496](#32496)
- deps: upgrade to libuv 1.37.0
  (Colin Ihrig) [#32866](#32866)
- fs: add fs/promises alias module
  (Gus Caplan) [#31553](#31553)

PR-URL: #32181
BethGriggs added a commit that referenced this issue Apr 21, 2020
Deprecations:

- (SEMVER-MAJOR) crypto: move pbkdf2 without digest to EOL
  (James M Snell) [#31166](#31166)
- (SEMVER-MAJOR) fs: deprecate closing FileHandle on garbage collection
  (James M Snell) [#28396](#28396)
- (SEMVER-MAJOR) http: move OutboundMessage.prototype.flush to EOL
  (James M Snell) [#31164](#31164)
- (SEMVER-MAJOR) lib: move GLOBAL and root aliases to EOL
  (James M Snell) [#31167](#31167)
- (SEMVER-MAJOR) os: move tmpDir() to EOL
  (James M Snell)[#31169](#31169)
- (SEMVER-MAJOR) src: remove deprecated wasm type check
  (Clemens Backes) [#32116](#32116)
- (SEMVER-MAJOR) stream: move \_writableState.buffer to EOL
  (James M Snell) [#31165](#31165)
- (SEMVER-MINOR) doc: deprecate process.mainModule
  (Antoine du HAMEL) [#32232](#32232)
- (SEMVER-MINOR) doc: deprecate process.umask() with no arguments
  (Colin Ihrig) [#32499](#32499)

ECMAScript Modules - Experimental Warning Removal:

- module: remove experimental modules warning
  (Guy Bedford) [#31974](#31974)

In Node.js 13 we removed the need to include the --experimental-modules
flag, but when running EcmaScript Modules in Node.js, this would still
result in a warning ExperimentalWarning: The ESM module loader is
experimental.

As of Node.js 14 there is no longer this warning when using ESM in
Node.js. However, the ESM implementation in Node.js remains
experimental. As per our stability index: “The feature is not subject
to Semantic Versioning rules. Non-backward compatible changes or
removal may occur in any future release.” Users should be cautious when
using the feature in production environments.

Please keep in mind that the implementation of ESM in Node.js differs
from the developer experience you might be familiar with. Most
transpilation workflows support features such as optional file
extensions or JSON modules that the Node.js ESM implementation does not
support. It is highly likely that modules from transpiled environments
will require a certain degree of refactoring to work in Node.js. It is
worth mentioning that many of our design decisions were made with two
primary goals. Spec compliance and Web Compatibility. It is our belief
that the current implementation offers a future proof model to
authoring ESM modules that paves the path to Universal JavaScript.
Please read more in our documentation.

The ESM implementation in Node.js is still experimental but we do believe
that we are getting very close to being able to call ESM in Node.js
“stable”. Removing the warning is a huge step in that direction.

Migrate to new V8 ArrayBuffer API:

- src: migrate to new V8 ArrayBuffer API (Thang Tran)
  [#30782](#30782)

It is possible that this change will impact some native addons using
`ArrayBuffer`.

Toolchain and Compiler Upgrades:

- (SEMVER-MAJOR) build: update macos deployment target to 10.13 for 14.x
  (AshCripps)[#32454](#32454)
- (SEMVER-MAJOR) doc: update cross compiler machine for Linux armv7
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: update Centos/RHEL releases use devtoolset-8
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: remove SmartOS from official binaries
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) win: block running on EOL Windows versions
  (João Reis) [#31954](#31954)

It is expected that there will be an ABI mismatch on ARM between the
Node.js binary and native addons. Native addons are only broken if they
interact with `std::shared_ptr`. This is expected to be fixed in a
later version of Node.js 14.
- [#30786](#30786)

Update to V8 8.1:

- (SEMVER-MAJOR) deps: update V8 to 8.1.307.20
  (Matheus Marchini) [#32116](#32116)

Other Notable Changes:

- cli, report: move --report-on-fatalerror to stable
  (Colin Ihrig) [#32496](#32496)
- deps: upgrade to libuv 1.37.0
  (Colin Ihrig) [#32866](#32866)
- fs: add fs/promises alias module
  (Gus Caplan) [#31553](#31553)

PR-URL: #32181
BethGriggs added a commit that referenced this issue Apr 21, 2020
Deprecations:

- (SEMVER-MAJOR) crypto: move pbkdf2 without digest to EOL
  (James M Snell) [#31166](#31166)
- (SEMVER-MAJOR) fs: deprecate closing FileHandle on garbage collection
  (James M Snell) [#28396](#28396)
- (SEMVER-MAJOR) http: move OutboundMessage.prototype.flush to EOL
  (James M Snell) [#31164](#31164)
- (SEMVER-MAJOR) lib: move GLOBAL and root aliases to EOL
  (James M Snell) [#31167](#31167)
- (SEMVER-MAJOR) os: move tmpDir() to EOL
  (James M Snell)[#31169](#31169)
- (SEMVER-MAJOR) src: remove deprecated wasm type check
  (Clemens Backes) [#32116](#32116)
- (SEMVER-MAJOR) stream: move \_writableState.buffer to EOL
  (James M Snell) [#31165](#31165)
- (SEMVER-MINOR) doc: deprecate process.mainModule
  (Antoine du HAMEL) [#32232](#32232)
- (SEMVER-MINOR) doc: deprecate process.umask() with no arguments
  (Colin Ihrig) [#32499](#32499)

ECMAScript Modules - Experimental Warning Removal:

- module: remove experimental modules warning
  (Guy Bedford) [#31974](#31974)

In Node.js 13 we removed the need to include the --experimental-modules
flag, but when running EcmaScript Modules in Node.js, this would still
result in a warning ExperimentalWarning: The ESM module loader is
experimental.

As of Node.js 14 there is no longer this warning when using ESM in
Node.js. However, the ESM implementation in Node.js remains
experimental. As per our stability index: “The feature is not subject
to Semantic Versioning rules. Non-backward compatible changes or
removal may occur in any future release.” Users should be cautious when
using the feature in production environments.

Please keep in mind that the implementation of ESM in Node.js differs
from the developer experience you might be familiar with. Most
transpilation workflows support features such as optional file
extensions or JSON modules that the Node.js ESM implementation does not
support. It is highly likely that modules from transpiled environments
will require a certain degree of refactoring to work in Node.js. It is
worth mentioning that many of our design decisions were made with two
primary goals. Spec compliance and Web Compatibility. It is our belief
that the current implementation offers a future proof model to
authoring ESM modules that paves the path to Universal JavaScript.
Please read more in our documentation.

The ESM implementation in Node.js is still experimental but we do believe
that we are getting very close to being able to call ESM in Node.js
“stable”. Removing the warning is a huge step in that direction.

New V8 ArrayBuffer API:

* **src**: migrate to new V8 ArrayBuffer API
  (Thang Tran) [#30782](#30782)

Multiple ArrayBuffers pointing to the same base address are no longer
allowed by V8. This may impact native addons.

Toolchain and Compiler Upgrades:

- (SEMVER-MAJOR) build: update macos deployment target to 10.13 for 14.x
  (AshCripps)[#32454](#32454)
- (SEMVER-MAJOR) doc: update cross compiler machine for Linux armv7
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: update Centos/RHEL releases use devtoolset-8
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: remove SmartOS from official binaries
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) win: block running on EOL Windows versions
  (João Reis) [#31954](#31954)

It is expected that there will be an ABI mismatch on ARM between the
Node.js binary and native addons. Native addons are only broken if they
interact with `std::shared_ptr`. This is expected to be fixed in a
later version of Node.js 14.
- [#30786](#30786)

Update to V8 8.1:

- (SEMVER-MAJOR) deps: update V8 to 8.1.307.20
  (Matheus Marchini) [#32116](#32116)

Other Notable Changes:

- cli, report: move --report-on-fatalerror to stable
  (Colin Ihrig) [#32496](#32496)
- deps: upgrade to libuv 1.37.0
  (Colin Ihrig) [#32866](#32866)
- fs: add fs/promises alias module
  (Gus Caplan) [#31553](#31553)

PR-URL: #32181
@rvagg
Copy link
Member Author

rvagg commented Apr 21, 2020

I suggested to @mhdawson that a workaround might be to tell addon authors to prefix their builds (likely using node-gyp) with CC="gcc -march=armv7-a" CXX="g++ -march=armv7-a". He thought this might make a good doc addition for users about this issue if we can show that's a workable solution.

I've added V=1 CC='gcc -march=armv7-a' CXX='g++ -march=armv7-a' as a prefix to the entry into the docker container that builds addons on node-test-binary-arm-12+ and you can see, thanks to V=1, the execution in action: https://ci.nodejs.org/job/node-test-binary-arm-12+/5504/RUN_SUBSET=addons,label=pi3-docker/consoleFull

I'll leave this in for now and maybe it'll demonstrate a temporary workaround that we can suggest to users. It's probably too late to include it in the 14.x release notes. It's also not ideal, node-gyp should be doing this itself as per @bnoordhuis' suggestion.

@mscdex
Copy link
Contributor

mscdex commented Apr 21, 2020

Perhaps it would be better to append to CFLAGS/CXXFLAGS instead, to avoid overriding the compiler: CFLAGS="$CFLAGS -march=armv7-a" CXXFLAGS="$CXXFLAGS -march=armv7-a"

BethGriggs added a commit that referenced this issue Apr 21, 2020
Deprecations:

- (SEMVER-MAJOR) crypto: move pbkdf2 without digest to EOL
  (James M Snell) [#31166](#31166)
- (SEMVER-MAJOR) fs: deprecate closing FileHandle on garbage collection
  (James M Snell) [#28396](#28396)
- (SEMVER-MAJOR) http: move OutboundMessage.prototype.flush to EOL
  (James M Snell) [#31164](#31164)
- (SEMVER-MAJOR) lib: move GLOBAL and root aliases to EOL
  (James M Snell) [#31167](#31167)
- (SEMVER-MAJOR) os: move tmpDir() to EOL
  (James M Snell)[#31169](#31169)
- (SEMVER-MAJOR) src: remove deprecated wasm type check
  (Clemens Backes) [#32116](#32116)
- (SEMVER-MAJOR) stream: move \_writableState.buffer to EOL
  (James M Snell) [#31165](#31165)
- (SEMVER-MINOR) doc: deprecate process.mainModule
  (Antoine du HAMEL) [#32232](#32232)
- (SEMVER-MINOR) doc: deprecate process.umask() with no arguments
  (Colin Ihrig) [#32499](#32499)

ECMAScript Modules - Experimental Warning Removal:

- module: remove experimental modules warning
  (Guy Bedford) [#31974](#31974)

In Node.js 13 we removed the need to include the --experimental-modules
flag, but when running EcmaScript Modules in Node.js, this would still
result in a warning ExperimentalWarning: The ESM module loader is
experimental.

As of Node.js 14 there is no longer this warning when using ESM in
Node.js. However, the ESM implementation in Node.js remains
experimental. As per our stability index: “The feature is not subject
to Semantic Versioning rules. Non-backward compatible changes or
removal may occur in any future release.” Users should be cautious when
using the feature in production environments.

Please keep in mind that the implementation of ESM in Node.js differs
from the developer experience you might be familiar with. Most
transpilation workflows support features such as optional file
extensions or JSON modules that the Node.js ESM implementation does not
support. It is highly likely that modules from transpiled environments
will require a certain degree of refactoring to work in Node.js. It is
worth mentioning that many of our design decisions were made with two
primary goals. Spec compliance and Web Compatibility. It is our belief
that the current implementation offers a future proof model to
authoring ESM modules that paves the path to Universal JavaScript.
Please read more in our documentation.

The ESM implementation in Node.js is still experimental but we do believe
that we are getting very close to being able to call ESM in Node.js
“stable”. Removing the warning is a huge step in that direction.

New V8 ArrayBuffer API:

* **src**: migrate to new V8 ArrayBuffer API
  (Thang Tran) [#30782](#30782)

Multiple ArrayBuffers pointing to the same base address are no longer
allowed by V8. This may impact native addons.

Toolchain and Compiler Upgrades:

- (SEMVER-MAJOR) build: update macos deployment target to 10.13 for 14.x
  (AshCripps)[#32454](#32454)
- (SEMVER-MAJOR) doc: update cross compiler machine for Linux armv7
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: update Centos/RHEL releases use devtoolset-8
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) doc: remove SmartOS from official binaries
  (Richard Lau) [#32812](#32812)
- (SEMVER-MAJOR) win: block running on EOL Windows versions
  (João Reis) [#31954](#31954)

It is expected that there will be an ABI mismatch on ARM between the
Node.js binary and native addons. Native addons are only broken if they
interact with `std::shared_ptr`. This is expected to be fixed in a
later version of Node.js 14.
- [#30786](#30786)

Update to V8 8.1:

- (SEMVER-MAJOR) deps: update V8 to 8.1.307.20
  (Matheus Marchini) [#32116](#32116)

Other Notable Changes:

- cli, report: move --report-on-fatalerror to stable
  (Colin Ihrig) [#32496](#32496)
- deps: upgrade to libuv 1.37.0
  (Colin Ihrig) [#32866](#32866)
- fs: add fs/promises alias module
  (Gus Caplan) [#31553](#31553)

PR-URL: #32181
@rvagg
Copy link
Member Author

rvagg commented Apr 22, 2020

Good call @mscdex, and that passes nicely through node-gyp. I've updated the CI job to use roughly this and it's working fine: https://ci.nodejs.org/job/node-test-binary-arm-12+/5525/RUN_SUBSET=addons,label=pi3-docker/consoleFull

@rvagg
Copy link
Member Author

rvagg commented Apr 22, 2020

So the current recommendations for people having trouble with std::shared_ptr on ARMv7 platforms:

  • Our official armv7l binaries available from nodejs.org are compiled explicitly for armv7-a
  • If you are using the Raspberry Pi toolchain to compile addons, (or possibly some other third-party toolchain) on your ARMv7 platform, then it's going to be compiling down to ARMv6. RPi does this to be maximally compatible with their hardware, including the recent Pi Zero which is still ARMv6.
  • There is some kind of ABI incompatibility when it comes to the use of std::shared_ptr between our armv7-a binaries and natively compiled armv6 (most likely armv6zk on RPi) binaries which can cause problems.
  • The workaround, for now at least, is to prefix any addon compiles with CFLAGS="$CFLAGS -march=armv7-a" CXXFLAGS="$CXXFLAGS -march=armv7-a".
  • This should will work by adding this in front of npm install or node-gyp, or whatever other process you're using to build addons.
  • This will make your addons build for ARMv7 only, they won't be compatible with ARMv6 platforms.
  • An alternative, if you want maximum compatibility and straightforward compiles is to use the unofficial armv6l binaries available at: https://unofficial-builds.nodejs.org/download/release/ - just be aware that these are not officially supported and you can't depend on them continuing to be available or not breaking. These binaries are compiled with armv6zk so should work across all Raspberry Pis with modern(ish) Linuxes.

@jasnell
Copy link
Member

jasnell commented Jun 25, 2020

Ping @rvagg ... does this need to remain open? I've been thinking that we need to have a better place of documenting these kinds of persistent issues. Maybe a doc/known-issues folder where they can be checked in...

@addaleax
Copy link
Member

I would keep this open. This is not just a flaky test, that’s just a symptom of the underlying “real” problem.

@Trott
Copy link
Member

Trott commented Feb 27, 2021

I haven't seen this test fail in a very long time. Is it at all likely that the cause of the failure has been fixed?

@addaleax
Copy link
Member

@Trott I don’t think anybody did anything to fix this, and I this isn’t the kind of issue that “magically” goes away…

@richardlau
Copy link
Member

Might #36634 have had an effect?

@addaleax
Copy link
Member

Hm, maybe … my understanding was that that did not actually have the desired effect, but it might have solved this here as a side effect, which could be nice? I still wouldn’t be sure without actually verifying it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI. flaky-test Issues and PRs related to the tests with unstable failures on the CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants