This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -fsanitize=nonnull-attribute failing on empty container
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Lars Gullik BjÃnnes <larsbj at gullik dot org>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 28 May 2015 19:17:27 +0100
- Subject: Re: -fsanitize=nonnull-attribute failing on empty container
- Authentication-results: sourceware.org; auth=none
- References: <CAOYg4Aw44HkTRB2mmNkc8ntO2_QsvoCMhTox_gU_mpg_j_wGRg at mail dot gmail dot com> <CAH6eHdSq4eUZL4csPPL28Hsbz68A2LCm5RxAdiYWzobBLmby9Q at mail dot gmail dot com> <CAOYg4Ax4QGZ8=Sk4cuzSG1HUt2C7wfeCY1aJLDOaEXSkQGzZdQ at mail dot gmail dot com>
On 28 May 2015 at 19:16, Lars Gullik BjÃnnes <larsbj@gullik.org> wrote:
> Yes, I could have posted the backtrace as well:
>
> #0 __ubsan::__ubsan_handle_nonnull_arg_abort (Data=0x65cf6a00)
> at ../../../../../gcc/libsanitizer/ubsan/ubsan_handlers.cc:408
> #1 0x5d74e3dc in equal<unsigned int> (__first2=<optimized out>,
> __last1=<optimized out>,
> __first1=<optimized out>) at
> /opt/gcc/gcc-5/include/c++/5.1.1/bits/stl_algobase.h:825
> #2 __equal_aux<unsigned int const*, unsigned int const*>
> (__first2=<optimized out>,
> __last1=<optimized out>, __first1=<optimized out>)
> at /opt/gcc/gcc-5/include/c++/5.1.1/bits/stl_algobase.h:842
> #3 equal<__gnu_cxx::__normal_iterator<unsigned int const*,
> std::vector<unsigned int> >, __gnu_cxx::_
> _normal_iterator<unsigned int const*, std::vector<unsigned int> > >
> (__first2=..., __last1=...,
> __first1=...) at /opt/gcc/gcc-5/include/c++/5.1.1/bits/stl_algobase.h:1063
> #4 operator==<unsigned int, std::allocator<unsigned int> > (__y=..., __x=...)
> at /opt/gcc/gcc-5/include/c++/5.1.1/bits/stl_vector.h:1513
> ...
>
> template<>
> struct __equal<true>
> {
> template<typename _Tp>
> static bool
> equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
> {
> return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
> * (__last1 - __first1));
> }
> };
>
> is seemingly where it ends up.
Yeah, I'll commit a fix shortly, thanks.
And I'm definitely going to make it possible to run the testsuite with
the sanitizers!