https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119553
Bug ID: 119553 Summary: ICE: SIGSEGV in gcov_position (gcov-io.cc:67) with -fpath-coverage Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Compiler output: $ echo 'void foo(){}' | x86_64-pc-linux-gnu-gcc -fpath-coverage -xc - -wrapper valgrind,-q ==11948== Invalid read of size 1 ==11948== at 0x4E87329: ftell (in /lib64/libc.so.6) ==11948== by 0x111DAC3: gcov_position (gcov-io.cc:67) ==11948== by 0x111DAC3: gcov_write_tag(unsigned int) (gcov-io.cc:349) ==11948== by 0x2CCE8A6: find_paths(function*) (path-coverage.cc:533) ==11948== by 0x1578729: branch_prob(bool) (profile.cc:1616) ==11948== by 0x1788CC5: tree_profiling (tree-profile.cc:1932) ==11948== by 0x1788CC5: (anonymous namespace)::pass_ipa_tree_profile::execute(function*) (tree-profile.cc:2061) ==11948== by 0x153A327: execute_one_pass(opt_pass*) (passes.cc:2659) ==11948== by 0x153B706: execute_ipa_pass_list(opt_pass*) (passes.cc:3112) ==11948== by 0x1110CF6: ipa_passes (cgraphunit.cc:2228) ==11948== by 0x1110CF6: symbol_table::compile() [clone .part.0] (cgraphunit.cc:2351) ==11948== by 0x1113BFD: compile (cgraphunit.cc:2329) ==11948== by 0x1113BFD: symbol_table::finalize_compilation_unit() (cgraphunit.cc:2607) ==11948== by 0x168F9E1: compile_file() (toplev.cc:479) ==11948== by 0xEFE99F: do_compile (toplev.cc:2208) ==11948== by 0xEFE99F: toplev::main(int, char**) (toplev.cc:2371) ==11948== by 0xF001ED: main (main.cc:39) ==11948== Address 0x1 is not stack'd, malloc'd or (recently) free'd ==11948== during IPA pass: profile <stdin>: In function 'foo': <stdin>:1:1: internal compiler error: Segmentation fault 0x2df84a1 internal_error(char const*, ...) /repo/gcc-trunk/gcc/diagnostic-global-context.cc:517 0x168f3af crash_signal /repo/gcc-trunk/gcc/toplev.cc:322 0x111dac3 gcov_position /repo/gcc-trunk/gcc/gcov-io.cc:67 0x111dac3 gcov_write_tag(unsigned int) /repo/gcc-trunk/gcc/gcov-io.cc:349 0x2cce8a6 find_paths(function*) /repo/gcc-trunk/gcc/path-coverage.cc:533 0x1578729 branch_prob(bool) /repo/gcc-trunk/gcc/profile.cc:1616 0x1788cc5 tree_profiling /repo/gcc-trunk/gcc/tree-profile.cc:1932 0x1788cc5 execute /repo/gcc-trunk/gcc/tree-profile.cc:2061 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20250331105654-r15-9061-g5f2078ca11843e-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-20250331105654-r15-9061-g5f2078ca11843e-checking-yes-rtl-df-extra-nobootstrap-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 15.0.1 20250331 (experimental) (GCC)