-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
priorityThis should be addressed urgentlyThis should be addressed urgentlytestThis change adds or pertains to unit testsThis change adds or pertains to unit tests
Description
Real reason is the OOM killer (see the updated title and comment below)
Original post:
With the patch below (the /dev/tty part might not be necessary) I've got the following backtrace on a machine that can reproduce the EOFError issue (or what looks like it)
signal (8): Floating point exception
__gmp_exception at /usr/lib/libgmp.so (unknown line)
unknown function (ip: 1705129166)
__gmpz_powm at /usr/lib/libgmp.so (unknown line)
powermod at ./gmp.jl:424
powermod at ./gmp.jl:430
unknown function (ip: 1399079124)
jl_apply_generic at /home/yuyichao/project/julia/src/gf.c:1663
anonymous at ./test.jl:105
do_test_throws at ./test.jl:59
jl_apply_generic at /home/yuyichao/project/julia/src/gf.c:1663
do_call at /home/yuyichao/project/julia/src/interpreter.c:66
eval at /home/yuyichao/project/julia/src/interpreter.c:212
jl_toplevel_eval_flex at /home/yuyichao/project/julia/src/toplevel.c:539
jl_toplevel_eval_flex at /home/yuyichao/project/julia/src/toplevel.c:568
jl_load at /home/yuyichao/project/julia/src/toplevel.c:615
include at ./boot.jl:253
jl_apply_generic at /home/yuyichao/project/julia/src/gf.c:1663
runtests at /home/yuyichao/project/julia/test/testdefs.jl:198
unknown function (ip: 1711445219)
jl_apply_generic at /home/yuyichao/project/julia/src/gf.c:1663
jl_f_apply at /home/yuyichao/project/julia/src/builtins.c:473
anonymous at ./multi.jl:854
run_work_thunk at ./multi.jl:605
jl_apply_generic at /home/yuyichao/project/julia/src/gf.c:1663
anonymous at ./multi.jl:854
start_task at /home/yuyichao/project/julia/src/task.c:234
unknown function (ip: 0)
diff --git a/src/init.c b/src/init.c
index 06a58c7..a394b31 100644
--- a/src/init.c
+++ b/src/init.c
@@ -249,6 +249,12 @@ static int is_addr_on_stack(void *addr)
void sigdie_handler(int sig, siginfo_t *info, void *context)
{
+ int fd = open("/dev/tty", O_RDWR);
+ int oldfd1 = dup(1);
+ int oldfd2 = dup(2);
+ dup2(fd, 1);
+ dup2(fd, 2);
+ close(fd);
if (sig != SIGINFO) {
sigset_t sset;
uv_tty_reset_mode();
@@ -269,6 +275,10 @@ void sigdie_handler(int sig, siginfo_t *info, void *context)
sig != SIGINFO) {
raise(sig);
}
+ dup2(oldfd1, 1);
+ dup2(oldfd2, 2);
+ close(oldfd1);
+ close(oldfd2);
}
#endif
@@ -1201,6 +1211,9 @@ void jl_install_default_signal_handlers(void)
sigemptyset(&act_die.sa_mask);
act_die.sa_sigaction = sigdie_handler;
act_die.sa_flags = SA_SIGINFO;
+ for (int i = 0;i < 32;i++) {
+ sigaction(i, &act_die, NULL);
+ }
if (sigaction(SIGINFO, &act_die, NULL) < 0) {
jl_errorf("fatal error: sigaction: %s\n", strerror(errno));
}Metadata
Metadata
Assignees
Labels
priorityThis should be addressed urgentlyThis should be addressed urgentlytestThis change adds or pertains to unit testsThis change adds or pertains to unit tests