Closed
Bug 171343
Opened 22 years ago
Closed 22 years ago
nsProfileAccess should use SA_SIGINFO and sa_sigaction
Categories
(Core Graveyard :: Profile: BackEnd, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.2beta
People
(Reporter: bryner, Assigned: bryner)
Details
Attachments
(1 file, 2 obsolete files)
|
5.55 KB,
patch
|
netscape
:
review+
brendan
:
superreview+
chofmann
:
approval+
|
Details | Diff | Splinter Review |
Per the POSIX specification, you can pass SA_SIGINFO as a flag to sigaction() and get your handler called with 3 paramters instead of 1, i.e.: void handler(int signum, siginfo_t* info, void* context); nsProfileAccess currently does not set this flag. The problem is that if you have another signal handler installed (before nsProfileAccess's handler) which wants the extra parameters, it will not receive them. Since there's no reason not to get the extra info passed to our handler, we should do this, so we can pass it up to the next handler in the chain (if it uses SA_SIGINFO).
| Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.2beta
| Assignee | ||
Comment 1•22 years ago
|
||
| Assignee | ||
Comment 2•22 years ago
|
||
Note that I specifically do not assume in this patch that sa_handler and sa_sigaction are a union, even though it seems to be in almost all cases. POSIX does not require this. So I always check the SA_SIGINFO flag and access the appropriate member based on that.
Comment 3•22 years ago
|
||
Comment on attachment 100983 [details] [diff] [review] patch > #define CATCH_SIGNAL(signame) \ > PR_BEGIN_MACRO \ > if (sigaction(signame, NULL, &oldact) == 0 && \ >- oldact.sa_handler != SIG_IGN) \ >+ (((oldact.sa_flags & SA_SIGINFO) && \ >+ oldact.sa_sigaction != (my_sigaction_t) SIG_IGN) || \ >+ (!(oldact.sa_flags & SA_SIGINFO) && oldact.sa_handler != SIG_IGN))) \ This violates the 80th column (79 is the last usable one due to wrapping bugs in some Emacses), but what's more, it should use ?: like so: + ((oldact.sa_flags & SA_SIGINFO) \ + ? oldact.sa_sigaction != (my_sigaction_t) SIG_IGN) \ + : oldact.sa_handler != SIG_IGN))) \ Fix that nit, and sr=brendan@mozilla.org, esp. if your latest testing shows that it works :-) /be
Attachment #100983 -
Flags: superreview+
| Assignee | ||
Comment 4•22 years ago
|
||
Address brendan's comments; #include <signal.h> from nsProfileAccess.h for access to the siginfo_t typedef (this must have been getting brought in some other way on OS X).
Attachment #100983 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•22 years ago
|
||
Comment on attachment 100984 [details] [diff] [review] patch #2 carrying over sr=brendan
Attachment #100984 -
Flags: superreview+
Comment 6•22 years ago
|
||
Comment on attachment 100984 [details] [diff] [review] patch #2 r=ccarlen
Attachment #100984 -
Flags: review+
| Assignee | ||
Comment 7•22 years ago
|
||
siginfo_t and SA_SIGINFO are not defined on OS X 10.1. I backed out the patch until I can come up with an autoconf test.
| Assignee | ||
Comment 8•22 years ago
|
||
Add an autoconf test for siginfo_t; use the old behavior if the type is not present.
| Assignee | ||
Updated•22 years ago
|
Attachment #100984 -
Attachment is obsolete: true
Comment 9•22 years ago
|
||
Comment on attachment 102126 [details] [diff] [review] patch #3 More of a cls thing, and who knew OSX was evolving so rapidly to catch up to Unixes of 10 years ago? ;-) sr=brendan@mozilla.org if it helps. /be
Attachment #102126 -
Flags: superreview+
Comment 10•22 years ago
|
||
Comment on attachment 102126 [details] [diff] [review] patch #3 r=cls
Attachment #102126 -
Flags: review+
Comment 11•22 years ago
|
||
Comment on attachment 102126 [details] [diff] [review] patch #3 a=chofmann
Attachment #102126 -
Flags: approval+
| Assignee | ||
Comment 12•22 years ago
|
||
checked into the trunk and CHIMERA_M1_0_1_BRANCH.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
It seems like this might have broken talkback on Linux. See bug 176886, especially bug 176886 comment 10.
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•