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

Issue 478005: Workaround incorrect signal handler save/restore (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by cjhopman
Modified:
11 years, 6 months ago
Reviewers:
Mark Mentovai
Base URL:
http://git.chromium.org/external/google-breakpad/src.git@master
Visibility:
Public.

Description

Workaround incorrect signal handler save/restore

If a library saves the breakpad signal handler and then restores it with
signal instead of sigaction, the arguments to the breakpad signal
handler may be invalid. To work around this, the signal handler can
detect that it was installed incorrectly, reinstall itself with the
correct flags, and then return. On return, the signal will be
retriggered and the signal handler will then be called with valid
arguments.

BUG=

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M client/linux/handler/exception_handler.cc View 1 chunk +34 lines, -0 lines 3 comments Download
M client/linux/handler/exception_handler_unittest.cc View 1 chunk +19 lines, -0 lines 2 comments Download

Messages

Total messages: 3
cjhopman
Mark- Could you take a look and let me know what you think about this. ...
11 years, 6 months ago #1
Mark Mentovai
LGTM https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_handler.cc File client/linux/handler/exception_handler.cc (right): https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_handler.cc#newcode301 client/linux/handler/exception_handler.cc:301: static const char no_handler_msg[] = static is not ...
11 years, 6 months ago #2
cjhopman
11 years, 6 months ago #3
digit@ has a slightly cleaner patch for this at
http://breakpad.appspot.com/481002/ and so I'm closing this one.

On 2012/10/09 14:25:52, Mark Mentovai wrote:
> LGTM
> 
>
https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_han...
> File client/linux/handler/exception_handler.cc (right):
> 
>
https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_han...
> client/linux/handler/exception_handler.cc:301: static const char
> no_handler_msg[] =
> static is not necessary or helpful here and on line 305.
> 
>
https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_han...
> client/linux/handler/exception_handler.cc:303: logger::write(no_handler_msg,
> sizeof(no_handler_msg));
> You use sizeof here but strlen on line 307. Shouldn’t this be strlen or sizeof
-
> 1?
> 
>
https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_han...
> client/linux/handler/exception_handler.cc:313: // Mask all exception signals
> when we're handling one of them.
> Who are “we?” Don’t say “we” in comments.
> 
>
https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_han...
> File client/linux/handler/exception_handler_unittest.cc (right):
> 
>
https://breakpad.appspot.com/478005/diff/1/client/linux/handler/exception_han...
> client/linux/handler/exception_handler_unittest.cc:384:
> TEST(ExceptionHandlerTest, WorkaroundSignalSaveRestore) {
> I suppose it’s enough to just test that the handler routine is ultimately
called
> while SA_SIGINFO is set, which I guess this test does do. Although if you were
> seeing valid arguments to the handler routine even without SA_SIGINFO set, I
> wonder if the theory about the cause of the bug you’re seeing is correct.
> Certainly this change is valid either way. I haven’t looked at the trampolines
> or anything in the kernel recently, so I don’t know for sure either.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted