https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119727
Bug ID: 119727
Summary: -freport-bug vs. ASLR
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: driver
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
ASLR breaks -freport-bug.
E.g. in --enable-host-pie configured gcc trying to reproduce PR116747 ICE, I
see
./xgcc -B ./ -S -fno-tree-fre -fno-tree-dse -O3 pr116747.c -freport-bug
during GIMPLE pass: cselim
pr116747.c: In function âfâ:
pr116747.c:3:5: internal compiler error: Segmentation fault
3 | int f(int a, int b, int c)
| ^
0x55c57269b711 internal_error(char const*, ...)
../../gcc/diagnostic-global-context.cc:517
0x55c5711dde03 crash_signal
../../gcc/toplev.cc:322
0x55c570e29d27 phi_nodes_ptr(basic_block_def*)
../../gcc/gimple.h:4705
0x55c570e29d27 gsi_start_phis(basic_block_def*)
../../gcc/gimple-iterator.cc:937
0x55c570e29d27 gsi_for_stmt(gimple*)
../../gcc/gimple-iterator.cc:621
0x55c5713ccd65 cond_if_else_store_replacement_1
../../gcc/tree-ssa-phiopt.cc:3691
0x55c5713d42c7 cond_if_else_store_replacement
../../gcc/tree-ssa-phiopt.cc:3953
0x55c5713d42c7 operator()
../../gcc/tree-ssa-phiopt.cc:4682
0x55c5713d42c7 execute_over_cond_phis<(anonymous
namespace)::pass_cselim::execute(function*)::<lambda(basic_block, basic_block,
basic_block, edge, edge, bool, gcond*)> >
../../gcc/tree-ssa-phiopt.cc:4235
0x55c5713d42c7 execute
../../gcc/tree-ssa-phiopt.cc:4702
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
The ICE is actually reproduceable, but -freport-bug doesn't prepare
preprocessed output, because the hexadecimal addresses at the start of the
lines from libbacktrace differ between different iterations. Even for non-PIE
cc1/cc1plus there could be libc addresses in the backtrace (say if there is a
SIGSEGV inside of strlen/memcpy or other library function).