Bug 15123 - AB-INT: gcc 12.3.1 segfault while building ccache - fedora 37 specific
Summary: AB-INT: gcc 12.3.1 segfault while building ccache - fedora 37 specific
Status: RESOLVED OBSOLETE
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 4.3 M4
Assignee: Naveen Gowda
QA Contact:
URL:
Whiteboard: AB-INT
Depends on:
Blocks:
 
Reported: 2023-05-18 19:53 UTC by Alexandre Belloni
Modified: 2023-11-16 15:44 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Belloni 2023-05-18 19:53:41 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5185/steps/14/logs/stdio

| FAILED: src/CMakeFiles/ccache_framework.dir/storage/local/LocalStorage.cpp.o
| /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/hosttools/g++ -DUSE_XXH_DISPATCH -DXXH_STATIC_LINKING_ONLY -I/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/build -I/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src -isystem/home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/recipe-sysroot-native/usr/include -O2 -pipe -DNDEBUG -std=c++17 -include /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/build/config.h -Wall -MD -MT src/CMakeFiles/ccache_framework.dir/storage/local/LocalStorage.cpp.o -MF src/CMakeFiles/ccache_framework.dir/storage/local/LocalStorage.cpp.o.d -o src/CMakeFiles/ccache_framework.dir/storage/local/LocalStorage.cpp.o -c /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src/storage/local/LocalStorage.cpp
| In file included from /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src/storage/local/LocalStorage.cpp:25:
| /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src/storage/local/LocalStorage.cpp: In instantiation of ‘storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)> [with auto:39 = unsigned char; auto:40 = std::function<void(double)>]’:
| /usr/include/c++/12/type_traits:2559:26:   required by substitution of ‘template<class _Fn, class ... _Args> static std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)), std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn = storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>&; _Args = {unsigned char, const std::function<void(double)>&}]’
| /usr/include/c++/12/type_traits:2570:55:   required from ‘struct std::__result_of_impl<false, false, storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>&, unsigned char, const std::function<void(double)>&>’
| /usr/include/c++/12/bits/std_function.h:348:9:   recursively required by substitution of ‘template<class _Result, class _Ret> struct std::__is_invocable_impl<_Result, _Ret, true, std::__void_t<typename _CTp::type> > [with _Result = std::__invoke_result<storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>&, unsigned char, const std::function<void(double)>&>; _Ret = void]’
| /usr/include/c++/12/bits/std_function.h:348:9:   required from ‘struct std::function<void(unsigned char, const std::function<void(double)>&)>::_Callable<storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>, storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>, std::__invoke_result<storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>&, unsigned char, const std::function<void(double)>&> >’
| /usr/include/c++/12/bits/std_function.h:353:8:   required by substitution of ‘template<class _Res, class ... _ArgTypes> template<class _Cond, class _Tp> using _Requires = std::__enable_if_t<_Cond::value, _Tp> [with _Cond = std::function<void(unsigned char, const std::function<void(double)>&)>::_Callable<storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>, storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>, std::__invoke_result<storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>&, unsigned char, const std::function<void(double)>&> >; _Tp = void; _Res = void; _ArgTypes = {unsigned char, const std::function<void(double)>&}]’
| /usr/include/c++/12/bits/std_function.h:434:9:   required by substitution of ‘template<class _Functor, class _Constraints> std::function<void(unsigned char, const std::function<void(double)>&)>::function(_Functor&&) [with _Functor = storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const auto:40&)>; _Constraints = <missing>]’
| /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src/storage/local/LocalStorage.cpp:701:24:   required from here
| /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src/Logging.hpp:33:7: internal compiler error: Segmentation fault
|    33 |       Logging::log(std::string_view(message_));                                \
|       |       ^~~~~~~
| /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src/Logging.hpp:39:27: note: in expansion of macro ‘LOG_RAW’
|    39 | #define LOG(format_, ...) LOG_RAW(fmt::format(FMT_STRING(format_), __VA_ARGS__))
|       |                           ^~~~~~~
| /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2675876/tmp/work/x86_64-linux/ccache-native/4.8-r0/ccache-4.8/src/storage/local/LocalStorage.cpp:710:13: note: in expansion of macro ‘LOG’
|   710 |             LOG("Failed to acquire content lock for {}/{}", l1_index, l2_index);
|       |             ^~~
| Please submit a full bug report, with preprocessed source.
| See <http://bugzilla.redhat.com/bugzilla> for instructions.
| Preprocessed source stored into /tmp/ccCNaot3.out file, please attach this to your bugreport.
Comment 1 Alexandre Belloni 2023-05-18 19:55:32 UTC
/tmp/ccCNaot3.out and build-st-2675876 are saved in bug-15123 on fedora37-ty-2
Comment 2 Randy MacLeod 2023-05-25 14:38:07 UTC
Please report to Fedora and see if they can fix it since it's a host gcc bug.
Comment 3 Ross Burton 2023-05-25 14:46:31 UTC
The "good" news is that this replicates on demand.
Comment 4 Ross Burton 2023-06-05 16:48:52 UTC
Filed https://bugzilla.redhat.com/show_bug.cgi?id=2212474.
Comment 5 Alexandre Belloni 2023-06-09 17:52:33 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5244/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-1
Comment 6 Alexandre Belloni 2023-07-11 10:44:04 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5432/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-1
Comment 7 Alexandre Belloni 2023-07-19 14:41:04 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5338/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-3
Comment 8 Alexandre Belloni 2023-07-19 16:59:46 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5346/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-3
Comment 9 Alexandre Belloni 2023-07-19 22:57:30 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5490/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-1
Comment 10 Alexandre Belloni 2023-07-20 14:42:15 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5314/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-3
Comment 11 Alexandre Belloni 2023-07-20 17:43:26 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5325/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-1
Comment 12 Alexandre Belloni 2023-08-02 15:39:54 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5537/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-3
Comment 13 Alexandre Belloni 2023-08-02 19:47:52 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5542/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-1
Comment 14 Luca Ceresoli 2023-08-25 14:40:26 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5643/steps/14/logs/stdio

oe-selftest-fedora on fedora37-ty-1
Comment 15 Alexandre Belloni 2023-09-20 22:17:41 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5726/steps/14/logs/stdio

oe-selftest-fedora fedora37-ty-3
Comment 16 Naveen Gowda 2023-10-30 11:41:59 UTC
The issue has been fixed in gcc trunk and gcc-12
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109241
Comment 17 Naveen Gowda 2023-10-30 12:49:44 UTC
Master branch has gcc-13 and the patch is present in yocto source.
Comment 18 Naveen Gowda 2023-10-30 12:49:44 UTC
Master branch has gcc-13 and the patch is present in yocto source.
Comment 19 Richard Purdie 2023-10-30 14:19:39 UTC
This is building ccache-native using gcc from the host system so the Yocto Project version of gcc won't help here unfortunately
Comment 20 Naveen Gowda 2023-11-01 02:58:48 UTC
Thanks very much for the clarification.

I am trying to reproduce the issue on Fedora-38 without much luck. 
Linux yow-fedora-builder1 6.5.7-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 11 04:07:58 UTC 2023 x86_64 GNU/Linux

Its using the gcc-13 which probably has the fix
/usr/bin/gcc --version
gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)

As I understand, the solution to the issue is upgrading host gcc to latest version gcc-13 which has the patch. Can you please let me know if its right?

Thanks
Comment 21 Randy MacLeod 2023-11-01 13:12:36 UTC
Naveen, no the solution has to only involve changes in bitbake/oe-core or sending a patch to Fedora (37) to fix this issue. Have you tried to reproduce the issue in a F37 docker container? I has never been seen in Fedora 38.

F37 is almost at EOL, based on this trend: 
   https://docs.fedoraproject.org/en-US/releases/eol/
but it's possible that it would be the basis of RHEL 10:
   https://docs.fedoraproject.org/en-US/quick-docs/fedora-and-red-hat-enterprise-linux/index.html

See if you can make progress using a F37 container but otherwise, it may be best to just wait this out until the F37 EOL date and resolve the issue as obsolete.
Comment 22 Naveen Gowda 2023-11-02 10:20:05 UTC
Hi Randy,

Thanks for the detailed clarification about the status and issue.

Naveen
Comment 23 Randy MacLeod 2023-11-16 15:44:12 UTC
Fedora 37 is EOL and this bug was only seen in that distro.