Spoke too early. Sorry for the noise.

-fsanitize=address does not seem to work on armv7l, it seems to crash on 
runtime (I thought it worked on compile-time only):

==1280== ERROR: AddressSanitizer: stack-buffer-overflow on address 
0xbe99efb0 at pc 0x29483 bp 0xbe99ef38 sp 0xbe99ef3c
WRITE of size 4 at 0xbe99efb0 thread T0
     #0 0x29481 (/home/ubuntu/fidelio/software/test+0x29481)
     #1 0x3376d (/home/ubuntu/fidelio/software/test+0x3376d)
(...)
     #251 0x3376d (/home/ubuntu/fidelio/software/test+0x3376d)
     #252 0x3376d (/home/ubuntu/fidelio/software/test+0x3376d)
==1280== AddressSanitizer CHECK failed: 
../../../../src/libsanitizer/asan/asan_report.cc:250 "((name_end)) != 
(0)" (0x0, 0x0)
     #0 0xb594dc61 (/usr/lib/arm-linux-gnueabihf/libasan.so.0.0.0+0xdc61)
     #1 0xb5953353 (/usr/lib/arm-linux-gnueabihf/libasan.so.0.0.0+0x13353)
(...)
     #254 0x3376d (/home/ubuntu/fidelio/software/test+0x3376d)

Or is this the expected behavior?

On 01/02/2015 06:15 PM, "João M. S. Silva" wrote:
> On 01/02/2015 07:04 AM, Tom Hughes wrote:
>> Try building with -fsanitize=address which is a clang/gcc tool that does
>> similar things to valgrind, but because it works at compile time it can
>> insert gaps between stack variables.
>
> Thanks, I've added that switch to my list. It seems to work both on
> x86_64 and armv7l. I don't seem to have any error, now that the sprintf
> issue is solved.
>
> I tried this switch yesterday both with clang and gcc and got some
> warning/error (in red) but no human-readable stack trace. I tried to add
> -fno-omit-frame-pointer to make the stack trace readable without
> success. So I concluded it didn't work on armv7l (yesterday I didn't try
> x86_64).
>
> Anyway it seems to be working so I'll keep these switches. Thanks.
>

-- 
João M. S. Silva

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to