Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
e9843cfa
Commit
e9843cfa
authored
May 18, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have the gdb watcher catch SIGABRT as well
parent
9f82d935
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
src/jit.cpp
src/jit.cpp
+16
-6
No files found.
src/jit.cpp
View file @
e9843cfa
...
...
@@ -60,12 +60,7 @@ static bool unbuffered = false;
static
const
char
*
argv0
;
static
int
pipefds
[
2
];
static
void
handle_sigsegv
(
int
signum
)
{
assert
(
signum
==
SIGSEGV
);
// TODO: this should set a flag saying a KeyboardInterrupt is pending.
// For now, just call abort(), so that we get a traceback at least.
fprintf
(
stderr
,
"child encountered segfault! signalling parent watcher to backtrace.
\n
"
);
static
void
signal_parent_watcher
()
{
char
buf
[
1
];
int
r
=
write
(
pipefds
[
1
],
buf
,
1
);
RELEASE_ASSERT
(
r
==
1
,
""
);
...
...
@@ -75,6 +70,20 @@ static void handle_sigsegv(int signum) {
}
}
static
void
handle_sigsegv
(
int
signum
)
{
assert
(
signum
==
SIGSEGV
);
fprintf
(
stderr
,
"child encountered segfault! signalling parent watcher to backtrace.
\n
"
);
signal_parent_watcher
();
}
static
void
handle_sigabrt
(
int
signum
)
{
assert
(
signum
==
SIGABRT
);
fprintf
(
stderr
,
"child aborted! signalling parent watcher to backtrace.
\n
"
);
signal_parent_watcher
();
}
static
int
gdb_child_pid
;
static
void
propagate_sig
(
int
signum
)
{
// fprintf(stderr, "parent received signal %d, passing to child and then ignoring\n", signum);
...
...
@@ -136,6 +145,7 @@ static void enableGdbSegfaultWatcher() {
close
(
pipefds
[
0
]);
signal
(
SIGSEGV
,
&
handle_sigsegv
);
signal
(
SIGABRT
,
&
handle_sigabrt
);
}
int
handleArg
(
char
code
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment