[Bug sanitizer/88260] New: c++ code instrumented with address sanitizer crashes

2018-11-29 Thread mirhet.saracevic at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88260

Bug ID: 88260
   Summary: c++ code instrumented with address sanitizer crashes
   Product: gcc
   Version: 6.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mirhet.saracevic 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, marxin at 
gcc dot gnu.org
  Target Milestone: ---
Target: i686-elf

Created attachment 45117
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45117&action=edit
objectdump of the c++ code

Following C++ code compiled with GCC 6.3.0 and option -fsanitize=address
crashes. 

int increment(int &x) {
++x;
return 0;
}

int main(void)
{
int x = 0;
increment(x);
return 0;
}

Objectdump of the code attached.
The execution crahes on following line:
994:c7 83 00 00 00 20 f1movl   $0xf1f1f1f1,0x2000(%ebx)

[Bug sanitizer/88260] c++ code instrumented with address sanitizer crashes

2018-12-04 Thread mirhet.saracevic at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88260

--- Comment #2 from mirhet.saracevic at gmail dot com ---
Command line:
gcc -lstdc++ -lsupc++ -lm -lc -lgcc -lasan -O0 -g -fsanitize=address main.cpp

Output when using -v:
Target: i686-elf
Configured with: ../gcc-6.3.0/configure --prefix=/opt/V6.3.0 --target=i686-elf
--with-pic --with-newlib --enable-fully-dynamic-string --enable-languages=c,c++
--disable-initfini-array --disable-nls --disable-shared --disable-multilib
--disable-threads --disable-tls --disable-win32-registry
--enable-sjlj-exceptions --enable-frame-pointer --disable-__cxa_atexit
--disable-libgomp --disable-libquadmath --disable-libssp --disable-libada
--disable-libitm --disable-libstdcxx-verbose --disable-libstdcxx-visibility
--with-default-libstdcxx-abi=gcc4-compatible --without-headers : (reconfigured)
../gcc-6.3.0/configure --prefix=/opt/V6.3.0 --target=i686-elf --with-pic
--with-newlib --enable-fully-dynamic-string --enable-languages=c,c++
--disable-initfini-array --disable-nls --disable-shared --disable-multilib
--disable-threads --disable-tls --disable-win32-registry
--enable-sjlj-exceptions --enable-frame-pointer --disable-__cxa_atexit
--disable-libgomp --disable-libquadmath --disable-libssp --disable-libada
--disable-libitm --disable-libstdcxx-verbose --disable-libstdcxx-visibility
--with-default-libstdcxx-abi=gcc4-compatible --with-headers
Thread model: single
gcc version 6.3.0 (GCC)