Closed
Bug 902208
Opened 12 years ago
Closed 11 years ago
Make debugging on Linux work again
Categories
(Core :: IPC, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: evilpies, Assigned: billm)
References
Details
Attachments
(1 file, 1 obsolete file)
1.11 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
For some reason we need to call setpgid in the child. Bill made this change on larch. Without this patch setting a breakpoint in gdb is impossible, because the browser crashes after continuing execution. I will leave it Bill to explain this.
Assignee | ||
Comment 1•12 years ago
|
||
It seems like this probably isn't the right thing to do, but I don't know what's right.
The problem is that, when you hit ^C, all processes in the foreground process group receive the SIGINT. If you hit ^C in gdb, gdb normally traps the signal and instead suspends the debuggee. However, it only does this for the process being debugged. So child processes will still get the signal (since they're in the same process group as the parent) and they'll get killed.
The patch just puts all child processes in their own process group. This is good for gdb. However, it means that when you're running FF outside a debugger, hitting ^C to kill won't actually kill the children. In reality they'll probably die off soon after the parent dies, but it still seems kind of bad.
Maybe bsmedberg will have an idea what to do here.
Flags: needinfo?(benjamin)
Comment 2•12 years ago
|
||
You could just trap and ignore SIGINT in child processes. Note that IPC channels should notice when the other side closes, fire ActorDestroyed on the root actor, and that should abort the child process.
Flags: needinfo?(benjamin)
Assignee | ||
Comment 3•12 years ago
|
||
The problem is that we also want to be able to debug the child process while the parent is running. In that case we don't want ^C to kill the parent. And we don't want to ignore SIGINT in the parent.
Maybe I'll try to figure out what chrome does.
Comment 4•12 years ago
|
||
I'm confused, I think. If you're debugging a child process, your gdb should be running in a separate terminal session, right? So control-c in that session shouldn't affect either the child or the parent.
I was only suggesting to ignore SIGINT in child processes, not the parent process, which should be possible by switching on XRE_GetProcessType
Assignee | ||
Comment 5•12 years ago
|
||
Oh, I see, you're right. I forgot that child processes will get debugged in a different terminal.
Assignee | ||
Comment 6•12 years ago
|
||
This does as suggested.
Attachment #786570 -
Attachment is obsolete: true
Attachment #787246 -
Flags: review?(benjamin)
Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 787246 [details] [diff] [review]
signal-handler
Ted, can you review this?
Attachment #787246 -
Flags: review?(benjamin) → review?(ted)
Comment 8•11 years ago
|
||
Comment on attachment 787246 [details] [diff] [review]
signal-handler
Review of attachment 787246 [details] [diff] [review]:
-----------------------------------------------------------------
I was a little wary of side-effects of this, but I suspect SIGINT isn't useful for much else so ignoring it shouldn't be terribly harmful. I doubt anyone really expects to be able to Ctrl+C kill non-foreground processes anyway.
Attachment #787246 -
Flags: review?(ted) → review+
Assignee | ||
Comment 9•11 years ago
|
||
Comment 10•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•