lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Invalid pointer-pair?


From: Vadim Zeitlin
Subject: Re: [lmi] Invalid pointer-pair?
Date: Sat, 11 Jun 2022 22:31:33 +0200

On Sat, 11 Jun 2022 19:59:08 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:

GC> On 6/10/22 20:26, Greg Chicares wrote:
GC> > On 6/10/22 19:47, Greg Chicares wrote:
GC> [...]
GC> > Here's a pair of pointer-pair tests: the first fails, but the second 
succeeds,
GC> > apparently because it removes
GC> >   pointer-compare,pointer-subtract,
GC> > from '-fsanitize=' options.
GC> 
GC> BTW, the failing test still fails if I
GC>  - keep ",pointer-compare,pointer-subtract" in '-fsanitize=...'; yet
GC>  - set 'detect_invalid_pointer_pairs=0' in $ASAN_OPTIONS
GC> IOW, the 'pointer-whatever' options prevent linking 'zero_test' even
GC> if the environment variable attempts to nullify them. Linker error:
GC> 
GC> /usr/bin/ld: zero_test.o: in function `std::__cxx11::basic_stringbuf<char, 
std::char_traits<char>, std::allocator<char> >::str() const &':
GC> /usr/include/c++/11/sstream:245: undefined reference to 
`std::__cxx11::basic_stringbuf<char, std::char_traits<char>, 
std::allocator<char> >::_M_high_mark() const'
GC> collect2: error: ld returned 1 exit status

 ASAN_OPTIONS only affects execution of the programs using ASAN (it's
parsed by the code inside libasan.so which is preloaded into any program
linked with -fsanitize=address), so it's not surprising that it doesn't fix
the linking error -- in fact it would be extremely surprising if it did.

 But I still have no idea why/how does enabling ASAN triggers it. I could
look into it, but a quick search found another occurrence of the same
problem in https://github.com/cms-sw/cmssw/issues/36480 and I don't think
it's reasonable to resort to this kind of fragile workarounds in any case.
Also, they link to https://github.com/google/sanitizers/issues/1324 where
the ASAN maintainer (kcc) says that they don't consider the pointer-compare
feature production-ready and that it will probably only become usable in
HWSAN. So I won't do anything about this (i.e. attempt to find a
workaround) unless you tell me so -- but please do if you think it would be
worth it.

 Thanks,
VZ

Attachment: pgpWpHyNxNalI.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]