Uh oh!
There was an error while loading. Please reload this page.
test: check zlib version for createDeflateRaw - #13697
Conversation
We are currenly builing Node with --shared-zlib which happens to be version 1.2.8. The test for zlib.createDeflateRaw is expected to fail but does not when using version 1.2.8. As far as I can tell the fix referred to in the comments was introduced in version 1.2.9: - Reject a window size of 256 bytes if not using the zlib wrapper This commit suggests adding a check for the version and skipping this assert if the version is less than 1.2.9. Refs: http://zlib.net/ChangeLog.txt
danbev
commented
Jun 15, 2017
danbev
commented
Jun 15, 2017
test/osx failure looks unrelatednot ok 168 async-hooks/test-callback-error --- duration_ms: 60.87 severity: fail stack: |- timeout |
| assert.throws(() => { | ||
| zlib.createDeflateRaw({ windowBits: 8 }); | ||
| }, /^Error: Init error$/); | ||
| if (process.versions.zlib.match(/^\d+\.\d+\.[9]|\d{2,}$/)) { |
There was a problem hiding this comment.
I think it would be good to include a link to the reasoning in zlib for this directly rather than having people blame and dig the link from the PR - but I'm fine with other way.
There was a problem hiding this comment.
Good point, let me add a comment and see what you think. Thanks
There was a problem hiding this comment.
Could you use test() instead of match(). And +1 to adding the comment.
| assert.throws(() => { | ||
| zlib.createDeflateRaw({ windowBits: 8 }); | ||
| }, /^Error: Init error$/); | ||
| if (process.versions.zlib.match(/^\d+\.\d+\.[9]|\d{2,}$/)) { |
There was a problem hiding this comment.
Could you use test() instead of match(). And +1 to adding the comment.
danbev
commented
Jun 15, 2017
No problem, I'll change this. |
jasnell
left a comment
There was a problem hiding this comment.
LGTM once the comment is added.
| // This check was introduced in vesion 1.2.9 and prior to that there was | ||
| // no such rejection which is the reason for the version check below | ||
| // (http://zlib.net/ChangeLog.txt). | ||
| if (/^\d+\.\d+\.[9]|\d{2,}$/.test(process.versions.zlib)) { |
There was a problem hiding this comment.
Is this regexp correct? What about a theoretical zlib 1.3.0?
There was a problem hiding this comment.
It could probably be made stricter, yes. I also don’t quit get the |\d{2,}$ part – are there missing parentheses? /^a|b$/ is grouped as /(^a)|(b$)/, not /^(a|b)$/, but you probably meant something like the latter?
There was a problem hiding this comment.
@richardlau You are right, I missed that :(
@addaleax@richardlau I think I went at this the wrong way trying to match allowed versions. I hope I've managed to simplify the expression by trying to detect an invalid version instead. Let me know what you think.
| // This check was introduced in vesion 1.2.9 and prior to that there was | ||
| // no such rejection which is the reason for the version check below | ||
| // (http://zlib.net/ChangeLog.txt). | ||
| if ((/^(?!1\.2\.[0-8]$)/.test(process.versions.zlib))) { |
There was a problem hiding this comment.
Isn’t this equivalent to (!/^1\.2\.[0-8]$/.test(process.versions.zlib))? That would look a bit simpler to me.
There was a problem hiding this comment.
Yeah, I was choosing between the both and had a trouble making up my mind. I'd be happy to change it.
danbev
commented
Jun 18, 2017
| zlib.createDeflateRaw({ windowBits: 8 }); | ||
| }, /^Error: Init error$/); | ||
| // invalid by zlib (http://zlib.net/manual.html#Advanced). | ||
| // This check was introduced in vesion 1.2.9 and prior to that there was |
We are currenly builing Node with --shared-zlib which happens to be version 1.2.8. The test for zlib.createDeflateRaw is expected to fail but does not when using version 1.2.8. As far as I can tell the fix referred to in the comments was introduced in version 1.2.9: - Reject a window size of 256 bytes if not using the zlib wrapper This commit suggests adding a check for the version and skipping this assert if the version is less than 1.2.9. Refs: http://zlib.net/ChangeLog.txt PR-URL: nodejs#13697 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
danbev
commented
Jun 18, 2017
Landed in 5189857 |
We are currenly builing Node with --shared-zlib which happens to be version 1.2.8. The test for zlib.createDeflateRaw is expected to fail but does not when using version 1.2.8. As far as I can tell the fix referred to in the comments was introduced in version 1.2.9: - Reject a window size of 256 bytes if not using the zlib wrapper This commit suggests adding a check for the version and skipping this assert if the version is less than 1.2.9. Refs: http://zlib.net/ChangeLog.txt PR-URL: #13697 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
We are currenly builing Node with --shared-zlib which happens to be version 1.2.8. The test for zlib.createDeflateRaw is expected to fail but does not when using version 1.2.8. As far as I can tell the fix referred to in the comments was introduced in version 1.2.9: - Reject a window size of 256 bytes if not using the zlib wrapper This commit suggests adding a check for the version and skipping this assert if the version is less than 1.2.9. Refs: http://zlib.net/ChangeLog.txt PR-URL: #13697 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
MylesBorins
commented
Jul 17, 2017
should this be backported to v6.x? |
danbev
commented
Aug 15, 2017
I don't think this needs to be backported. Sorry again about the late/missed reply on this. |
drewfish
commented
Sep 13, 2017
BTW here at Yahoo we just backported this to our internal v6.x branch, since we |
MylesBorins
commented
Sep 14, 2017
@drewfish would you be willing to submit your patch as a backport to v6.x-staging? There are a ton of conflicts rn, but I'm sure we would be willing to land it so you don't need to float it. Also fwiw... if you are floating any other patches on 6.x please feel free to open an issue on https://github.com/nodejs/lts for us to take a look |
MylesBorins
commented
Sep 19, 2017
ping @drewfish |
drewfish
commented
Sep 19, 2017
pong #15478 |
We are currenly builing Node with --shared-zlib which happens to be version 1.2.8. The test for zlib.createDeflateRaw is expected to fail but does not when using version 1.2.8. As far as I can tell the fix referred to in the comments was introduced in version 1.2.9: - Reject a window size of 256 bytes if not using the zlib wrapper This commit suggests adding a check for the version and skipping this assert if the version is less than 1.2.9. Refs: http://zlib.net/ChangeLog.txt Backport-PR-URL: #15478 PR-URL: #13697 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
We are currenly builing Node with --shared-zlib which happens to be version 1.2.8. The test for zlib.createDeflateRaw is expected to fail but does not when using version 1.2.8. As far as I can tell the fix referred to in the comments was introduced in version 1.2.9: - Reject a window size of 256 bytes if not using the zlib wrapper This commit suggests adding a check for the version and skipping this assert if the version is less than 1.2.9. Refs: http://zlib.net/ChangeLog.txt Backport-PR-URL: #15478 PR-URL: #13697 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
We are currenly builing Node with
--shared-zlibwhich happens to beversion
1.2.8. The test for zlib.createDeflateRaw is expected to failbut does not when using version
1.2.8.As far as I can tell the fix referred to in the comments was
introduced in version
1.2.9:This commit suggests adding a check for the version and skipping this
assert if the version is less than
1.2.9.Refs: http://zlib.net/ChangeLog.txt
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test