Uh oh!
There was an error while loading. Please reload this page.
deps: switch to chromium's zlib implementation - #31201
Conversation
nodejs-github-bot
commented
Jan 6, 2020
nodejs-github-bot
commented
Jan 6, 2020
devsnek
commented
Jan 6, 2020
Do we know why they aren't included upstream? If it's because of compatibility or something like that we'd need to be careful. |
devsnek
commented
Jan 6, 2020
madler/zlib#346 seems related |
nodejs-github-bot
commented
Jan 6, 2020
mscdex
commented
Jan 6, 2020
Not sure what is up with the Windows failures. I'm not even able to successfully install the 2017 or 2019 build tools or community edition to duplicate the problem myself and the CI logs show no output. |
mscdex
commented
Jan 6, 2020
/cc @nodejs/build ? |
sam-github
commented
Jan 6, 2020
https://ci.nodejs.org/job/node-compile-windows/31073/nodes=win-vs2019/console worrisome or not? I don't know. build continued, failed at possibly related to #30954 ? |
sam-github
commented
Jan 6, 2020
Is it possible chromium only builds with llvm on Windows, so the .gyp file you pulled in doesn't work for node? |
richardlau
commented
Jan 6, 2020
Chromium doesn't use gyp any more -- the gyp file is all ours. Lines 783 to 809 in 20fd123 All current references in our gyp files to |
nodejs-github-bot
commented
Jan 6, 2020
MylesBorins
commented
Jan 6, 2020
Do we expose the bindings for zlib? What guarantees do we have for ABI compatibility between V8 versions? What about security releases? Not blocking, just want to ensure that coupling these dependencies won't put us in a weird place. |
richardlau
commented
Jan 6, 2020
Yes, we do. From https://nodejs.org/dist/latest-v13.x/docs/api/addons.html#addons_c_addons:
|
MylesBorins
commented
Jan 6, 2020
Since we expose the bindings I would love to see some historical data about how much V8 has updated zlib and what ABI assurances we have. It might even make sense to duplicate the zlib and periodically update it ourselves, but that might be overkill |
nodejs-github-bot
commented
Jan 6, 2020
mscdex
commented
Jan 7, 2020
Everything is passing now. AFAIK there should be no ABI issues. Do we have something in CI to check this sort of thing? |
There was a problem hiding this comment.
Any particular reason this is commented out instead of #defineing CHROMIUM_ZLIB_NO_CHROMECONF in zlib.gyp?
There was a problem hiding this comment.
IIRC there were issues with zlib addon or similar tests.
There was a problem hiding this comment.
The define would have to end up in common.gypi, I think.
There was a problem hiding this comment.
I can do that if that's more desirable.
Uh oh!
There was an error while loading. Please reload this page.
addaleax
commented
Jan 8, 2020
Yeah, this looks good API/ABI-wise |
This seems relevant: https://cs.chromium.org/chromium/src/third_party/zlib/patches/README?g=0 If this information is updated, there are only three patches applied on top of upstream zlib, one of them being purely build infrastructure changes. The relevant changes would be in https://cs.chromium.org/chromium/src/third_party/zlib/patches/0001-simd.patch?g=0, which are (probably) the same changes available in the zlib provided by Intel (https://software.intel.com/en-us/articles/how-to-use-zlib-with-intel-ipp-optimization). The last patch is one line change which shouldn't affect API/ABI. Edit: looking at Chromium git history, the patches listed above are outdated. There's also ARM optimizations, among other changes. FWIW, other companies also have their zlib forks with optimizations which are not merged upstream: Intel: https://github.com/jtkukunas/zlib |
nodejs-github-bot
commented
Jan 11, 2020
BridgeAR
left a comment
There was a problem hiding this comment.
The benchmarks are LG to me % var
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Jan 12, 2020
richardlau
commented
Feb 18, 2020
For @nodejs/releasers this has broken builds from the source tarball and would need to land on, e.g. 12.x, with whatever fixes it. |
I'm surprised it passes cleanly in a build through Chromium bots (we enable quite a few warning flags for clang, also got MSAN/ASAN active and fuzzers). A quick look confirms that the impacted code is not part of the optimizations per-si, as it comes straight from zlib upstream: I think the fall through case is on purpose here, therefore a false positive. Finally, I noticed that the hash imported seems to be missing the fix for an uninitialized jump (landed on 23th Jan): If updating to Chromium's ToT (Top of Tree) is too hard, I would recommend to at least apply the fix on what you guys are shipping. I'm working in some new optimizations and when I land this new work (will take a few months), I can provide a heads up, but then it would be the time to get in-sync with ToT, I'm afraid. |
billouboq
commented
Feb 25, 2020
if you want to search for other optimisations this repo summarize it : |
This implementation provides optimizations not included upstream. PR-URL: #31201 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This implementation provides optimizations not included upstream. PR-URL: #31201 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This implementation provides optimizations not included upstream. PR-URL: nodejs#31201 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
See: - nodejs#31201 PR-URL: nodejs#31800 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
This implementation provides optimizations not included upstream. PR-URL: #31201 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Adenilson
commented
Mar 29, 2022
I'm unsure what is the best way to reach out to node.js developers, but in face of the newly reported CVE impacting zlib (https://nvd.nist.gov/vuln/detail/CVE-2018-25032), I just wanted to share that we have backported the fix to Chromium's zlib all the way back in 2018 (madler/zlib#605 (comment)). From a security point of view, if you are running Chromium's zlib you should be fine. I'm actively inspecting the patches featured in zlib 1.2.12 and porting them to Chromium. |
Adenilson
commented
Mar 29, 2022
The work updating Chromium's zlib to zlib 1.2.12 is tracked here: |
This implementation provides optimizations not included upstream.
Benchmark results:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes