lsalamon / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 1 forks source link

make unaligned pointers handling in LSan more useful #304

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
With use_unaligned=1, LSan will consider unaligned byte patterns as pointers. 
This matters in certain rare cases, e.g. when pointers are stored in a packed 
struct. To help detect such cases, HeapChecker supports a mode where we run two 
leak checks back-to-back, one of which takes into account only aligned byte 
patters and the other considers all byte patters. By comparing the results, 
HeapChecker can detect the presence of unaligned pointers. (The idea being that 
this is more convenient than running the program twice with use_unaligned=1/0 
and comparing the results manually.)

LSan could support a similar feature with a relatively simple change, although 
the utility of this is unclear. False positives due to unaligned pointers are 
quite rare (only 2 cases in the first year of LSan deployment) and it seems 
that the minor convenience boost might not be worth the complexity increase.

Original issue reported on code.google.com by earth...@google.com on 30 Apr 2014 at 6:11

GoogleCodeExporter commented 9 years ago

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:05

GoogleCodeExporter commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:06