public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "franek.balcerak at o2 dot pl" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/101476] New: AddressSanitizer check failed, points out a (potentially) non-existing stack error
Date: Fri, 16 Jul 2021 19:43:56 +0000	[thread overview]
Message-ID: <bug-101476-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101476

            Bug ID: 101476
           Summary: AddressSanitizer check failed, points out a
                    (potentially) non-existing stack error
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: franek.balcerak at o2 dot pl
                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, marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51167
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51167&action=edit
the preprocessed file

Is an issue with GCC 10.3 and GCC 11.1
C language
x86_64-linux-gnu
Ubuntu 11.1.0-1ubuntu1~21.04

Configured with: ../src/configure -v --with-pkgversion='Ubuntu
11.1.0-1ubuntu1~21.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-11
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-11-RPS7jb/gcc-11-11.1.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-RPS7jb/gcc-11-11.1.0/debian/tmp-gcn/usr
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2

Command: gcc bug.i -o bug -fsanitize=address -pthread && ./bug
Output:

==164550==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/asan/asan_thread.cpp:367 "((ptr[0] ==
kCurrentStackFrameMagic)) != (0)" (0x0, 0x0)
    #0 0x7f649a4fdd68 in AsanCheckFailed
../../../../src/libsanitizer/asan/asan_rtl.cpp:74
    #1 0x7f649a51e69e in __sanitizer::CheckFailed(char const*, int, char
const*, unsigned long long, unsigned long long)
../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:78
    #2 0x7f649a5034ec in __asan::AsanThread::GetStackFrameAccessByAddr(unsigned
long, __asan::AsanThread::StackFrameAccess*)
../../../../src/libsanitizer/asan/asan_thread.cpp:367
    #3 0x7f649a46deab in __asan::GetStackAddressInformation(unsigned long,
unsigned long, __asan::StackAddressDescription*)
../../../../src/libsanitizer/asan/asan_descriptions.cpp:203
    #4 0x7f649a46f2e8 in
__asan::AddressDescription::AddressDescription(unsigned long, unsigned long,
bool) ../../../../src/libsanitizer/asan/asan_descriptions.cpp:455
    #5 0x7f649a46f2e8 in
__asan::AddressDescription::AddressDescription(unsigned long, unsigned long,
bool) ../../../../src/libsanitizer/asan/asan_descriptions.cpp:439
    #6 0x7f649a471a94 in __asan::ErrorGeneric::ErrorGeneric(unsigned int,
unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned
long) ../../../../src/libsanitizer/asan/asan_errors.cpp:389
    #7 0x7f649a4fd385 in __asan::ReportGenericError(unsigned long, unsigned
long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool)
../../../../src/libsanitizer/asan/asan_report.cpp:476
    #8 0x7f649a494038 in __interceptor_sigaltstack
../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:9996
    #9 0x7f649a512bfd in __sanitizer::UnsetAlternateSignalStack()
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:194
    #10 0x7f649a5029ec in __asan::AsanThread::Destroy()
../../../../src/libsanitizer/asan/asan_thread.cpp:104
    #11 0x7f649a426430 in __nptl_deallocate_tsd nptl/pthread_create.c:303
    #12 0x7f649a427470 in __nptl_deallocate_tsd nptl/pthread_create.c:258
    #13 0x7f649a427470 in start_thread nptl/pthread_create.c:484
    #14 0x7f649a349d52 in clone (/lib/x86_64-linux-gnu/libc.so.6+0x117d52)


.i file attached.

Additional notes: does not trigger a segfault when not using a sanitizer.
Removing the sanitizer and then adding the -fstack-protector-all flag does not
crash the program. That makes me think it might not be a problem with the code.

             reply	other threads:[~2021-07-16 19:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 19:43 franek.balcerak at o2 dot pl [this message]
2021-07-22 10:19 ` [Bug sanitizer/101476] " marxin at gcc dot gnu.org
2022-01-18 17:01 ` stsp at users dot sourceforge.net
2022-01-18 17:56 ` stsp at users dot sourceforge.net
2022-01-18 18:14 ` stsp at users dot sourceforge.net
2022-01-18 20:24 ` stsp at users dot sourceforge.net
2022-01-18 22:23 ` stsp at users dot sourceforge.net
2022-01-18 23:01 ` stsp at users dot sourceforge.net
2022-01-19  9:04 ` marxin at gcc dot gnu.org
2022-01-19 14:02 ` stsp at users dot sourceforge.net
2022-01-19 14:13 ` marxin at gcc dot gnu.org
2022-01-20  9:58 ` stsp at users dot sourceforge.net
2022-01-21  9:43 ` pinskia at gcc dot gnu.org
2022-01-25 10:35 ` [Bug sanitizer/101476] AddressSanitizer check failed, points out a (potentially) non-existing stack error and pthread_cancel stsp at users dot sourceforge.net
2022-01-25 11:25 ` marxin at gcc dot gnu.org
2022-01-25 11:31 ` stsp at users dot sourceforge.net
2022-01-25 18:28 ` stsp at users dot sourceforge.net
2022-02-11 12:45 ` stsp at users dot sourceforge.net
2022-10-18 18:03 ` stsp at users dot sourceforge.net
2023-03-19 16:58 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101476-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).