Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Issue 2495413002: Fix false-positive ASAN detection with the stack profiler on win64 (Closed)

Created:
4 years, 1 month ago by etienneb
Modified:
4 years, 1 month ago
CC:
chromium-reviews, chrisha
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix false-positive ASAN detection with the stack profiler on win64 The sampling profiler is triggering an ASAN error when instrumenting Chrome for checking memory accesses on a windows 7 and windows 10 computer. ================================================================= ==14512==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x00000017dc20 at pc 0x00013fae1b45 bp 0x00000a70e940 sp 0x00000a70e958 READ of size 10816 at 0x00000017dc20 thread T2 #0 0x13fae1b76 in __asan_memcpy d:\src\llvm\llvm\projects\compiler-rt\lib\asan\asan_interceptors.cc:413 #1 0x7fecf9224bf in base::`anonymous namespace'::SuspendThreadAndRecordStack+0x21f (D:\src\chromium\src\out\asan64dynamic\chrome.dll+0x1863f24bf) #2 0x7fecf921c8d in base::`anonymous namespace'::NativeStackSamplerWin::RecordStackSample D:\src\chromium\src\base\profiler\native_stack_sampler_win.cc:457 [...] This frame has 1 object(s): [32, 440) 'wsa_data.i.i.i.i.i' <== Memory access at offset 0 partially underflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp, SEH and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-underflow d:\src\llvm\llvm\projects\compiler-rt\lib\asan\asan_interceptors.cc:41 R=wittman@chromium.org, mark@chromium.org, rnk@google.com, thakis@google.com BUG=663829 Committed: https://crrev.com/4e9250a7663d37a3490b2aa936a0b634af518670 Cr-Commit-Position: refs/heads/master@{#433256}

Patch Set 1 #

Total comments: 5

Patch Set 2 : nico comments #

Patch Set 3 : minus build changes #

Total comments: 2

Patch Set 4 : marc comments #

Patch Set 5 : nit #

Total comments: 2

Patch Set 6 : wittman comments #

Total comments: 2

Patch Set 7 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -3 lines) Patch
M base/compiler_specific.h View 1 1 chunk +10 lines, -0 lines 0 comments Download
M base/profiler/native_stack_sampler_win.cc View 1 2 3 4 5 6 3 chunks +16 lines, -3 lines 0 comments Download

Messages

Total messages: 34 (16 generated)
etienneb
PTAL.
4 years, 1 month ago (2016-11-14 20:37:20 UTC) #5
Reid Kleckner
This is the right fix, but I'll leave it to base owners to decide how ...
4 years, 1 month ago (2016-11-15 00:16:31 UTC) #8
Mark Mentovai
https://codereview.chromium.org/2495413002/diff/1/base/compiler_specific.h File base/compiler_specific.h (right): https://codereview.chromium.org/2495413002/diff/1/base/compiler_specific.h#newcode165 base/compiler_specific.h:165: #endif #ifdef #if #endif #endif #ifndef #endif What a ...
4 years, 1 month ago (2016-11-15 01:34:08 UTC) #9
Nico
lgtm once Mark is happy, but style guide discourages `ifdef` and `ifndef` https://codereview.chromium.org/2495413002/diff/1/base/compiler_specific.h File base/compiler_specific.h ...
4 years, 1 month ago (2016-11-15 15:25:38 UTC) #10
etienneb
thanks Nico. I was not aware of the GCC parsing issue. Good to know. Marc, ...
4 years, 1 month ago (2016-11-15 15:45:01 UTC) #11
Mark Mentovai
LG otherwise https://codereview.chromium.org/2495413002/diff/40001/base/profiler/native_stack_sampler_win.cc File base/profiler/native_stack_sampler_win.cc (left): https://codereview.chromium.org/2495413002/diff/40001/base/profiler/native_stack_sampler_win.cc#oldcode356 base/profiler/native_stack_sampler_win.cc:356: std::memcpy(stack_copy_buffer, reinterpret_cast<const void*>(bottom), Can we keep this ...
4 years, 1 month ago (2016-11-15 16:52:04 UTC) #12
etienneb
Nico, any toughs? https://codereview.chromium.org/2495413002/diff/40001/base/profiler/native_stack_sampler_win.cc File base/profiler/native_stack_sampler_win.cc (left): https://codereview.chromium.org/2495413002/diff/40001/base/profiler/native_stack_sampler_win.cc#oldcode356 base/profiler/native_stack_sampler_win.cc:356: std::memcpy(stack_copy_buffer, reinterpret_cast<const void*>(bottom), On 2016/11/15 16:52:04, ...
4 years, 1 month ago (2016-11-15 16:55:41 UTC) #13
Nico
up to mark On Tue, Nov 15, 2016 at 11:55 AM, <etienneb@chromium.org> wrote: > Nico, ...
4 years, 1 month ago (2016-11-15 16:56:47 UTC) #14
Mark Mentovai
Right. If it doesn’t actually run often, I don’t care. But the optimized memcpy() is ...
4 years, 1 month ago (2016-11-15 16:56:52 UTC) #15
etienneb
fix applied
4 years, 1 month ago (2016-11-15 17:04:11 UTC) #16
Mark Mentovai
LGTM
4 years, 1 month ago (2016-11-15 17:09:41 UTC) #17
Mike Wittman
lgtm % nit On 2016/11/15 16:56:52, Mark Mentovai wrote: > Right. If it doesn’t actually ...
4 years, 1 month ago (2016-11-17 01:57:54 UTC) #20
etienneb
Wittman, fine with this? https://codereview.chromium.org/2495413002/diff/80001/base/profiler/native_stack_sampler_win.cc File base/profiler/native_stack_sampler_win.cc (right): https://codereview.chromium.org/2495413002/diff/80001/base/profiler/native_stack_sampler_win.cc#newcode356 base/profiler/native_stack_sampler_win.cc:356: #if defined(ADDRESS_SANITIZER) On 2016/11/17 01:57:54, ...
4 years, 1 month ago (2016-11-17 19:29:54 UTC) #21
Mike Wittman
lgtm with another nit :) Thanks! https://codereview.chromium.org/2495413002/diff/100001/base/profiler/native_stack_sampler_win.cc File base/profiler/native_stack_sampler_win.cc (right): https://codereview.chromium.org/2495413002/diff/100001/base/profiler/native_stack_sampler_win.cc#newcode369 base/profiler/native_stack_sampler_win.cc:369: base::CopyMemoryFromStack( nit: no ...
4 years, 1 month ago (2016-11-17 19:32:50 UTC) #22
etienneb
thanks https://codereview.chromium.org/2495413002/diff/100001/base/profiler/native_stack_sampler_win.cc File base/profiler/native_stack_sampler_win.cc (right): https://codereview.chromium.org/2495413002/diff/100001/base/profiler/native_stack_sampler_win.cc#newcode369 base/profiler/native_stack_sampler_win.cc:369: base::CopyMemoryFromStack( On 2016/11/17 19:32:50, Mike Wittman wrote: > ...
4 years, 1 month ago (2016-11-17 19:35:03 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2495413002/120001
4 years, 1 month ago (2016-11-18 16:24:32 UTC) #30
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 1 month ago (2016-11-18 18:48:19 UTC) #32
commit-bot: I haz the power
4 years, 1 month ago (2016-11-18 18:51:37 UTC) #34
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/4e9250a7663d37a3490b2aa936a0b634af518670
Cr-Commit-Position: refs/heads/master@{#433256}

Powered by Google App Engine
This is Rietveld 408576698