Closed Bug 1810584 Opened 1 year ago Closed 1 year ago

(gcc 12) regexp-parser.cc:1915:35: error: 'this' pointer is null [-Werror=nonnull]

Categories

(Core :: JavaScript Engine, defect)

Firefox 110
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: s.bahro+bmo, Assigned: iain)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file ff110_build.log.xz

Steps to reproduce:

Building Firefox 110b1 on Gentoo.
Attached compressed build.log

Actual results:

Error during compile phase:
0:28.22 inlined from 'bool v8::internal::{anonymous}::{anonymous}::LookupPropertyValueName(UProperty, const char*, bool, v8::internal::ZoneList<v8::internal::CharacterRange>, v8::internal::CharacterClassStrings, v8::internal::RegExpFlags, v8::internal::Zone*)' at /var/tmp/portage/www-client/firefox-110.0_beta1/work/firefox-110.0/js/src/irregexp/imported/regexp-parser.cc:1915:35:
0:28.22 /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_tree.h:2434:46: error: 'this' pointer is null [-Werror=nonnull]
0:28.22 2434 | auto __res = _M_get_insert_unique_pos(__z._M_key());
0:28.22 | ^
0:28.22 /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_tree.h: In function 'bool v8::internal::{anonymous}::{anonymous}::LookupPropertyValueName(UProperty, const char*, bool, v8::internal::ZoneList<v8::internal::CharacterRange>, v8::internal::CharacterClassStrings, v8::internal::RegExpFlags, v8::internal::Zone*)':

Added "-Wno-error=nonnull" to the regex component to finish the build for now. Not a good solution I'd guess.

I think this report belongs to the Firefox build system product. If incorrect, please set a more appropriate one.

Component: Untriaged → General
OS: Unspecified → Linux
Product: Firefox → Firefox Build System
Hardware: Unspecified → x86_64
Component: General → JavaScript Engine
Product: Firefox Build System → Core

(In reply to s.bahro+bmo from comment #0)

Error during compile phase:
0:28.22 inlined from 'bool v8::internal::{anonymous}::{anonymous}::LookupPropertyValueName(UProperty, const char*, bool, v8::internal::ZoneList<v8::internal::CharacterRange>, v8::internal::CharacterClassStrings, v8::internal::RegExpFlags, v8::internal::Zone*)' at /var/tmp/portage/www-client/firefox-110.0_beta1/work/firefox-110.0/js/src/irregexp/imported/regexp-parser.cc:1915:35:
0:28.22 /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_tree.h:2434:46: error: 'this' pointer is null [-Werror=nonnull]
0:28.22 2434 | auto __res = _M_get_insert_unique_pos(__z._M_key());
0:28.22 | ^
0:28.22 /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_tree.h: In function 'bool v8::internal::{anonymous}::{anonymous}::LookupPropertyValueName(UProperty, const char*, bool, v8::internal::ZoneList<v8::internal::CharacterRange>, v8::internal::CharacterClassStrings, v8::internal::RegExpFlags, v8::internal::Zone*)':

same here

firefox 110.0b1

##> gcc --version
gcc (GCC) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
##> uname -srvmo
Linux 6.0.12 #1 SMP Fri Dec 9 08:04:01 CET 2022 x86_64 GNU/Linux

This is a false positive.

In LookupSpecialPropertyValueName, we call LookupPropertyValueName("Unassigned") with a nullptr for result_strings. This is fine, because that query won't return any strings. ("Unassigned" only applies to codepoints that haven't been assigned a meaning yet. Strings only show up as results when there are multi-character sequences that have some property we care about.)

However, the compiler doesn't know that. After inlining, it looks like we could call ExtractStringsFromUnicodeSet with a nullptr for result_strings. Note that ExtractStringsFromUnicodeSet asserts that this doesn't happen.

We import this code from V8, so fixing it in source would involve sending a patch upstream and then refreshing our import. Honestly, adding -wnoerror=nonnull might be the best solution. (In general, we've tried to avoid playing whack-a-mole sending fixes to silence warnings from compiler configurations V8 doesn't test.) IIUC, nonnull is a gcc-only flag?

Assignee: nobody → iireland
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9312900 - Attachment description: Bug 1810584: Suppress false positive error for gcc r=mgaudet → Bug 1810584: Suppress false positive error for gcc r=mgaudet!

I'll note: that line is uncovered according to our coverage testing (without looking further, maybe this means upstream can remove it?)

It's uncovered because it was added to support the /v flag, which we haven't hooked up yet. It should be covered once we implement that.

That makes sense :)

Pushed by iireland@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a9aa9d5248b7
Suppress false positive error for gcc r=mgaudet

(In reply to Iain Ireland [:iain] from comment #4)

Note that ExtractStringsFromUnicodeSet asserts that this doesn't happen.

That's however an assert on debug builds only. That's why GCC doesn't know. I'd argue it's not wrong.

Backed out for causing spider-monkey build bustages on RegExpNativeMacroAssembler.

Push with failures

Failure log

Backout link

[task 2023-01-18T22:13:05.690Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/irregexp'
[task 2023-01-18T22:13:05.690Z] /builds/worker/fetches/gcc/bin/g++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -std=gnu++17 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -o RegExpNativeMacroAssembler.o -c  -I/builds/worker/workspace/obj-spider/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DWASM_SUPPORTS_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/checkouts/gecko/js/src/irregexp -I/builds/worker/workspace/obj-spider/js/src/irregexp -I/builds/worker/workspace/obj-spider/js/src -I/builds/worker/checkouts/gecko/js/src -I/builds/worker/workspace/obj-spider/dist/include -I/builds/worker/workspace/obj-spider/dist/include/nspr -I/builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-spider/js/src/js-confdefs.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wno-error=deprecated -Wduplicated-cond -Wimplicit-fallthrough -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -Wno-psabi -Werror=format -Wno-attributes -Wno-error=type-limits -Wno-error=return-type -Wno-error=non-null -DV8_INTL_SUPPORT -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/RegExpNativeMacroAssembler.o.pp   /builds/worker/checkouts/gecko/js/src/irregexp/RegExpNativeMacroAssembler.cpp
[task 2023-01-18T22:13:05.690Z] cc1plus: error: -Werror=non-null: no option -Wnon-null
[task 2023-01-18T22:13:05.690Z] gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:675: RegExpNativeMacroAssembler.o] Error 1
[task 2023-01-18T22:13:05.690Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/irregexp'
[task 2023-01-18T22:13:05.704Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2023-01-18T22:13:05.704Z] mkdir -p '.deps/'
[task 2023-01-18T22:13:05.704Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2023-01-18T22:13:05.704Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/irregexp'
[task 2023-01-18T22:13:05.704Z] js/src/irregexp/regexp-ast.o
[task 2023-01-18T22:13:05.704Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/irregexp'
[task 2023-01-18T22:13:05.727Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2023-01-18T22:13:05.727Z] js/src/jit/Unified_cpp_js_src_jit0.o
[task 2023-01-18T22:13:05.727Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/jit'
[task 2023-01-18T22:13:05.756Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/config/external/nspr/ds'
[task 2023-01-18T22:13:05.757Z] config/external/nspr/ds/plhash.o
[task 2023-01-18T22:13:05.757Z] /builds/worker/fetches/gcc/bin/gcc --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -std=gnu99 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -o plhash.o -c  -I/builds/worker/workspace/obj-spider/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -D_NSPR_BUILD_ -I/builds/worker/checkouts/gecko/config/external/nspr/ds -I/builds/worker/workspace/obj-spider/config/external/nspr/ds -I/builds/worker/checkouts/gecko/config/external/nspr -I/builds/worker/checkouts/gecko/nsprpub/pr/include -I/builds/worker/workspace/obj-spider/dist/include -I/builds/worker/workspace/obj-spider/dist/include/nspr -I/builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -include /builds/worker/workspace/obj-spider/js/src/js-confdefs.h -DMOZILLA_CLIENT -fPIC -ffunction-sections -fdata-sections -fno-math-errno -pthread -pipe -gdwarf-4 -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wduplicated-cond -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -Werror=implicit-function-declaration -Wno-psabi -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/plhash.o.pp   /builds/worker/checkouts/gecko/nsprpub/lib/ds/plhash.c
[task 2023-01-18T22:13:05.757Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/config/external/nspr/ds'
[task 2023-01-18T22:13:05.757Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-spider/js/src/irregexp'
[task 2023-01-18T22:13:05.757Z] /builds/worker/fetches/gcc/bin/g++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -std=gnu++17 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -o regexp-ast.o -c  -I/builds/worker/workspace/obj-spider/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DWASM_SUPPORTS_HUGE_MEMORY -DJS_CACHEIR_SPEW -DJS_STRUCTURED_SPEW -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/builds/worker/checkouts/gecko/js/src/irregexp -I/builds/worker/workspace/obj-spider/js/src/irregexp -I/builds/worker/workspace/obj-spider/js/src -I/builds/worker/checkouts/gecko/js/src -I/builds/worker/workspace/obj-spider/dist/include -I/builds/worker/workspace/obj-spider/dist/include/nspr -I/builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-spider/js/src/js-confdefs.h -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -freorder-blocks -O3 -fno-omit-frame-pointer -funwind-tables -Werror -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wno-error=deprecated -Wduplicated-cond -Wimplicit-fallthrough -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -Wno-psabi -Werror=format -Wno-attributes -Wno-error=type-limits -Wno-error=return-type -Wno-error=non-null -DV8_INTL_SUPPORT -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/regexp-ast.o.pp   /builds/worker/checkouts/gecko/js/src/irregexp/imported/regexp-ast.cc
[task 2023-01-18T22:13:05.757Z] cc1plus: error: -Werror=non-null: no option -Wnon-null
[task 2023-01-18T22:13:05.757Z] gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:674: regexp-ast.o] Error 1
[task 2023-01-18T22:13:05.757Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-spider/js/src/irregexp'
Flags: needinfo?(iireland)

Oops, nonnull != non-null.

Flags: needinfo?(iireland)
Pushed by iireland@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0a20a4613cc4
Suppress false positive error for gcc r=mgaudet
Blocks: build-gcc-12
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: