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

Issue 1975393002: Check stack pointer to be inside stack when unwinding. (Closed)

Created:
4 years, 7 months ago by Dmitry Skiba
Modified:
4 years, 6 months ago
CC:
chromium-reviews, Maria
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Check stack pointer to be inside stack when unwinding. TraceStackFramePointers() function, which unwinds stack using frame pointers, sometimes crashes on Android when it dives deep into JVM internals and finds bad stack pointer there. See details here: crbug.com/602701#c18 This CL adds checks to make sure only valid stack pointers are dereferenced. BUG=602701 Committed: https://crrev.com/0bed5150f19acdd4897dd12ea8e4d4802c51d75f Cr-Commit-Position: refs/heads/master@{#398134}

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 2

Patch Set 3 : rebase #

Patch Set 4 : Check on Linux too; rename function to GetStackStart() #

Patch Set 5 : Disable Linux #

Patch Set 6 : Avoid issues on Linux #

Patch Set 7 : Fix renderer deadlock on Linux #

Total comments: 4

Patch Set 8 : Implement mincore() approach #

Total comments: 11

Patch Set 9 : Address comments #

Patch Set 10 : rebase #

Patch Set 11 : Revert to the LGTMed patchset 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -0 lines) Patch
M base/debug/stack_trace.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +55 lines, -0 lines 0 comments Download

Messages

Total messages: 64 (12 generated)
Dmitry Skiba
Performance numbers: Before: TraceStackFramePointers(main thread): first call took 4us TraceStackFramePointers(main thread): next 10000 calls took ...
4 years, 7 months ago (2016-05-13 21:26:05 UTC) #3
Primiano Tucci (use gerrit)
The patch itself LGTM. However I just realized that Oilpan does pretty much the same ...
4 years, 7 months ago (2016-05-17 20:08:07 UTC) #5
Primiano Tucci (use gerrit)
On 2016/05/17 20:08:07, Primiano Tucci wrote: > The patch itself LGTM. Ehm I just realized ...
4 years, 7 months ago (2016-05-17 20:09:21 UTC) #6
Primiano Tucci (use gerrit)
On 2016/05/17 20:09:21, Primiano Tucci wrote: > On 2016/05/17 20:08:07, Primiano Tucci wrote: > > ...
4 years, 7 months ago (2016-05-17 20:18:31 UTC) #7
Dmitry Skiba
Welcome back Nico! PTAL :)
4 years, 7 months ago (2016-05-23 17:07:17 UTC) #8
Nico
lgtm Re comment 12 on the bug: This not working in component builds would probably ...
4 years, 7 months ago (2016-05-24 20:29:48 UTC) #9
Dmitry Skiba
https://codereview.chromium.org/1975393002/diff/20001/base/debug/stack_trace.cc File base/debug/stack_trace.cc (right): https://codereview.chromium.org/1975393002/diff/20001/base/debug/stack_trace.cc#newcode97 base/debug/stack_trace.cc:97: uintptr_t stack_end = GetStackEnd(); On 2016/05/24 20:29:48, Nico wrote: ...
4 years, 7 months ago (2016-05-24 23:53:09 UTC) #10
Primiano Tucci (use gerrit)
> https://codereview.chromium.org/1975393002/diff/20001/base/debug/stack_trace.cc#newcode97 > base/debug/stack_trace.cc:97: uintptr_t stack_end = GetStackEnd(); > On 2016/05/24 20:29:48, Nico wrote: > ...
4 years, 7 months ago (2016-05-25 08:05:24 UTC) #11
Dmitry Skiba
PTAL again. Performance numbers from Linux: Before: main thread: first call took 4us. main thread: ...
4 years, 7 months ago (2016-05-25 19:00:57 UTC) #12
Dmitry Skiba
OK, I spoke too soon. Since malloc is weak in Linux, and pthread_getattr_np() allocates memory, ...
4 years, 7 months ago (2016-05-25 19:43:33 UTC) #13
Primiano Tucci (use gerrit)
On 2016/05/25 19:00:57, Dmitry Skiba wrote: > So it now takes 3x longer for the ...
4 years, 7 months ago (2016-05-25 19:44:59 UTC) #14
Dmitry Skiba
On 2016/05/25 19:44:59, Primiano Tucci wrote: > On 2016/05/25 19:00:57, Dmitry Skiba wrote: > > ...
4 years, 7 months ago (2016-05-25 19:48:55 UTC) #15
Nico
what makes us recurse back? can we prevent that? (i really think not turning this ...
4 years, 7 months ago (2016-05-25 19:51:43 UTC) #16
Dmitry Skiba
On 2016/05/25 19:51:43, Nico wrote: > what makes us recurse back? can we prevent that? ...
4 years, 7 months ago (2016-05-25 19:55:37 UTC) #17
Primiano Tucci (use gerrit)
On 2016/05/25 19:51:43, Nico wrote: > what makes us recurse back? can we prevent that? ...
4 years, 7 months ago (2016-05-25 19:57:09 UTC) #18
Primiano Tucci (use gerrit)
> This means that this code will crash as it is also on Android arm64 ...
4 years, 7 months ago (2016-05-25 20:08:02 UTC) #19
Dmitry Skiba
On 2016/05/25 20:08:02, Primiano Tucci wrote: > > This means that this code will crash ...
4 years, 7 months ago (2016-05-25 20:39:30 UTC) #20
Dmitry Skiba
OK, so the overall question is whether I should make it work on Linux to ...
4 years, 7 months ago (2016-05-25 20:47:04 UTC) #21
Primiano Tucci (use gerrit)
On 2016/05/25 20:47:04, Dmitry Skiba wrote: > OK, so the overall question is whether I ...
4 years, 7 months ago (2016-05-26 15:57:09 UTC) #22
Dmitry Skiba
OK, so I added seccomp exception in profiling mode, and that avoids seccomp crashes. But! ...
4 years, 7 months ago (2016-05-27 08:02:43 UTC) #23
Primiano Tucci (use gerrit)
On 2016/05/27 08:02:43, Dmitry Skiba wrote: > pthread_getattr_np() recursively calls itself. This is not true. ...
4 years, 7 months ago (2016-05-27 08:39:43 UTC) #24
Dmitry Skiba
On 2016/05/27 08:39:43, Primiano Tucci wrote: > On 2016/05/27 08:02:43, Dmitry Skiba wrote: > > ...
4 years, 7 months ago (2016-05-27 09:07:51 UTC) #25
Primiano Tucci (use gerrit)
Here's an alternative proposal, which will not require you to punch any hole in the ...
4 years, 7 months ago (2016-05-27 09:21:16 UTC) #26
Dmitry Skiba
On 2016/05/27 09:21:16, Primiano Tucci wrote: > Here's an alternative proposal, which will not require ...
4 years, 7 months ago (2016-05-27 09:43:22 UTC) #27
Primiano Tucci (use gerrit)
On 2016/05/27 09:43:22, Dmitry Skiba wrote: > I don't think there is a problem with ...
4 years, 7 months ago (2016-05-27 09:50:11 UTC) #28
Dmitry Skiba
On 2016/05/27 09:50:11, Primiano Tucci wrote: > On 2016/05/27 09:43:22, Dmitry Skiba wrote: > > ...
4 years, 7 months ago (2016-05-27 10:29:48 UTC) #29
Dmitry Skiba
Ricky, please review seccomp exception I added for __NR_sched_getaffinity for Linux profiling builds (enable_profiling = ...
4 years, 7 months ago (2016-05-27 10:34:45 UTC) #31
Primiano Tucci (use gerrit)
Ehm somethign I am missing here is: how did the re-entrancy case menioned in #23 ...
4 years, 7 months ago (2016-05-27 11:09:15 UTC) #32
Dmitry Skiba
On 2016/05/27 11:09:15, Primiano Tucci wrote: > Ehm somethign I am missing here is: how ...
4 years, 6 months ago (2016-05-27 15:51:09 UTC) #33
Primiano Tucci (use gerrit)
On 2016/05/27 15:51:09, Dmitry Skiba wrote: > Honestly, I don't like complexity of mincore() approach. ...
4 years, 6 months ago (2016-05-27 16:19:30 UTC) #34
Dmitry Skiba
On 2016/05/27 16:19:30, Primiano Tucci wrote: > On 2016/05/27 15:51:09, Dmitry Skiba wrote: > > ...
4 years, 6 months ago (2016-05-27 16:28:30 UTC) #35
Primiano Tucci (use gerrit)
On 2016/05/27 16:28:30, Dmitry Skiba wrote: > That parsing is currently happening in pthread_getattr_np() for ...
4 years, 6 months ago (2016-05-27 16:49:43 UTC) #36
mmenke
https://codereview.chromium.org/1975393002/diff/120001/base/debug/stack_trace.cc File base/debug/stack_trace.cc (right): https://codereview.chromium.org/1975393002/diff/120001/base/debug/stack_trace.cc#newcode78 base/debug/stack_trace.cc:78: CHECK(!error); include base/logging.h
4 years, 6 months ago (2016-05-27 17:39:43 UTC) #38
Dmitry Skiba
OK, so while I've worked around pthread_getattr_np() reentrancy deadlock for the main thread, it still ...
4 years, 6 months ago (2016-05-27 18:50:09 UTC) #39
Primiano Tucci (use gerrit)
On 2016/05/27 18:50:09, Dmitry Skiba wrote: > OK, so while I've worked around pthread_getattr_np() reentrancy ...
4 years, 6 months ago (2016-05-27 20:04:03 UTC) #40
Dmitry Skiba
On 2016/05/27 20:04:03, Primiano Tucci wrote: > On 2016/05/27 18:50:09, Dmitry Skiba wrote: > > ...
4 years, 6 months ago (2016-05-27 23:54:31 UTC) #41
Dmitry Skiba
Julien, since Ricky is OOO next week, can you please review mincore exception for profiling ...
4 years, 6 months ago (2016-05-28 00:03:51 UTC) #43
jln (very slow on Chromium)
On 2016/05/28 00:03:51, Dmitry Skiba wrote: > Julien, since Ricky is OOO next week, can ...
4 years, 6 months ago (2016-05-28 00:14:42 UTC) #44
Dmitry Skiba
On 2016/05/28 00:14:42, jln (very slow on Chromium) wrote: > On 2016/05/28 00:03:51, Dmitry Skiba ...
4 years, 6 months ago (2016-05-31 04:01:57 UTC) #45
Dmitry Skiba
Nico, Primiano, please review.
4 years, 6 months ago (2016-05-31 15:29:53 UTC) #46
Primiano Tucci (use gerrit)
Thanks for the work. Makes sense conceptually but I think the code can be simplified ...
4 years, 6 months ago (2016-05-31 16:13:07 UTC) #47
Maria
4 years, 6 months ago (2016-05-31 18:16:38 UTC) #49
Dmitry Skiba
> Thanks for the work. Makes sense conceptually but I think the code can be ...
4 years, 6 months ago (2016-05-31 21:52:19 UTC) #50
Dmitry Skiba
Julien: I added !defined(GOOGLE_CHROME_BUILD) to the condition, to make sure it doesn't get into official ...
4 years, 6 months ago (2016-06-01 00:58:03 UTC) #51
Primiano Tucci (use gerrit)
I think this can be really simplified. Unless I am missing something you can do ...
4 years, 6 months ago (2016-06-01 20:10:58 UTC) #53
Dmitry Skiba
On 2016/06/01 20:10:58, Primiano Tucci wrote: > I think this can be really simplified. Unless ...
4 years, 6 months ago (2016-06-01 23:26:23 UTC) #54
Dmitry Skiba
Just found and issue with mincore approach on Linux: 7f4299c1f000-7f429a41f000 rw-p 00000000 00:00 0 [stack:109410] ...
4 years, 6 months ago (2016-06-02 07:43:18 UTC) #55
Primiano Tucci (use gerrit)
On 2016/06/01 23:26:23, Dmitry Skiba wrote: > 1. It will likely probe all pages one ...
4 years, 6 months ago (2016-06-02 13:32:49 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1975393002/200001
4 years, 6 months ago (2016-06-06 19:46:38 UTC) #59
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 6 months ago (2016-06-06 21:38:11 UTC) #61
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/0bed5150f19acdd4897dd12ea8e4d4802c51d75f Cr-Commit-Position: refs/heads/master@{#398134}
4 years, 6 months ago (2016-06-06 21:40:11 UTC) #63
Dmitry Skiba
4 years, 6 months ago (2016-06-06 23:02:51 UTC) #64
Message was sent while issue was closed.
Documented my attempts here: crbug.com/617730

Powered by Google App Engine
This is Rietveld 408576698