From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB4A33858D28; Mon, 6 May 2024 03:37:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB4A33858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714966652; bh=VRa9Atpjr6LtKusEDbIFTV6V/DrWO9KyZ1B6LHvDlLE=; h=From:To:Subject:Date:From; b=LEReER7xUewaqlRQ901MY/Q0Qymvgfbha4yN22HHEIN2jZg5tb9icfiz1l3u4EXEx 75L95nQVE0r917u6JGceSCJZYP8Uvl/V+KCX8WpLttjoNmiCYSyYkgsSGRN3n2GBFi RJ/2WicvdUyeuRsgxpooSF7ZVbiAqykW0NSEiDoA= From: "iamanonymous.cs at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/114956] New: Segmentation fault with -fsanitize=address -fsanitize=null -O2 when attribute no_sanitize_address is enabled Date: Mon, 06 May 2024 03:37:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iamanonymous.cs at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114956 Bug ID: 114956 Summary: Segmentation fault with -fsanitize=3Daddress -fsanitize=3Dnull -O2 when attribute no_sanitize_address is enabled Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: iamanonymous.cs at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- Compiler Explorer: https://godbolt.org/z/33rbWdf49 ***************************************************************************= **** gcc version: $ gcc -v Using built-in specs. COLLECT_GCC=3D/home/gcc_set/gcc-trunk/bin/gcc COLLECT_LTO_WRAPPER=3D/home/gcc_set/gcc-trunk/libexec/gcc/aarch64-unknown-l= inux-gnu/15.0.0/lto-wrapper Target: aarch64-unknown-linux-gnu Configured with: ../gcc/configure --prefix=3D/home/gcc_set/gcc-trunk --with-gmp=3D/home/build_essential --with-mpfr=3D/home/build_essential --with-mpc=3D/home/build_essential --enable-languages=3Dc,c++ --disable-mul= tilib --with-sanitizer=3Daddress,undefined,thread,leakcd CC=3Dgcc CXX=3Dg++ Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20240430 (experimental) (GCC) git version: 22b20ac6c6aead2d3f36c413a77dd0b80adfec39 ***************************************************************************= **** Program: $ cat mutant.c int **a; __attribute__((always_inline)) int *c() { int b[1]; b; } __attribute__((no_sanitize_address)) static char d() { *a =3D c(); } void e() { d(); } ***************************************************************************= **** Command Lines: $ gcc -fsanitize=3Daddress -fsanitize=3Dnull -O2 -c mutant.c mutant.c:2:37: warning: 'always_inline' function might not be inlinable unl= ess also declared 'inline' [-Wattributes] 2 | __attribute__((always_inline)) int *c() { | ^ during GIMPLE pass: sanopt mutant.c: In function 'd.isra': mutant.c:6:50: internal compiler error: Segmentation fault 6 | __attribute__((no_sanitize_address)) static char d() { *a =3D c(); } | ^ 0xf2d49b crash_signal ../../gcc/gcc/toplev.cc:319 0xf3fcfc contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.h:3769 0xf3fcfc build_shadow_mem_access ../../gcc/gcc/asan.cc:2552 0xf4b90f asan_expand_mark_ifn(gimple_stmt_iterator*) ../../gcc/gcc/asan.cc:3854 0xf5f6bf execute ../../gcc/gcc/sanopt.cc:1379 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions=