Open Cubelrti opened 3 years ago
Does it still happen on the latest version?
Yes it happens since 0.49.0, but we manually disabled SSSE3 features by the following patch:
diff --git a/deps/zlib/crc32.c b/deps/zlib/crc32.c
index e95b9087351c1a46dda520025c55d0ef8a1484e0..7db41a794a97beeb556370bd6778894998539fe7 100644
--- a/deps/zlib/crc32.c
+++ b/deps/zlib/crc32.c
@@ -501,7 +501,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
ZLIB_INTERNAL void crc_reset(deflate_state *const s)
{
if (x86_cpu_enable_simd) {
- crc_fold_init(s);
+ // crc_fold_init(s);
return;
}
s->strm->adler = crc32(0L, Z_NULL, 0);
@@ -509,14 +509,14 @@ ZLIB_INTERNAL void crc_reset(deflate_state *const s)
ZLIB_INTERNAL void crc_finalize(deflate_state *const s)
{
- if (x86_cpu_enable_simd)
- s->strm->adler = crc_fold_512to32(s);
+ // if (x86_cpu_enable_simd)
+ // s->strm->adler = crc_fold_512to32(s);
}
ZLIB_INTERNAL void copy_with_crc(z_streamp strm, Bytef *dst, long size)
{
if (x86_cpu_enable_simd) {
- crc_fold_copy(strm->state, dst, strm->next_in, size);
+ // crc_fold_copy(strm->state, dst, strm->next_in, size);
return;
}
zmemcpy(dst, strm->next_in, size);
I'm gonna be honest I am waaay out of my depth here. I'll leave this open for anyone who encounters this error
Got same problem with "unzipper", it unzipped zero/one file and crashes.
I am experiencing the same bug as https://github.com/nodejs/node/issues/32553 mentioned.
NWJS Version : 0.49.0 Operating System : Windows 7 SP1 6.1.7601 24520
Expected behavior
zlib.gzipSync(data)
should work with any CPU.Actual behavior
When calling
zlib.gzipSync(data)
in 0.49.0 with some CPU architecture, the webview crashed with EXCEPTION_ILLEGAL_INSTRUCTION.Experiencing this issue in the following CPUs:
Those two CPUs don't have SSSE3/SSE4.2 supported, which might be the issue.
How to reproduce
Also
I tried to remove flags in
zlib.gyp
which is also removed by upstream node here, but I cannot compile node after removing-msse4.2
(removing-mssse3
is fine).I think it relates to https://github.com/nodejs/node/commit/65db9b210d3b5fc7af7cc7f7dcb6f8840adacedb this change, but 0.49.0 already has this patch in it.