Bug #37719
closedtest_mock_GetLockerRequest.cc:78:3: internal compiler error: Segmentation fault
0%
Description
it's a bug in GCC's preprocessor but just want to log it here to increase its "findability".
/usr/bin/c++ -DTEST_LIBRBD_INTERNALS -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D__linux__ -isystem /opt/ceph/include -I/home/kchai/ceph/build/src/include -I/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src -isystem /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/include -I/usr/include/nss -I/usr/include/nspr -isystem /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/xxHash -isystem /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/rapidjson/include -I/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/googletest/googlemock/include -I/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/googletest/googletest/include -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -Wno-unknown-pragmas -rdynamic -ftemplate-depth-1024 -Wnon-virtual-dtor -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -DCEPH_DEBUG_MUTEX -fstack-protector-strong -std=c++17 -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -g -fPIE -DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -o ~/test_mock_GetLockerRequest.bad.o -c /home/kchai/ceph/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc /home/kchai/ceph/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc:78:3: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
Thread 2.1 "cc1plus" received signal SIGSEGV, Segmentation fault. [Switching to process 2953] 0x0000000000729b34 in ggc_set_mark(void const*) () (gdb) bt #0 0x0000000000729b34 in ggc_set_mark(void const*) () #1 0x00000000006816e8 in gt_ggc_mx_lang_tree_node(void*) () #2 0x000000000066f654 in gt_ggc_mx(deferred_access_check&) () #3 0x000000000066f618 in gt_ggc_mx_vec_deferred_access_check_va_gc_(void*) () #4 0x000000000060a0d4 in gt_ggc_mx_tree_check(void*) () #5 0x000000000060a140 in gt_ggc_mx_vec_cp_token_va_gc_(void*) () #6 0x000000000060a1bc in gt_ggc_mx_cp_lexer(void*) () #7 0x000000000060a388 in gt_ggc_mx_cp_parser(void*) () #8 0x000000000088fdf8 in ?? () #9 0x000000000089009c in ggc_mark_roots() () #10 0x000000000072a550 in ggc_collect() () #11 0x000000000078cb40 in cgraph_node::finalize_function(tree_node*, bool) () #12 0x000000000066cd50 in expand_or_defer_fn(tree_node*) () #13 0x000000000062ca9c in ?? () #14 0x000000000062cd18 in ?? () #15 0x000000000060d554 in ?? () #16 0x000000000060ea94 in ?? () #17 0x000000000060f624 in ?? () #18 0x00000000006311ec in ?? () #19 0x0000000000631f50 in ?? () #20 0x000000000061017c in ?? () #21 0x00000000006363c4 in ?? () #22 0x0000000000636af8 in ?? () #23 0x0000000000610288 in ?? () #24 0x00000000006363c4 in ?? () #25 0x0000000000636af8 in ?? () #26 0x0000000000610288 in ?? () #27 0x00000000006363c4 in ?? () #28 0x00000000006366ec in c_parse_file() () #29 0x00000000007098f8 in c_common_parse_file() () #30 0x0000000000ab6018 in ?? () #31 0x0000000000573020 in toplev::main(int, char**) () #32 0x000000000057477c in main ()
g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/7/lto-wrapper Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 7.4.0-1ubuntu1~16.04~ppa1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu Thread model: posix gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~16.04~ppa1)
the funny thing is that the source can be preprocessed successfully with "-E", and it compiles just fine.
related bug reports:
Updated by Kefu Chai over 5 years ago
cannot reproduce this issue on GCC-8.
i am pointing the gcc/g++ on omani slaves to gcc-8 manually.
Updated by Kefu Chai over 5 years ago
cd /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/test/librbd && ccache /usr/bin/c++ -DTEST_LIBRBD_INTERNALS -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D__linux__ -isystem /opt/ceph/include -I/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/include -I/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src -isystem /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/include -I/usr/include/nss -I/usr/include/nspr -isystem /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/xxHash -isystem /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/rapidjson/include -I/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/googletest/googlemock/include -I/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/googletest/googletest/include -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -Wno-unknown-pragmas -rdynamic -ftemplate-depth-1024 -Wnon-virtual-dtor -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -DCEPH_DEBUG_MUTEX -fstack-protector-strong -std=c++17 -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -g -fPIE -DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -o CMakeFiles/unittest_librbd.dir/managed_lock/test_mock_GetLockerRequest.cc.o -c /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc
reproduces it.
please note, i cannot reproduce it by compiling it on the same machine with the same setting but with a different source dir like "/home/kchai/ceph"
Updated by Patrick Donnelly over 5 years ago
Kefu, on ceph-devel you said this was addressed. Did you mean that a ticket (i.e. this one) exists for the issue or that it's been fixed?
I'm still seeing this with a test build on top of today's master: https://jenkins.ceph.com/job/ceph-dev-new-build/ARCH=x86_64,AVAILABLE_ARCH=x86_64,AVAILABLE_DIST=centos7,DIST=centos7,MACHINE_SIZE=huge/16386//consoleFull
Updated by Kefu Chai over 5 years ago
Patrick, latter, but i was wrong. as i thought it happened on arm64 only. but it now shows up on both archs. =(
Updated by Kefu Chai over 5 years ago
now, master build on bionic is broken due to the ICE on GCC 7.3.
[ 98%] Building CXX object src/test/librbd/CMakeFiles/unittest_librbd.dir/managed_lock/test_mock_GetLockerRequest.cc.o cd /build/ceph-14.0.1-2005-g8928f1f/obj-x86_64-linux-gnu/src/test/librbd && /usr/bin/c++ -DTEST_LIBRBD_INTERNALS -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D__linux__ -isystem /build/ceph-14.0.1-2005-g8928f1f/obj-x86_64-linux-gnu/boost/include -I/build/ceph-14.0.1-2005-g8928f1f/obj-x86_64-linux-gnu/src/include -I/build/ceph-14.0.1-2005-g8928f1f/src -isystem /build/ceph-14.0.1-2005-g8928f1f/obj-x86_64-linux-gnu/include -I/usr/include/nss -I/usr/include/nspr -isystem /build/ceph-14.0.1-2005-g8928f1f/src/xxHash -isystem /build/ceph-14.0.1-2005-g8928f1f/src/rapidjson/include -I/build/ceph-14.0.1-2005-g8928f1f/src/googletest/googlemock/include -I/build/ceph-14.0.1-2005-g8928f1f/src/googletest/googletest/include -g -O2 -fdebug-prefix-map=/build/ceph-14.0.1-2005-g8928f1f=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -Wno-unknown-pragmas -rdynamic -g -O2 -fdebug-prefix-map=/build/ceph-14.0.1-2005-g8928f1f=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -ftemplate-depth-1024 -Wnon-virtual-dtor -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -fPIE -DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -std=c++1z -o CMakeFiles/unittest_librbd.dir/managed_lock/test_mock_GetLockerRequest.cc.o -c /build/ceph-14.0.1-2005-g8928f1f/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc /build/ceph-14.0.1-2005-g8928f1f/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc:78:3: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions. Preprocessed source stored into /tmp/ccyiq57b.out file, please attach this to your bugreport. === BEGIN GCC DUMP === 12318: // Target: x86_64-linux-gnu 12318: // Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-16ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --with-as=/usr/bin/x86_64-linux-gnu-as --with-ld=/usr/bin/x86_64-linux-gnu-ld --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 12318: // Thread model: posix 12318: // gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3) 12318: // 12318: // /build/ceph-14.0.1-2005-g8928f1f/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc:78:3: internal compiler error: Segmentation fault 12318: // } 12318: // ^ 12318: // Please submit a full bug report, 12318: // with preprocessed source if appropriate. 12318: // See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions. 12318: 12318: // /usr/lib/gcc/x86_64-linux-gnu/7/cc1plus -quiet -I /build/ceph-14.0.1-2005-g8928f1f/obj-x86_64-linux-gnu/src/include -I /build/ceph-14.0.1-2005-g8928f1f/src -I /usr/include/nss -I /usr/include/nspr -I /build/ceph-14.0.1-2005-g8928f1f/src/googletest/googlemock/include -I /build/ceph-14.0.1-2005-g8928f1f/src/googletest/googletest/include -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D TEST_LIBRBD_INTERNALS -D _FILE_OFFSET_BITS=64 -D _GNU_SOURCE -D __linux__ -D _FORTIFY_SOURCE=2 -D _FORTIFY_SOURCE=2 -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D HAVE_CONFIG_H -D __CEPH__ -D _REENTRANT -D _THREAD_SAFE -D __STDC_FORMAT_MACROS -isystem /build/ceph-14.0.1-2005-g8928f1f/obj-x86_64-linux-gnu/boost/include -isystem /build/ceph-14.0.1-2005-g8928f1f/obj-x86_64-linux-gnu/include -isystem /build/ceph-14.0.1-2005-g8928f1f/src/xxHash -isystem /build/ceph-14.0.1-2005-g8928f1f/src/rapidjson/include /build/ceph-14.0.1-2005-g8928f1f/src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc -quiet -dumpbase test_mock_GetLockerRequest.cc -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/unittest_librbd.dir/managed_lock/test_mock_GetLockerRequest.cc.o -g -g -O2 -O2 -Wformat=1 -Werror=format-security -Wall -Wtype-limits -Winit-self -Wpointer-arith -Werror=format-security -Wformat=1 -Werror=format-security -Wdate-time -Wnon-virtual-dtor -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wstrict-null-sentinel -Woverloaded-virtual -std=c++1z -fdiagnostics-color=auto -fdebug-prefix-map=/build/ceph-14.0.1-2005-g8928f1f=. -fstack-protector-strong -fno-strict-aliasing -fsigned-char -fdebug-prefix-map=/build/ceph-14.0.1-2005-g8928f1f=. -fstack-protector-strong -ftemplate-depth=1024 -fno-new-ttp-matching -fstack-protector-strong -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -fPIE -fstack-protector-strong -Wformat-security -o - -frandom-seed=0 -fdump-noaddr 12318: ... /// precompiled source here 12318: } === END GCC DUMP === src/test/librbd/CMakeFiles/unittest_librbd.dir/build.make:881: recipe for target 'src/test/librbd/CMakeFiles/unittest_librbd.dir/managed_lock/test_mock_GetLockerRequest.cc.o' failed make[4]: *** [src/test/librbd/CMakeFiles/unittest_librbd.dir/managed_lock/test_mock_GetLockerRequest.cc.o] Error 1
Updated by Kefu Chai over 5 years ago
an intermediate fix for https://github.com/ceph/ceph/pull/25727 by Sage.
Updated by Kefu Chai over 5 years ago
- Assignee set to Kefu Chai
a workaround https://github.com/ceph/ceph/pull/25733
Updated by Kefu Chai over 5 years ago
- Status changed from 12 to Fix Under Review
Updated by Kefu Chai over 5 years ago
#0 lookup_page_table_entry (p=p@entry=0x736c61663c6c616e) at ../../src/gcc/ggc-page.c:630 #1 ggc_set_mark (p=p@entry=0x736c61663c6c616e) at ../../src/gcc/ggc-page.c:1527 #2 0x00000000006a62e2 in gt_ggc_mx_lang_tree_node (x_p=0x736c61663c6c616e) at ./gt-cp-tree.h:133 #3 0x0000000000695671 in gt_ggc_mx (x_r=...) at ./gt-cp-semantics.h:36 #4 0x0000000000695653 in gt_ggc_mx<deferred_access_check> (v=<optimized out>) at ../../src/gcc/vec.h:1110 #5 gt_ggc_mx_vec_deferred_access_check_va_gc_ (x_p=0x7fffc0eb1630) at ./gt-cp-semantics.h:28 #6 0x0000000000632958 in gt_ggc_mx_tree_check (x_p=0x7fffc0e75d20) at ./gt-cp-parser.h:38 #7 0x00000000006329c3 in gt_ggc_mx<cp_token> (v=<optimized out>) at ../../src/gcc/vec.h:1110 #8 gt_ggc_mx_vec_cp_token_va_gc_ (x_p=0x7fffe5483000) at ./gt-cp-parser.h:49 #9 0x0000000000632a2d in gt_ggc_mx_cp_lexer (x_p=<optimized out>) at ./gt-cp-parser.h:76 #10 0x0000000000632b8e in gt_ggc_mx_cp_parser (x_p=0x7fffee896a20) at ./gt-cp-parser.h:136 #11 0x00000000008bd6d6 in ggc_mark_root_tab (rt=0x1260a40 <gt_ggc_r_gt_cp_parser_h>) at ../../src/gcc/ggc-common.c:77 #12 0x00000000008bd9b1 in ggc_mark_roots () at ../../src/gcc/ggc-common.c:94 #13 0x000000000074f6ed in ggc_collect () at ../../src/gcc/ggc-page.c:2197 #14 0x00000000007b3775 in cgraph_node::finalize_function (decl=decl@entry=0x7fffc0e67c00, no_collect=<optimized out>) at ../../src/gcc/cgraphunit.c:480 #15 0x0000000000692fb0 in expand_or_defer_fn (fn=fn@entry=0x7fffc0e67c00) at ../../src/gcc/cp/semantics.c:4313 #16 0x0000000000654ca5 in cp_parser_function_definition_after_declarator (parser=parser@entry=0x7fffee896a20, inline_p=inline_p@entry=true) at ../../src/gcc/cp/parser.c:26361 #17 0x0000000000654f85 in cp_parser_late_parsing_for_member (parser=parser@entry=0x7fffee896a20, member_function=0x7fffc0e67c00) at ../../src/gcc/cp/parser.c:27234 #18 0x0000000000636096 in cp_parser_class_specifier_1 (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:22412 #19 0x0000000000637342 in cp_parser_class_specifier (parser=0x7fffee896a20) at ../../src/gcc/cp/parser.c:22438 #20 cp_parser_type_specifier (parser=parser@entry=0x7fffee896a20, flags=flags@entry=1, decl_specs=decl_specs@entry=0x7fffffffde10, is_declaration=is_declaration@entry=true, declares_class_or_enum=declares_class_or_enum@entry=0x7fffffffdd80, is_cv_qualifier=is_cv_qualifier@entry=0x7fffffffdd7f) at ../../src/gcc/cp/parser.c:16511 #21 0x0000000000637f0d in cp_parser_decl_specifier_seq (parser=parser@entry=0x7fffee896a20, flags=flags@entry=1, decl_specs=decl_specs@entry=0x7fffffffde10, declares_class_or_enum=declares_class_or_enum@entry=0x7fffffffddf8) at ../../src/gcc/cp/parser.c:13407 #22 0x0000000000659752 in cp_parser_simple_declaration (parser=parser@entry=0x7fffee896a20, function_definition_allowed_p=true, maybe_range_for_decl=maybe_range_for_decl@entry=0x0) at ../../src/gcc/cp/parser.c:12722 #23 0x000000000065a5f6 in cp_parser_block_declaration (parser=parser@entry=0x7fffee896a20, statement_p=statement_p@entry=false) at ../../src/gcc/cp/parser.c:12669 #24 0x0000000000638a55 in cp_parser_declaration (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:12567 #25 0x000000000065eb9c in cp_parser_declaration_seq_opt (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:12443 #26 0x000000000065f297 in cp_parser_namespace_body (parser=0x7fffee896a20) at ../../src/gcc/cp/parser.c:18364 #27 cp_parser_namespace_definition (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:18340 #28 0x0000000000638b54 in cp_parser_declaration (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:12547 #29 0x000000000065eb9c in cp_parser_declaration_seq_opt (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:12443 #30 0x000000000065f297 in cp_parser_namespace_body (parser=0x7fffee896a20) at ../../src/gcc/cp/parser.c:18364 #31 cp_parser_namespace_definition (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:18340 #32 0x0000000000638b54 in cp_parser_declaration (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:12547 #33 0x000000000065eb9c in cp_parser_declaration_seq_opt (parser=parser@entry=0x7fffee896a20) at ../../src/gcc/cp/parser.c:12443 #34 0x000000000065ee83 in cp_parser_translation_unit (parser=0x7fffee896a20) at ../../src/gcc/cp/parser.c:4368 #35 c_parse_file () at ../../src/gcc/cp/parser.c:38533 (gdb) p table $12 = (page_table) 0x0 (gdb) p/x high_bits $13 = 0x736c616600000000 (gdb) p G.lookup $14 = (page_table) 0x1df7b30 (gdb) p/x G.lookup->high_bits $16 = 0x7fff0 (gdb) p/x high_bits $17 = 0x736c61660 (gdb) p/x G.lookup->next $18 = 0x0
Updated by Kefu Chai over 5 years ago
- Status changed from Fix Under Review to Resolved