Add guard pages to test stacks [crashpad/crashpad : main]

1 view
Skip to first unread message

Mark Mentovai (Gerrit)

unread,
May 15, 2024, 5:43:22 PMMay 15
to Joshua Peraza, Adam Walls, Crashpad LUCI CQ, crashp...@chromium.org
Attention needed from Joshua Peraza

Mark Mentovai added 1 comment

File snapshot/linux/process_reader_linux_test.cc
Line 185, Patchset 1 (Latest): DCHECK(stack_size % page_size == 0);
Mark Mentovai . unresolved

This doesn't seem reasonable. Can you instead set stack_alloc_size to 2 pages plus stack_size rounded up to a full page if necessary?

Open in Gerrit

Related details

Attention is currently required from:
  • Joshua Peraza
Submit Requirements:
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Gerrit-Change-Number: 5542248
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Adam Walls <avv...@chromium.org>
Gerrit-Attention: Joshua Peraza <jpe...@chromium.org>
Gerrit-Comment-Date: Wed, 15 May 2024 21:43:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Joshua Peraza (Gerrit)

unread,
May 15, 2024, 7:28:29 PMMay 15
to Mark Mentovai, Adam Walls, Crashpad LUCI CQ, crashp...@chromium.org
Attention needed from Mark Mentovai

Joshua Peraza added 1 comment

File snapshot/linux/process_reader_linux_test.cc
Line 185, Patchset 1 (Latest): DCHECK(stack_size % page_size == 0);
Mark Mentovai . unresolved

This doesn't seem reasonable. Can you instead set stack_alloc_size to 2 pages plus stack_size rounded up to a full page if necessary?

Joshua Peraza

If the stack size is not a multiple of the page size, then crashpad will still find more stack than is expected unless we also round up the expected stack size.

Open in Gerrit

Related details

Attention is currently required from:
  • Mark Mentovai
Submit Requirements:
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Gerrit-Change-Number: 5542248
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Adam Walls <avv...@chromium.org>
Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
Gerrit-Comment-Date: Wed, 15 May 2024 23:28:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
unsatisfied_requirement
open
diffy

Mark Mentovai (Gerrit)

unread,
May 15, 2024, 10:41:43 PMMay 15
to Joshua Peraza, Adam Walls, Crashpad LUCI CQ, crashp...@chromium.org
Attention needed from Joshua Peraza

Mark Mentovai voted and added 1 comment

Votes added by Mark Mentovai

Code-Review+1

1 comment

File snapshot/linux/process_reader_linux_test.cc
Line 185, Patchset 1 (Latest): DCHECK(stack_size % page_size == 0);
Mark Mentovai . unresolved

This doesn't seem reasonable. Can you instead set stack_alloc_size to 2 pages plus stack_size rounded up to a full page if necessary?

Joshua Peraza

If the stack size is not a multiple of the page size, then crashpad will still find more stack than is expected unless we also round up the expected stack size.

Mark Mentovai

If the stack size is not a multiple of the page size, then crashpad will still find more stack than is expected unless we also round up the expected stack size.

Good point, for the purpose of the test I guess this is fine.

I’d suggest `DCHECK_EQ(stack_size % page_size, 0u);` then.

Open in Gerrit

Related details

Attention is currently required from:
  • Joshua Peraza
Submit Requirements:
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Gerrit-Change-Number: 5542248
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Adam Walls <avv...@chromium.org>
Gerrit-Attention: Joshua Peraza <jpe...@chromium.org>
Gerrit-Comment-Date: Thu, 16 May 2024 02:41:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Joshua Peraza <jpe...@chromium.org>
Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
satisfied_requirement
open
diffy

Joshua Peraza (Gerrit)

unread,
May 16, 2024, 12:09:15 PMMay 16
to Mark Mentovai, Adam Walls, Crashpad LUCI CQ, crashp...@chromium.org

Joshua Peraza voted and added 1 comment

Votes added by Joshua Peraza

Commit-Queue+1

1 comment

File snapshot/linux/process_reader_linux_test.cc
Line 185, Patchset 1: DCHECK(stack_size % page_size == 0);
Mark Mentovai . resolved

This doesn't seem reasonable. Can you instead set stack_alloc_size to 2 pages plus stack_size rounded up to a full page if necessary?

Joshua Peraza

If the stack size is not a multiple of the page size, then crashpad will still find more stack than is expected unless we also round up the expected stack size.

Mark Mentovai

If the stack size is not a multiple of the page size, then crashpad will still find more stack than is expected unless we also round up the expected stack size.

Good point, for the purpose of the test I guess this is fine.

I’d suggest `DCHECK_EQ(stack_size % page_size, 0u);` then.

Joshua Peraza

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Gerrit-Change-Number: 5542248
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Adam Walls <avv...@chromium.org>
Gerrit-Comment-Date: Thu, 16 May 2024 16:09:11 +0000
satisfied_requirement
open
diffy

Joshua Peraza (Gerrit)

unread,
May 16, 2024, 12:28:49 PMMay 16
to Mark Mentovai, Adam Walls, Crashpad LUCI CQ, crashp...@chromium.org

Joshua Peraza voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Gerrit-Change-Number: 5542248
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-CC: Adam Walls <avv...@chromium.org>
Gerrit-Comment-Date: Thu, 16 May 2024 16:28:45 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Crashpad LUCI CQ (Gerrit)

unread,
May 16, 2024, 12:28:56 PMMay 16
to Joshua Peraza, Mark Mentovai, Adam Walls, crashp...@chromium.org

Crashpad LUCI CQ submitted the change with unreviewed changes

Unreviewed changes

1 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: snapshot/linux/process_reader_linux_test.cc
Insertions: 1, Deletions: 1.

@@ -182,7 +182,7 @@

if (stack_size > 0) {
const size_t page_size = getpagesize();
- DCHECK(stack_size % page_size == 0);
+ DCHECK_EQ(stack_size % page_size, 0u);
size_t stack_alloc_size = 2 * page_size + stack_size;

ASSERT_TRUE(thread->stack.ResetMmap(nullptr,
```

Change information

Commit message:
Add guard pages to test stacks
Bug: b:340659332
Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Reviewed-by: Mark Mentovai <ma...@chromium.org>
Commit-Queue: Joshua Peraza <jpe...@chromium.org>
Files:
  • M snapshot/linux/process_reader_linux_test.cc
Change size: S
Delta: 1 file changed, 15 insertions(+), 7 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Mark Mentovai
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Gerrit-Change-Number: 5542248
Gerrit-PatchSet: 3
Gerrit-Owner: Joshua Peraza <jpe...@chromium.org>
Gerrit-Reviewer: Crashpad LUCI CQ <crashpa...@luci-project-accounts.iam.gserviceaccount.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages