ramosian-glider / memory-sanitizer

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

MsanReallocate does not handle origins correctly #73

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There is a number of issues in how MsanReallocate handles origins:
1. In the in-place grow case __msan_poison is used w/o setting origin for the 
new memory at all
2. In the copy-realloc case __msan_memcpy is used. __msan_memcpy unwinds stack, 
which only works correctly when called from the user code entry point. All 
__msan_memcpy calls from msan runtime code are bugs and must be replaced with 
CopyShadow.

Original issue reported on code.google.com by euge...@google.com on 21 Nov 2014 at 12:04

GoogleCodeExporter commented 8 years ago
>> In the in-place grow
Maybe we should just remove the "in-place grow" path and always do 
copy-realloc, like in asan?

Original comment by konstant...@gmail.com on 21 Nov 2014 at 7:22

GoogleCodeExporter commented 8 years ago
Why? It looks like very little extra complexity for unknown performance benefit 
(but surely not negative).

Original comment by euge...@google.com on 24 Nov 2014 at 12:00

GoogleCodeExporter commented 8 years ago
Fixed in http://llvm.org/viewvc/llvm-project?view=revision&revision=226674

Original comment by euge...@google.com on 21 Jan 2015 at 4:52

GoogleCodeExporter commented 8 years ago
Adding Project:MemorySanitizer as part of GitHub migration.

Original comment by gli...@google.com on 30 Jul 2015 at 9:22