Created attachment 860451 [details] emerge info When I run distcc with "cc" or "gcc" as compiler, I get a segfault. This does not occur when using "aarch64-gentoo-linux-musl-gcc". System configuration: gentoo musl hardened profile. This problem does not occur on my laptop with non-hardened profile. I recompiled with address sanitizer and found the issue comes from the `dcc_gcc_rewrite_fqn` function. There is an upstream patch available. Unfortunately, the patch is from July 2021 and no release have been made since May 2021. This bug prevents from using distcc when the compiler is "cc", "gcc", "c++, ... Patch: https://github.com/distcc/distcc/commit/879b71d6e95673e58d33f6c3c341a893ee307161 Old issue asking for a new release: https://github.com/distcc/distcc/issues/450 Segfault: $ DISTCC_VERBOSE=1 distcc cc -c -o /tmp/test.o /tmp/test.c distcc[31117] (dcc_trace_version) distcc 3.4 aarch64-gentoo-linux-musl; built Apr 19 2023 03:39:54 distcc[31117] (dcc_recursion_safeguard) safeguard level=0 distcc[31117] (main) compiler name is "distcc" distcc[31117] (dcc_scan_args) scanning arguments: cc -c -o /tmp/test.o /tmp/test.c distcc[31117] (dcc_scan_args) found object/output file "/tmp/test.o" distcc[31117] (dcc_scan_args) found input file "/tmp/test.c" distcc[31117] compile from test.c to test.o distcc[31117] (dcc_rewrite_generic_compiler) Rewriting 'cc' to 'gcc' distcc[31117] (dcc_gcc_rewrite_fqn) Re-writing call to 'gcc' to 'aarch64-gentoo-linux-musl-gcc' to support cross-compilation. Segmentation fault
Created attachment 860452 [details] address sanitizer report
Maybe I should have selected the "Hardened" component rather than "Current packages" since it seems to only affect hardened profiles, but I'm not sure.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82469e1b6888efad9c7e08dec227694c9f1684c8 commit 82469e1b6888efad9c7e08dec227694c9f1684c8 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-04-20 19:21:39 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-20 19:36:50 +0000 sys-devel/distcc: backport corruption fix Closes: https://bugs.gentoo.org/904720 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/distcc/distcc-3.4-r2.ebuild | 182 +++++++++++++++++++++ ...cc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch | 65 ++++++++ 2 files changed, 247 insertions(+)