diff --git a/deps/checksums/libuv-52d72a52cc7ccd570929990f010ed16e2ec604c.tar.gz/md5 b/deps/checksums/libuv-52d72a52cc7ccd570929990f010ed16e2ec604c.tar.gz/md5 new file mode 100644 index 0000000000000..07d3ac158b709 --- /dev/null +++ b/deps/checksums/libuv-52d72a52cc7ccd570929990f010ed16e2ec604c.tar.gz/md5 @@ -0,0 +1 @@ +0e6ec181c8bfd322a17dbd843b2b8ebb diff --git a/deps/checksums/libuv-52d72a52cc7ccd570929990f010ed16e2ec604c.tar.gz/sha512 b/deps/checksums/libuv-52d72a52cc7ccd570929990f010ed16e2ec604c.tar.gz/sha512 new file mode 100644 index 0000000000000..704a70e7378a9 --- /dev/null +++ b/deps/checksums/libuv-52d72a52cc7ccd570929990f010ed16e2ec604c.tar.gz/sha512 @@ -0,0 +1 @@ +4bf9c8b16617691b70ea43c667ecc575d2a06b3d0c347b949d10360c012138585a13ecea5e18de81b1585a96cf7734b7cc3d6072490898f1d5531c702cf5afab diff --git a/deps/checksums/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8.tar.gz/md5 b/deps/checksums/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8.tar.gz/md5 deleted file mode 100644 index 89795f7987bbc..0000000000000 --- a/deps/checksums/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -4c91d4c9161555c911630b0a70ddec03 diff --git a/deps/checksums/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8.tar.gz/sha512 b/deps/checksums/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8.tar.gz/sha512 deleted file mode 100644 index faf62292a62af..0000000000000 --- a/deps/checksums/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -c53513a5aea84405bf302b084a23f24f54148aac90a2bd666219ce14879723baab959942934d0d801a4572fffd07e60a7d574ade8d7eb57b6da8216063c20a48 diff --git a/deps/libuv.version b/deps/libuv.version index 4ba4b36712aaf..dd4ea6f5e5760 100644 --- a/deps/libuv.version +++ b/deps/libuv.version @@ -1,2 +1,2 @@ LIBUV_BRANCH=julia-uv1.9.0 -LIBUV_SHA1=8d5131b6c1595920dd30644cd1435b4f344b46c8 +LIBUV_SHA1=52d72a52cc7ccd570929990f010ed16e2ec604c8 diff --git a/src/flisp/builtins.c b/src/flisp/builtins.c index 0b07fdab63ade..706c92bc8f7d6 100644 --- a/src/flisp/builtins.c +++ b/src/flisp/builtins.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/src/flisp/flisp.c b/src/flisp/flisp.c index 6b485d0362428..1546d3236590a 100644 --- a/src/flisp/flisp.c +++ b/src/flisp/flisp.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -117,7 +116,7 @@ static void free_readstate(fl_readstate_t *rs) fl_exception_context_t _ctx; int l__tr, l__ca; \ _ctx.sp=fl_ctx->SP; _ctx.frame=fl_ctx->curr_frame; _ctx.rdst=fl_ctx->readstate; _ctx.prev=fl_ctx->exc_ctx; \ _ctx.ngchnd = fl_ctx->N_GCHND; fl_ctx->exc_ctx = &_ctx; \ - if (!setjmp(_ctx.buf)) \ + if (!fl_setjmp(_ctx.buf)) \ for (l__tr=1; l__tr; l__tr=0, (void)(fl_ctx->exc_ctx=fl_ctx->exc_ctx->prev)) #define FL_CATCH(fl_ctx) \ @@ -156,7 +155,7 @@ void fl_raise(fl_context_t *fl_ctx, value_t e) fl_exception_context_t *thisctx = fl_ctx->exc_ctx; if (fl_ctx->exc_ctx->prev) // don't throw past toplevel fl_ctx->exc_ctx = fl_ctx->exc_ctx->prev; - longjmp(thisctx->buf, 1); + fl_longjmp(thisctx->buf, 1); } static value_t make_error_msg(fl_context_t *fl_ctx, const char *format, va_list args) diff --git a/src/flisp/flisp.h b/src/flisp/flisp.h index fea46e570ea5e..1de9fd868af51 100644 --- a/src/flisp/flisp.h +++ b/src/flisp/flisp.h @@ -167,8 +167,25 @@ fixnum_t tofixnum(fl_context_t *fl_ctx, value_t v, const char *fname); char *tostring(fl_context_t *fl_ctx, value_t v, const char *fname); /* error handling */ +#if defined(_OS_WINDOWS_) +#define fl_jmp_buf jmp_buf +#if defined(_COMPILER_MINGW_) +int __attribute__ ((__nothrow__,__returns_twice__)) (jl_setjmp)(jmp_buf _Buf); +__declspec(noreturn) __attribute__ ((__nothrow__)) void (jl_longjmp)(jmp_buf _Buf, int _Value); +#else +int (jl_setjmp)(jmp_buf _Buf); +void (jl_longjmp)(jmp_buf _Buf, int _Value); +#endif +#define fl_setjmp(a) jl_setjmp(a) +#define fl_longjmp(a, b) jl_longjmp((a), (b)) +#else // !_OS_WINDOWS_ +#define fl_jmp_buf sigjmp_buf +#define fl_setjmp(a) sigsetjmp((a), 0) +#define fl_longjmp(a, b) siglongjmp((a), (b)) +#endif + typedef struct _ectx_t { - jmp_buf buf; + fl_jmp_buf buf; uint32_t sp; uint32_t frame; uint32_t ngchnd; @@ -179,7 +196,7 @@ typedef struct _ectx_t { #define FL_TRY_EXTERN(fl_ctx) \ fl_exception_context_t _ctx; int l__tr, l__ca; \ fl_savestate(fl_ctx, &_ctx); fl_ctx->exc_ctx = &_ctx; \ - if (!setjmp(_ctx.buf)) \ + if (!fl_setjmp(_ctx.buf)) \ for (l__tr=1; l__tr; l__tr=0, (void)(fl_ctx->exc_ctx=fl_ctx->exc_ctx->prev)) #define FL_CATCH_EXTERN(fl_ctx) \ diff --git a/src/flisp/iostream.c b/src/flisp/iostream.c index efcbd024f3ccf..197e60be731d5 100644 --- a/src/flisp/iostream.c +++ b/src/flisp/iostream.c @@ -4,7 +4,6 @@ #include #include #include -#include #include "flisp.h" #ifdef __cplusplus diff --git a/src/flisp/string.c b/src/flisp/string.c index 3454801ae1b55..fa8b6ad443ae7 100644 --- a/src/flisp/string.c +++ b/src/flisp/string.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/src/flisp/table.c b/src/flisp/table.c index cee884dd2f281..a24cdf3bc06e8 100644 --- a/src/flisp/table.c +++ b/src/flisp/table.c @@ -4,7 +4,6 @@ #include #include #include -#include #include "flisp.h" #include "equalhash.h" diff --git a/src/julia.h b/src/julia.h index 1e85fb092f11a..9a24002bc4393 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1537,11 +1537,11 @@ JL_DLLEXPORT void jl_pop_handler(int n); #if defined(_OS_WINDOWS_) #if defined(_COMPILER_MINGW_) -int __attribute__ ((__nothrow__,__returns_twice__)) jl_setjmp(jmp_buf _Buf); -__declspec(noreturn) __attribute__ ((__nothrow__)) void jl_longjmp(jmp_buf _Buf,int _Value); +int __attribute__ ((__nothrow__,__returns_twice__)) (jl_setjmp)(jmp_buf _Buf); +__declspec(noreturn) __attribute__ ((__nothrow__)) void (jl_longjmp)(jmp_buf _Buf, int _Value); #else -int jl_setjmp(jmp_buf _Buf); -void jl_longjmp(jmp_buf _Buf,int _Value); +int (jl_setjmp)(jmp_buf _Buf); +void (jl_longjmp)(jmp_buf _Buf, int _Value); #endif #define jl_setjmp_f jl_setjmp #define jl_setjmp_name "jl_setjmp" diff --git a/src/signals-unix.c b/src/signals-unix.c index 9376c02047d62..3cc9e3259dc09 100644 --- a/src/signals-unix.c +++ b/src/signals-unix.c @@ -527,10 +527,30 @@ static void *signal_listener(void *arg) unw_context_t *signal_context; int sig, critical, profile; int i; + // prevent this thread from being used to run other, + // potentially blocking signal handlers + sigfillset(&sset); + sigdelset(&sset, SIGSEGV); + sigdelset(&sset, SIGILL); + sigdelset(&sset, SIGKILL); + sigdelset(&sset, SIGBUS); + sigdelset(&sset, SIGABRT); + sigdelset(&sset, SIGSYS); + pthread_sigmask(SIG_SETMASK, &sset, 0); + jl_sigsetset(&sset); while (1) { profile = 0; - sigwait(&sset, &sig); + sig = 0; + errno = 0; + if (sigwait(&sset, &sig)) { + sig = SIGABRT; // this branch can't occur, unless we had stack memory corruption of sset + } + if (!sig) { + // this should never happen, but it has been observed to occur on some buggy kernels (mach) + // when sigprocmask is incorrectly used on some other thread, instead of pthread_sigmask + continue; + } #ifndef HAVE_MACH # ifdef HAVE_ITIMER profile = (sig == SIGPROF);