Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1445)

Issue 6308048: [Sanitizer] Use ProcessMaps in symbolizer to get module name and offset. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by samsonov
Modified:
11 years, 10 months ago
Reviewers:
kcc1, dvyukov
Base URL:
https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/
Visibility:
Public.

Patch Set 1 : z #

Total comments: 14

Patch Set 2 : z #

Patch Set 3 : z #

Total comments: 11

Patch Set 4 : z #

Total comments: 2

Patch Set 5 : z #

Patch Set 6 : z #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -43 lines) Patch
M asan/asan_stack.cc View 1 2 3 4 5 1 chunk +16 lines, -11 lines 0 comments Download
M sanitizer_common/sanitizer_symbolizer.h View 1 2 3 4 5 1 chunk +9 lines, -12 lines 0 comments Download
M sanitizer_common/sanitizer_symbolizer.cc View 1 2 3 4 5 2 chunks +95 lines, -20 lines 0 comments Download

Messages

Total messages: 16
kcc1
http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc File sanitizer_common/sanitizer_symbolizer.cc (right): http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc#newcode26 sanitizer_common/sanitizer_symbolizer.cc:26: // FIXME: use internal_memset so, just do it. http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc#newcode63 ...
11 years, 11 months ago (2012-06-08 12:28:07 UTC) #1
samsonov
http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc File sanitizer_common/sanitizer_symbolizer.cc (right): http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc#newcode26 sanitizer_common/sanitizer_symbolizer.cc:26: // FIXME: use internal_memset On 2012/06/08 12:28:07, kcc1 wrote: ...
11 years, 11 months ago (2012-06-09 10:41:48 UTC) #2
kcc1
http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc File sanitizer_common/sanitizer_symbolizer.cc (right): http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc#newcode124 sanitizer_common/sanitizer_symbolizer.cc:124: static Symbolizer *symbolizer; I am not asking you to ...
11 years, 11 months ago (2012-06-09 12:07:05 UTC) #3
samsonov
On 2012/06/09 12:07:05, kcc1 wrote: > http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc > File sanitizer_common/sanitizer_symbolizer.cc (right): > > http://codereview.appspot.com/6308048/diff/3002/sanitizer_common/sanitizer_symbolizer.cc#newcode124 > ...
11 years, 11 months ago (2012-06-09 12:34:05 UTC) #4
dvyukov
http://codereview.appspot.com/6308048/diff/10001/asan/asan_stack.cc File asan/asan_stack.cc (right): http://codereview.appspot.com/6308048/diff/10001/asan/asan_stack.cc#newcode48 asan/asan_stack.cc:48: AddressInfo addr_frames[5]; 5 does not look like an absolute ...
11 years, 11 months ago (2012-06-11 02:40:16 UTC) #5
samsonov
http://codereview.appspot.com/6308048/diff/10001/asan/asan_stack.cc File asan/asan_stack.cc (right): http://codereview.appspot.com/6308048/diff/10001/asan/asan_stack.cc#newcode48 asan/asan_stack.cc:48: AddressInfo addr_frames[5]; On 2012/06/11 02:40:16, dvyukov wrote: > 5 ...
11 years, 10 months ago (2012-06-14 08:11:07 UTC) #6
dvyukov
http://codereview.appspot.com/6308048/diff/10001/sanitizer_common/sanitizer_symbolizer.cc File sanitizer_common/sanitizer_symbolizer.cc (right): http://codereview.appspot.com/6308048/diff/10001/sanitizer_common/sanitizer_symbolizer.cc#newcode86 sanitizer_common/sanitizer_symbolizer.cc:86: // Don't subtract 'start' for the first entry. Don't ...
11 years, 10 months ago (2012-06-14 14:28:00 UTC) #7
samsonov
The module name/offset is correct if I run output tests with CXXFLAGS += -fPIC -pie. ...
11 years, 10 months ago (2012-06-14 15:05:54 UTC) #8
dvyukov
On Thu, Jun 14, 2012 at 11:05 AM, <samsonov@google.com> wrote: > The module name/offset is ...
11 years, 10 months ago (2012-06-14 15:14:58 UTC) #9
samsonov
On Thu, Jun 14, 2012 at 7:14 PM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Thu, ...
11 years, 10 months ago (2012-06-14 15:47:46 UTC) #10
dvyukov
On Thu, Jun 14, 2012 at 11:47 AM, Alexey Samsonov <samsonov@google.com>wrote: > The module name/offset ...
11 years, 10 months ago (2012-06-14 17:22:18 UTC) #11
samsonov
On Thu, Jun 14, 2012 at 9:22 PM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Thu, ...
11 years, 10 months ago (2012-06-15 09:31:59 UTC) #12
dvyukov
On Fri, Jun 15, 2012 at 5:31 AM, Alexey Samsonov <samsonov@google.com>wrote: > The module name/offset ...
11 years, 10 months ago (2012-06-15 12:55:31 UTC) #13
samsonov
On 2012/06/15 12:55:31, dvyukov wrote: > On Fri, Jun 15, 2012 at 5:31 AM, Alexey ...
11 years, 10 months ago (2012-06-15 13:25:37 UTC) #14
dvyukov
LGTM On Fri, Jun 15, 2012 at 9:25 AM, <samsonov@google.com> wrote: > On 2012/06/15 12:55:31, ...
11 years, 10 months ago (2012-06-15 13:34:17 UTC) #15
samsonov
11 years, 10 months ago (2012-06-15 14:03:09 UTC) #16
On 2012/06/15 13:34:17, dvyukov wrote:
> LGTM

r158522, thanks!

> 
> On Fri, Jun 15, 2012 at 9:25 AM, <mailto:samsonov@google.com> wrote:
> 
> > On 2012/06/15 12:55:31, dvyukov wrote:
> >
> >> On Fri, Jun 15, 2012 at 5:31 AM, Alexey Samsonov
> >>
> > <samsonov@google.com>wrote:
> >
> >  > The module name/offset is correct if I run output tests with
> >>
> > CXXFLAGS +=
> >
> >> >>>>> -fPIC -pie.
> >> >>>>>
> >>
> >
>
<http://codereview.appspot.**com/6308048/diff/5003/asan/**asan_stack.cc%3Chttp...>
> > >
> >
> >  >>>>>
> >> >>>>
> >> >>>> You need to check "the first" module, the one that comes first in
> >> >>>> /proc/self/maps. I am pretty skeptical that it works.
> >> >>>>
> >> >>>
> >> >>> IIRC if we use -pie, the code is mapped to the top of the address
> >>
> > space,
> >
> >> >>> so I doubt that a program module can be "the first one" in the
> >> >>> process map - the shadow will be lower (at least for ASan):
> >> >>>
> >> >>> $ clang++ -faddress-sanitizer heap-overflow.cc
> >> >>> $ ./a.out
> >> >>> ==25559== Process memory map follows:
> >> >>> 0x000000400000-0x00000041c000
> >> >>>
> >>
> >
> > /home/samsonov/llvm-project/**llvm2/projects/compiler-rt/**
> > lib/asan/output_tests/a.out
> >
> >> >>>  0x00000061c000-0x00000061d000
> >> >>>
> >>
> >
> > /home/samsonov/llvm-project/**llvm2/projects/compiler-rt/**
> > lib/asan/output_tests/a.out
> >
> >> >>>  0x00000061d000-0x00000061e000
> >> >>>
> >>
> >
> > /home/samsonov/llvm-project/**llvm2/projects/compiler-rt/**
> > lib/asan/output_tests/a.out
> >
> >> >>>  0x00000061e000-0x000002665000
> >> >>> 0x0ffffffff000-0x120000000000
> >> >>>  0x120000000000-0x140000000000
> >> >>> 0x140000000000-0x200000000000
> >> >>>  0x7f14318c7000-0x7f1431a41000 /lib/libc-2.11.1.so
> >> >>>  0x7f1431a41000-0x7f1431c40000 /lib/libc-2.11.1.so
> >> >>> ...
> >> >>> $ clang++ -faddress-sanitizer -fPIC -pie heap-overflow.cc
> >> >>> $ ./a.out
> >> >>> ==25611== Process memory map follows:
> >> >>> 0x0ffffffff000-0x120000000000
> >> >>>  0x120000000000-0x140000000000
> >> >>> 0x140000000000-0x200000000000
> >> >>>  0x7f19880f1000-0x7f198826b000 /lib/libc-2.11.1.so
> >> >>>  <...>
> >> >>> 0x7f1989265000-0x7f1989282000
> >> >>>
> >>
> >
> > /home/samsonov/llvm-project/**llvm2/projects/compiler-rt/**
> > lib/asan/output_tests/a.out
> >
> >> >>>  0x7f1989481000-0x7f1989482000
> >> >>>
> >>
> >
> > /home/samsonov/llvm-project/**llvm2/projects/compiler-rt/**
> > lib/asan/output_tests/a.out
> >
> >> >>>
> >> >>>
> >> >>
> >> >> You need to check "the first" module, the one that comes first in
> >> >> /proc/self/maps. I am pretty skeptical that it works.
> >> >>
> >> >
> >> > What do you mean? It works for the first module if build binary w/o
> >>
> > -pie.
> >
> >> > If we build binary with -pie, all the modules will be mapped
> >> > too high, so none of them can be first in /proc/self/maps.
> >> >
> >>
> >
> >  Please add that to the comment.
> >>
> >
> > Done.
> >
> >
> >
> >
> >
> >  >>>>
> >> >>>>>
> >>
> >
> > http://codereview.appspot.com/****6308048/diff/5003/asan/asan_**
> > **stack.cc%3Chttp://**codereview.appspot.com/**
> >
>
6308048/diff/5003/asan/asan_**stack.cc<http://codereview.appspot.com/**6308048/diff/5003/asan/asan_**stack.cc%3Chttp://codereview.appspot.com/6308048/diff/5003/asan/asan_stack.cc>
> > >
> >
> >> >>>>> File asan/asan_stack.cc (right):
> >> >>>>>
> >> >>>>>
>
http://codereview.appspot.com/****6308048/diff/5003/asan/asan_****%3Chttp://c...>
> >> >>>>>
> >>
> >
> > stack.cc#newcode51<http://**codereview.appspot.com/**
> >
>
6308048/diff/5003/asan/asan_**stack.cc#newcode51<http://codereview.appspot.com/6308048/diff/5003/asan/asan_stack.cc#newcode51>
> > >
> >
> >  >>>>> asan/asan_stack.cc:51: if (addr_frames_num == 0) {
> >> >>>>> On 2012/06/14 14:28:00, dvyukov wrote:
> >> >>>>>
> >> >>>>>> Can't we just fallback here to that other branch below?
> >> >>>>>> I think module name stil can be useful (is it libc or jit or
> >>
> > what?).
> >
> >> >>>>>>
> >> >>>>>
> >> >>>>> Done. Note that we'd probably always use symbolize=1 and erase
> >>
> > the part
> >
> >> >>>>> below, as SymbolizeCode obtains module name/offset itself.
> >> >>>>>
> >> >>>>>
> >>
> >
> > http://codereview.appspot.com/****6308048/%253Chttp://**
> >
>
codereview.appspot.com/**6308048/<http://codereview.appspot.com/**6308048/%3Chttp://codereview.appspot.com/6308048/>
> > >
> >
> >  >>>>>
> >> >>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> Alexey Samsonov, MSK
> >> >>>
> >> >>>
> >> >>
> >> >
> >> >
> >> > --
> >> > Alexey Samsonov, MSK
> >> >
> >> >
> >>
> >
> >
> >
> >
>
http://codereview.appspot.com/**6308048/%3Chttp://codereview.appspot.com/6308...>
> >
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b