nodejs / build

Better build and test infra for Node.
506 stars 166 forks source link

Coverity Scan: Analysis failed for Node.js #3517

Closed richardlau closed 1 year ago

richardlau commented 1 year ago
Your request for analysis of Node.js  is failed.
Analysis status: Failure
Please fix the error and upload the build again.

Error details:
The build uploaded has been only partially compiled. We recommend at least 85% capture success to avoid false-positives during analysis. As per last few lines of cov-int/build-log.txt, the percentage of compilation units ready for analysis is 75% which is less than the expected 85%
For more detail explanation on the error, please check: https://u15810271.ct.sendgrid.net/ls/click?upn=CTPegkVN6peWFCMEieYYmPWIi1E4yUS9EoqKFcNAiqhRq8qmgeBE-2Bdt3uvFRAFXdWuYPtetdiJ46h-2Fd1eC1gFA-3D-3Dn6kr_EU3W9teASMK00lBXX9WT4q2YGc-2BNxsR0ssafAnvfxhOjNxolZnQU6q0DRaVEgLvXI83curyG-2FhO-2BR5q-2BYH-2FWuWHZ6OhnwGllTyhNQLo6jFqwzbwEp1bz8yNYClPeJMwFLTWgmXqXyI3e-2FqZ1-2F48OH-2FrrPI2DR5gd63pI4YJVFa4uzYAg1pzQCx9efrTX-2BQSTcwX31Ny4pajJeXzOW0mfZg-3D-3D

If your build process isn't going smoothly, email us at scan-admin@coverity.com
with your cov-int/build-log.txt file attached for assistance, or post your issue
to the StackOverflow at https://u15810271.ct.sendgrid.net/ls/click?upn=CTPegkVN6peWFCMEieYYmPWIi1E4yUS9EoqKFcNAiqhRq8qmgeBE-2Bdt3uvFRAFXdWuYPtetdiJ46h-2Fd1eC1gFA-3D-3DCqOU_EU3W9teASMK00lBXX9WT4q2YGc-2BNxsR0ssafAnvfxhOjNxolZnQU6q0DRaVEgLvXs2FG5huHryvJKQ8pLwVpk-2FT4M1OubE9RU0XiDDvfBzVtE0wPJ8O7ODtjcarbtohah16ovVgtWSuENO2oFqLDlnon4PKESXv3DW5Hpps2jwCCOn9htL95PjOljFTn4tmVxMImVaTHyDDivSf9RZkI5g-3D-3D

This is corresponding to the build from https://ci.nodejs.org/job/node-daily-coverity/2791/console

[WARNING] Emitted 2872 C/C++ compilation units (75%) successfully
[WARNING] Recoverable errors were encountered during 2 of these C/C++ compilation units.

2872 C/C++ compilation units (75%) are ready for analysis
 For more details, please look at: 
    /home/iojs/build/workspace/node-daily-coverity/cov-int/build-log.txt
+ ./node --version
+ git rev-parse --short HEAD
+ VERSION=v21.0.0-pre-ed49722a8a

For comparison the previous build https://ci.nodejs.org/view/Node.js%20Daily/job/node-daily-coverity/2790/console (and the previous few that I checked) was at 99%

Emitted 3773 C/C++ compilation units (99%) successfully
[WARNING] Recoverable errors were encountered during 321 of these C/C++ compilation units.

3773 C/C++ compilation units (99%) are ready for analysis
The cov-build utility completed successfully.
+ ./node --version
+ git rev-parse --short HEAD
+ VERSION=v21.0.0-pre-0522ac086c

Unfortunately the CI job removes cov-int at the end which means the build-log.txt is no longer available. I'll comment out the removal of cov-int so that the build-log is preserved the next time.

richardlau commented 1 year ago

The commits that changed between the two most recent builds are https://github.com/nodejs/node/compare/0522ac086c...ed49722a8a or

$ git log --oneline 0522ac086c...ed49722a8a
ed49722a8a (HEAD -> main, upstream/main) fs: improve error performance for `ftruncateSync`
ceedb3a509 (upstream/v21.x-staging, upstream/v21.x) deps: update simdutf to 3.2.18
34fa7043a2 doc: fix description of `fs.readdir` `recursive` option
11f95dd12f 2023-10-10, Version 18.18.1 'Hydrogen' (LTS)
78a15702dd src: avoid making JSTransferable wrapper object weak
6b76b7782c test: skip v8-updates/test-linux-perf
c13c98dd38 test: skip test-tick-processor-arguments on SmartOS
738aa304b3 test: adapt REPL test to V8 changes
de5c009252 test: adapt test-fs-write to V8 internal changes
8c36168b42 test: update flag to disable SharedArrayBuffer
6ccb15f7ef test: adapt debugger tests to V8 11.4
fd21429ef5 lib: update usage of always on Atomics API
8568de3da6 tools: add new V8 headers to distribution
86cb23d09f tools: update V8 gypfiles for 11.8
9c6219c7e2 tools: update V8 gypfiles for 11.7
73ddf50163 tools: update V8 gypfiles for 11.6
817ef255ea tools: update V8 gypfiles for 11.5
f34a3a9861 tools: update V8 gypfiles for 11.4
162a0652ab deps: bump minimum ICU version to 73
4531c154e5 deps: V8: cherry-pick 8ec2651fbdd8
9ad0e2cacc deps: V8: cherry-pick 89b3702c92b0
dfc9c86868 deps: V8: cherry-pick de9a5de2274f
186b36efba deps: V8: cherry-pick b5b5d6c31bb0
867586ce95 deps: V8: cherry-pick 93b1a74cbc9b
4ad3479ba7 deps: V8: cherry-pick 1a3ecc2483b2
660f902f16 deps: patch V8 to avoid duplicated zlib symbol
f7c1d410ad deps: remove usage of a C++20 feature from V8
9c4030bfb9 deps: avoid compilation error with ASan
5f05cc15e6 deps: disable V8 concurrent sparkplug compilation
42cd952dbd deps: silence irrelevant V8 warning
88cf90f9c4 deps: always define V8_EXPORT_PRIVATE as no-op
11af089b14 src: update NODE_MODULE_VERSION to 120
17c55d176b build: reset embedder string to "-node.0"
17a74ddd3d deps: update V8 to 11.8.172.13
richardlau commented 1 year ago

I ran the build against 34fa7043a2 which still failed so we can rule out the simdutf8 update. https://ci.nodejs.org/job/node-daily-coverity/2794/console

[WARNING] Emitted 2872 C/C++ compilation units (75%) successfully
[WARNING] Recoverable errors were encountered during 2 of these C/C++ compilation units.

2872 C/C++ compilation units (75%) are ready for analysis
 For more details, please look at: 
    /home/iojs/build/workspace/node-daily-coverity/cov-int/build-log.txt
+ ./node --version
+ git rev-parse --short HEAD
+ VERSION=v21.0.0-pre-34fa7043a2
richardlau commented 1 year ago

In cov-int/build-log.txt there is one warning

WARNING: cov-emit returned with code 4 for ../deps/simdutf/simdutf.cpp

which looks like a crash

```text [STATUS] Compiling ../deps/simdutf/simdutf.cpp /var/cov-analysis-linux64-2022.6.0/bin/cov-emit --emit_pch_dependencies --dir=/home/iojs/build/workspace/node-daily-coverity/cov-int --ignore_path=/tmp/cov-iojs/45b6b904a783b5dd750af95e26a3e9af/cov-configure --ignore_path=/tmp/cov-iojs/45b6b904a783b5dd750af95e26a3e9af/cov-iojs/29c11800b12ddfcfafb14c4bf7ee8723 --pre_preinclude /home/iojs/build/workspace/node-daily-coverity/cov-int/emit/test-equinix-ubuntu2204-x64-1/config/1d8903ecd1458134138560c05d659760/g++-config-0/coverity-macro-compat.h --pre_preinclude /home/iojs/build/workspace/node-daily-coverity/cov-int/emit/test-equinix-ubuntu2204-x64-1/config/1d8903ecd1458134138560c05d659760/g++-config-0/coverity-compiler-compat.h --add_type_modifier=__coverity___fpreg --add_type_modifier=__coverity_decimal --add_type_modifier=__coverity_float --add_type_modifier=__coverity_floatx --no_predefined_feature_test_macros --no_stdarg_builtin --enable_128bit_int --no_predefined_cplusplus -w --no_predefines --comp_ver 11.4.0 --char_bit_size=8 --gnu_carriage_return_line_terminator --wchar_t_keyword --no_multiline_string --no_trigraphs --ignore_calling_convention --enable_80bit_float --enable_128bit_float --macro_stack_pragmas --no_exceptions --arg_dependent_overload --inline_keyword --has_include_macro --has_include_next_macro --has_cpp_attribute_macro --no_predefines --c++ --no_macro_preempts_udl_suffix --builtin_emulation --allow_incompat_throw --new_array_args --type_traits_helpers --c++17 --gnu_version 110400 --no_rtti --no_exceptions -I../deps/simdutf --sys_include /usr/include/c++/11 --sys_include /usr/include/x86_64-linux-gnu/c++/11 --sys_include /usr/include/c++/11/backward --sys_include /usr/lib/gcc/x86_64-linux-gnu/11/include --sys_include /usr/local/include --sys_include /usr/include/x86_64-linux-gnu --sys_include /usr/include -DICU_NO_USER_DATA_OVERRIDE -DNODE_OPENSSL_CONF_NAME=nodejs_conf -DNODE_OPENSSL_HAS_QUIC -DOPENSSL_NO_PINSHARED -DOPENSSL_THREADS -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -D_GLIBCXX_USE_CXX11_ABI=1 -D_REENTRANT -D__OPTIMIZE__ -D__STDC_FORMAT_MACROS --type_sizes=e16Pdlx8fiw4s2 --type_alignments=e16Pdlx8fiw4s2 --size_t_type=m --ptrdiff_t_type=l ../deps/simdutf/simdutf.cpp Warning #2636: no declared member function matches "target" attributes for function "simdutf::haswell::::simd::simd8::operator simdutf::haswell::::simd::simd8" Warning #2636: no declared member function matches "target" attributes for function "simdutf::westmere::::simd::simd8::operator simdutf::westmere::::simd::simd8" Warning #2636: no declared member function matches "target" attributes for function "simdutf::westmere::::simd::simd16::operator simdutf::westmere::::simd::simd16" catastrophic signal: 11 (SIGSEGV) faulting data pointer: 0x0000000000000000 call stack backtrace: cov-emit linux64 2022.6.0 0x0000000000b6f5b0 0x0000000000578c3c 0x0000000000bf5282 0x00000000005bb3f0 0x00000000006c3279 0x00000000006c3d69 0x00000000006db955 0x0000000000bef3d9 0x0000000000bfd42e 0x0000000000ccf3f3 0x0000000000bc4ee8 0x0000000000bf01c9 (last 4 repeated 2 more times) 0x0000000000bfd42e 0x0000000000ccf3f3 0x00000000006d715f 0x0000000000bb1978 0x0000000000bb4503 0x0000000000493f22 libc.so.6 linux64 2022.6.0 0x0000000000029d90 WARNING: cov-emit returned with code 4 for ../deps/simdutf/simdutf.cpp ```

and 953 warnings such as:

[STATUS] Compiling ../deps/v8/src/init/setup-isolate-full.cc
/var/cov-analysis-linux64-2022.6.0/bin/cov-emit --emit_pch_dependencies --dir=/home/iojs/build/workspace/node-daily-coverity/cov-int --ignore_path=/tmp/cov-iojs/45b6b904a783b5dd750af95e26a3e9af/cov-configure --ignore_path=/tmp/cov-iojs/45b6b904a783b5dd750af95e26a3e9af/cov-iojs/0a516a81dbb4a16dd31893cf55ce7a08 --pre_preinclude /home/iojs/build/workspace/node-daily-coverity/cov-int/emit/test-equinix-ubuntu2204-x64-1/config/4008d75d1ab17caac7cdebbbbfdd6d73/g++-config-0/coverity-macro-compat.h --pre_preinclude /home/iojs/build/workspace/node-daily-coverity/cov-int/emit/test-equinix-ubuntu2204-x64-1/config/4008d75d1ab17caac7cdebbbbfdd6d73/g++-config-0/coverity-compiler-compat.h --add_type_modifier=__coverity___fpreg --add_type_modifier=__coverity_decimal --add_type_modifier=__coverity_float --add_type_modifier=__coverity_floatx --no_predefined_feature_test_macros --no_stdarg_builtin --enable_128bit_int --no_predefined_cplusplus -w --no_predefines --comp_ver 11.4.0 --char_bit_size=8 --gnu_carriage_return_line_terminator --wchar_t_keyword --no_multiline_string --no_trigraphs --ignore_calling_convention --enable_80bit_float --enable_128bit_float --macro_stack_pragmas --no_exceptions --arg_dependent_overload --inline_keyword --has_include_macro --has_include_next_macro --has_cpp_attribute_macro --no_predefines --c++ --no_macro_preempts_udl_suffix --builtin_emulation --allow_incompat_throw --new_array_args --type_traits_helpers --c++17 --gnu_version 110400 --no_rtti --no_exceptions -I../deps/v8 -I../deps/v8/include -I/home/iojs/build/workspace/node-daily-coverity/out/Release/obj/gen/generate-bytecode-output-root -I/home/iojs/build/workspace/node-daily-coverity/out/Release/obj/gen -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common --sys_include /usr/include/c++/11 --sys_include /usr/include/x86_64-linux-gnu/c++/11 --sys_include /usr/include/c++/11/backward --sys_include /usr/lib/gcc/x86_64-linux-gnu/11/include --sys_include /usr/local/include --sys_include /usr/include/x86_64-linux-gnu --sys_include /usr/include -DENABLE_DISASSEMBLER -DICU_NO_USER_DATA_OVERRIDE -DNODE_OPENSSL_CONF_NAME=nodejs_conf -DNODE_OPENSSL_HAS_QUIC -DOBJECT_PRINT -DOPENSSL_NO_PINSHARED -DOPENSSL_THREADS -DUCONFIG_NO_BREAK_ITERATION=0 -DUCONFIG_NO_SERVICE=1 -DU_ENABLE_DYLOAD=0 -DU_HAVE_STD_STRING=1 -DU_STATIC_IMPLEMENTATION=1 -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_ALLOCATION_FOLDING -DV8_ALLOCATION_SITE_TRACKING -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_EMBEDDER_STRING="-node.12" -DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_ENABLE_TURBOFAN -DV8_ENABLE_WEBASSEMBLY -DV8_GYP_BUILD -DV8_HAVE_TARGET_OS -DV8_INTL_SUPPORT -DV8_PROMISE_INTERNAL_FIELD_COUNT=1 -DV8_SCRIPTORMODULE_LEGACY_LIFETIME -DV8_SHARED_RO_HEAP -DV8_SHORT_BUILTIN_CALLS -DV8_TARGET_ARCH_X64 -DV8_TARGET_OS_LINUX -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DV8_USE_SIPHASH -DV8_USE_ZLIB -DV8_WIN64_UNWINDING_INFO -D_GLIBCXX_USE_CXX11_ABI=1 -D_REENTRANT -D__OPTIMIZE__ -D__STDC_FORMAT_MACROS --type_sizes=e16Pdlx8fiw4s2 --type_alignments=e16Pdlx8fiw4s2 --size_t_type=m --ptrdiff_t_type=l ../deps/v8/src/init/setup-isolate-full.cc 
WARNING: cov-emit returned with signal 11 (SIGSEGV) for ../deps/v8/src/init/setup-isolate-full.cc

all within deps/v8 😞. I guess we could run a coverity build for a commit prior to the V8 11.8 update to check whether those warnings were present then.

richardlau commented 1 year ago

I've started a CI run against 0522ac086c66126449066595c42604a5d6cd0627 which is the commit prior to the V8 update: https://ci.nodejs.org/job/node-daily-coverity/2796/

richardlau commented 1 year ago

I've started a CI run against 0522ac086c66126449066595c42604a5d6cd0627 which is the commit prior to the V8 update: https://ci.nodejs.org/job/node-daily-coverity/2796/

The simdutf8 warning is in the build-log.txt for this run, but none of the 953 warnings for deps/v8 are there so this does look like the V8 update has broken coverity somehow.

Emitted 3773 C/C++ compilation units (99%) successfully
[WARNING] Recoverable errors were encountered during 321 of these C/C++ compilation units.

3773 C/C++ compilation units (99%) are ready for analysis
The cov-build utility completed successfully.
+ ./node --version
+ git rev-parse --short HEAD
+ VERSION=v21.0.0-pre-0522ac086c

According to https://scan.coverity.com/download?tab=cxx the current scan tool is

Version: 2022.12 Updated: April 29th, 2023

We are on 2022.6 so we could try upgrading.

mhdawson commented 1 year ago

Updated to 2022.12.2

Run to see if it helps - https://ci.nodejs.org/job/node-daily-coverity/

richardlau commented 1 year ago

Looks promising:

richardlau commented 1 year ago

Today's scheduled build was successfully analyzed.