Avoid setting an alternative stack for signals if there is already one

RESOLVED FIXED in mozilla13

Status

()

Toolkit
Crash Reporting
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

Trunk
mozilla13
All
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
The software in which breakpad is hooked may well have already set an alternative stack for signals for separate reasons. Breakpad should use that alternative stack if it's large enough.

http://code.google.com/p/google-breakpad/issues/detail?id=464
(Assignee)

Comment 1

6 years ago
Created attachment 591101 [details] [diff] [review]
Avoid setting an alternative stack for signals if there is already one
Attachment #591101 - Flags: review?(ted.mielczarek)
Comment on attachment 591101 [details] [diff] [review]
Avoid setting an alternative stack for signals if there is already one

Review of attachment 591101 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine. Needs to land upstream as well.

::: toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
@@ -189,5 @@
>    // We use this value rather than SIGSTKSZ because we would end up overrunning
>    // such a small stack.
>    static const unsigned kSigStackSize = 8192;
>  
> -  signal_stack = malloc(kSigStackSize);

Does calling sigaltstack hand over ownership of the stack memory?
Attachment #591101 - Flags: review?(ted.mielczarek) → review+
(Assignee)

Comment 3

6 years ago
(In reply to Ted Mielczarek [:ted, :luser] from comment #2)
> Does calling sigaltstack hand over ownership of the stack memory?

No, so effectively, this is leaked memory. But that is a feature of the existing code already.

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/e9dcf2a2a097
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.