https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101425
Bug ID: 101425 Summary: [12 Regression] AddressSanitizer: heap-buffer-overflow at candidates_list_and_hint since r12-1903-gaf9987e817f54806 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: burnus at gcc dot gnu.org Target Milestone: --- Since the revision, I see: $ echo "" | valgrind --trace-children=yes gcc -foffload=amdgcn-amdhsa -c -x c - ==22404== Memcheck, a memory error detector ==22404== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==22404== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright info ==22404== Command: gcc -foffload=amdgcn-amdhsa -c -x c - ==22404== gcc: error: GCC is not configured to support 'amdgcn-amdhsa' as offload target ==22404== Invalid write of size 1 ==22404== at 0x4237A7: candidates_list_and_hint(char const*, char*&, auto_vec<char const*, 0ul> const&) (opts-common.c:1294) ==22404== by 0x40BF08: check_offload_target_name(char const*, long) (gcc.c:4018) ==22404== by 0x40CA73: handle_foffload_option (gcc.c:4105) ==22404== by 0x40CA73: driver_handle_option(gcc_options*, gcc_options*, cl_decoded_option const*, unsigned int, int, unsigned int, cl_option_handlers const*, diagnostic_context*, void (*)()) (gcc.c:4582) ==22404== by 0x42420E: handle_option(gcc_options*, gcc_options*, cl_decoded_option const*, unsigned int, int, unsigned int, cl_option_handlers const*, bool, diagnostic_context*) (opts-common.c:1181) ==22404== by 0x42435C: read_cmdline_option(gcc_options*, gcc_options*, cl_decoded_option*, unsigned int, unsigned int, cl_option_handlers const*, diagnostic_context*) (opts-common.c:1431) ==22404== by 0x40E59E: process_command(unsigned int, cl_decoded_option*) (gcc.c:4912) ==22404== by 0x4171D5: driver::set_up_specs() const (gcc.c:8294) ==22404== by 0x40676C: driver::main(int, char**) (gcc.c:8102) ==22404== by 0x406D0F: main (gcc-main.c:47) ==22404== Address 0x4bb7b1f is 1 bytes before a block of size 1 alloc'd ==22404== at 0x483C70F: malloc (vg_replace_malloc.c:380) ==22404== by 0x4A640B: xmalloc (xmalloc.c:147) ==22404== by 0x423754: candidates_list_and_hint(char const*, char*&, auto_vec<char const*, 0ul> const&) (opts-common.c:1286) ==22404== by 0x40BF08: check_offload_target_name(char const*, long) (gcc.c:4018) ==22404== by 0x40CA73: handle_foffload_option (gcc.c:4105) ==22404== by 0x40CA73: driver_handle_option(gcc_options*, gcc_options*, cl_decoded_option const*, unsigned int, int, unsigned int, cl_option_handlers const*, diagnostic_context*, void (*)()) (gcc.c:4582) ==22404== by 0x42420E: handle_option(gcc_options*, gcc_options*, cl_decoded_option const*, unsigned int, int, unsigned int, cl_option_handlers const*, bool, diagnostic_context*) (opts-common.c:1181) ==22404== by 0x42435C: read_cmdline_option(gcc_options*, gcc_options*, cl_decoded_option*, unsigned int, unsigned int, cl_option_handlers const*, diagnostic_context*) (opts-common.c:1431) ==22404== by 0x40E59E: process_command(unsigned int, cl_decoded_option*) (gcc.c:4912) ==22404== by 0x4171D5: driver::set_up_specs() const (gcc.c:8294) ==22404== by 0x40676C: driver::main(int, char**) (gcc.c:8102) ==22404== by 0x406D0F: main (gcc-main.c:47)