third_party/libwebrtc/video/config/streams_config_gn, GCC-13 Unified_cpp_streams_config_gn0.cpp fails with -Werror=nonnull
Categories
(Core :: WebRTC, task, P4)
Tracking
()
People
(Reporter: ishikawa, Unassigned)
Details
I am compiling C-C TB locally on my linux PC.
I use GCC-13 for compilation.
For historical reasons, I use -Werror to catch as many compile time warnings as possible.
Unless I remove the warnings, I cannot build C-C TB.
-Werror has been applied to M-C portion of the local tree as well. (See Bug 1654419 if you are interested.)
I have refreshed M-C tree for the first time in about two weeks this morning an I get a build error.
third_party/libwebrtc/video/config/streams_config_gn/Unified_cpp_streams_config_gn0.cpp
encounted an error due to -Werror=nonnull
It could be a false positive of GCC-13, but one needs to be aware that
there could an issue in the source code.
The error/warning is reported as follows.
gmake[4]: Entering directory '/NEW-SSD/moz-obj-dir/objdir-tb3/third_party/libwebrtc/video/config/streams_config_gn'
...
/usr/bin/ccache /usr/bin/g++-13 -o Unified_cpp_streams_config_gn0.o -c -I/NEW-SSD/moz-obj-dir/objdir-tb3/dist/stl_wrappers -I/NEW-SSD/moz-obj-dir/objdir-tb3/dist/system_wrappers -include /NEW-SSD/NREF-COMM-CENTRAL/mozilla/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DDEBUG=1 -DABSL_ALLOCATOR_NOTHROW=1 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DRTC_ENABLE_VP9 -DWEBRTC_ENABLE_PROTOBUF=0 -DWEBRTC_LIBRARY_IMPL -DWEBRTC_MOZILLA_BUILD -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_STRICT_FIELD_TRIALS=0 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_UDEV -DWEBRTC_ENABLE_LIBEVENT -DWEBRTC_LINUX -DWEBRTC_POSIX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DWEBRTC_ENABLE_AVX2 -D_DEBUG -DUSE_X11=1 -D_GNU_SOURCE -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/NEW-SSD/NREF-COMM-CENTRAL/mozilla/third_party/libwebrtc/video/config/streams_config_gn -I/NEW-SSD/moz-obj-dir/objdir-tb3/third_party/libwebrtc/video/config/streams_config_gn -I/NEW-SSD/moz-obj-dir/objdir-tb3/ipc/ipdl/_ipdlheaders -I/NEW-SSD/moz-obj-dir/objdir-tb3/third_party/libwebrtc/gen -I/NEW-SSD/NREF-COMM-CENTRAL/mozilla/ipc/chromium/src -I/NEW-SSD/NREF-COMM-CENTRAL/mozilla/third_party/libwebrtc -I/NEW-SSD/NREF-COMM-CENTRAL/mozilla/third_party/libwebrtc/third_party/abseil-cpp -I/NEW-SSD/NREF-COMM-CENTRAL/mozilla/tools/profiler/public -I/NEW-SSD/moz-obj-dir/objdir-tb3/dist/include -DMOZILLA_CLIENT -include /NEW-SSD/moz-obj-dir/objdir-tb3/mozilla-config.h -pthread -fno-sized-deallocation -fno-aligned-new -fno-builtin-strlen -Dfdatasync=fdatasync -DDEBUG_4GB_CHECK -DUSEHELGRIND=1 -DUSEVALGRIND=1 -DDEBUG -g -Werror -Wunreachable-code -Wmaybe-uninitialized -Wsign-compare -Wunused-result -Wunused-variable -Wformat -Wno-unknown-pragmas -Wno-switch -Wno-address-of-packed-member -Wmisleading-indentation -Wno-subobject-linkage -Wno-changes-meaning -fuse-ld=mold -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -g -g -O2 -fvar-tracking -gdwarf-4 -fvar-tracking-assignments -freorder-blocks -fno-omit-frame-pointer -funwind-tables -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wcomma-subscript -Wvolatile -Wno-deprecated-enum-enum-conversion -Wduplicated-cond -Wimplicit-fallthrough -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wformat -Wformat-overflow=2 -Wno-psabi -Wno-error=builtin-macro-redefined -fno-strict-aliasing -ffp-contract=off -MD -MP -MF .deps/Unified_cpp_streams_config_gn0.o.pp -fdiagnostics-color Unified_cpp_streams_config_gn0.cpp
...
In file included from /usr/include/c++/13/string:51,
from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/system_wrappers/string:3,
from /NEW-SSD/moz-obj-dir/objdir-tb3/dist/stl_wrappers/string:62,
from /NEW-SSD/NREF-COMM-CENTRAL/mozilla/third_party/libwebrtc/video/config/encoder_stream_factory.h:13,
from /NEW-SSD/NREF-COMM-CENTRAL/mozilla/third_party/libwebrtc/video/config/encoder_stream_factory.cc:10,
from Unified_cpp_streams_config_gn0.cpp:2:
In static member function ‘static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const cricket::{anonymous}::SimulcastFormat; _Up = cricket::{anonymous}::SimulcastFormat; bool _IsMove = false]’,
inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const cricket::{anonymous}::SimulcastFormat*; _OI = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30,
inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const cricket::{anonymous}::SimulcastFormat*; _OI = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42,
inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const cricket::{anonymous}::SimulcastFormat*; _OI = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31,
inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = const cricket::{anonymous}::SimulcastFormat*; _OI = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7,
inlined from ‘static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const cricket::{anonymous}::SimulcastFormat*; _ForwardIterator = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_uninitialized.h:147:27,
inlined from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const cricket::{anonymous}::SimulcastFormat*; _ForwardIterator = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_uninitialized.h:185:15,
inlined from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = const cricket::{anonymous}::SimulcastFormat*; _ForwardIterator = cricket::{anonymous}::SimulcastFormat*; _Tp = cricket::{anonymous}::SimulcastFormat]’ at /usr/include/c++/13/bits/stl_uninitialized.h:373:37,
inlined from ‘void std::vector<_Tp, _Alloc>::_M_range_insert(iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const cricket::{anonymous}::SimulcastFormat*; _Tp = cricket::{anonymous}::SimulcastFormat; _Alloc = std::allocator<cricket::{anonymous}::SimulcastFormat>]’ at /usr/include/c++/13/bits/vector.tcc:781:34:
/usr/include/c++/13/bits/stl_algobase.h:437:30: error: argument 1 null where non-null expected [-Werror=nonnull]
437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:437:30: note: in a call to built-in function ‘void* __builtin_memmove(void*, const void*, long unsigned int)’
In static member function ‘static _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const cricket::{anonymous}::SimulcastFormat; _Up = cricket::{anonymous}::SimulcastFormat; bool _IsMove = false]’,
inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const cricket::{anonymous}::SimulcastFormat*; _OI = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30,
inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const cricket::{anonymous}::SimulcastFormat*; _OI = cricket::{anonymous}::SimulcastFormat*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42,
inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const cricket::{anonymous}::SimulcastFormat*; _OI = __gnu_cxx::__normal_iterator<cricket::{anonymous}::SimulcastFormat*, vector<cricket::{anonymous}::SimulcastFormat> >]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31,
inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = const cricket::{anonymous}::SimulcastFormat*; _OI = __gnu_cxx::__normal_iterator<cricket::{anonymous}::SimulcastFormat*, vector<cricket::{anonymous}::SimulcastFormat> >]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7,
inlined from ‘void std::vector<_Tp, _Alloc>::_M_range_insert(iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const cricket::{anonymous}::SimulcastFormat*; _Tp = cricket::{anonymous}::SimulcastFormat; _Alloc = std::allocator<cricket::{anonymous}::SimulcastFormat>]’ at /usr/include/c++/13/bits/vector.tcc:792:16:
/usr/include/c++/13/bits/stl_algobase.h:437:30: error: argument 1 null where non-null expected [-Werror=nonnull]
437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:437:30: note: in a call to built-in function ‘void* __builtin_memmove(void*, const void*, long unsigned int)’
cc1plus: all warnings being treated as errors
gmake[4]: *** [/NEW-SSD/NREF-COMM-CENTRAL/mozilla/config/rules.mk:690: Unified_cpp_streams_config_gn0.o] Error 1
gmake[4]: Leaving directory '/NEW-SSD/moz-obj-dir/objdir-tb3/third_party/libwebrtc/video/config/streams_config_gn'
I have not investigated the problem in detail yet.
For now, I am passing -Wno-nonnull to the compilation of this particular file to build C-C TB successfully.
Updated•2 years ago
|
Comment 1•2 years ago
|
||
This is pretty strange. It seems to relate to an insert call (range-based) on a std::vector<SimulcastFormat>, which only comes up in one place as far as I can tell. I'm not seeing anything wrong with this, though.
https://searchfox.org/mozilla-central/source/third_party/libwebrtc/video/config/simulcast.cc#155-164
Updated•2 years ago
|
| Reporter | ||
Comment 2•2 years ago
|
||
(In reply to Byron Campen [:bwc] from comment #1)
This is pretty strange. It seems to relate to an insert call (range-based) on a std::vector<SimulcastFormat>, which only comes up in one place as far as I can tell. I'm not seeing anything wrong with this, though.
https://searchfox.org/mozilla-central/source/third_party/libwebrtc/video/config/simulcast.cc#155-164
It could be a problem with GCC-13, but I have not seen it until the day before when I updated the source tree for the first time in about two weeks. Aha, that seems to coincide with the date of the problematic part.
Hmm, someone might need to create a small test case that shows the issue
using cvise or something. My AM4 CPU may not be up to the task, esp. since I only assign 7 virtual cores to my linux image inside VirtualBox. Someone with AM5 AMD CPU that can fully utilize 16 virtual CPU cores or more may be able to narrowing down the issue using cvise quickly.
Description
•