From 29b6dad1a0a4ced3c2ed5a88e53d7001d0987b19 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 11 Nov 2017 14:42:14 -0800 Subject: [PATCH] Update libuv commit (#24190) This includes a fix from upstream libuv that ensures that the thread stack size is set to a multiple of the page size. Fixes #18818 Fixes #24169 (cherry picked from commit 6a23e234e6cc5b4361b5f88614a9ed423dc2c12a) --- .../md5 | 1 + .../sha512 | 1 + deps/libuv.version | 2 +- test/socket.jl | 29 +++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/md5 create mode 100644 deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/sha512 diff --git a/deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/md5 b/deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/md5 new file mode 100644 index 0000000000000..6a5504c2da819 --- /dev/null +++ b/deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/md5 @@ -0,0 +1 @@ +e2d1baa42d69dc5391e2e8bae2596eac diff --git a/deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/sha512 b/deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/sha512 new file mode 100644 index 0000000000000..d515cb2e45c52 --- /dev/null +++ b/deps/checksums/libuv-d8ab1c6a33e77bf155facb54215dd8798e13825d.tar.gz/sha512 @@ -0,0 +1 @@ +272e3cc7b1290ef19cc941c3b3e6dd39dba7dcb26f0aea8e667c48c56288aa9266020504e0cc90074f02881521b3352079416f564c7eb24ab444326a8f04ca64 diff --git a/deps/libuv.version b/deps/libuv.version index dd4ea6f5e5760..bfc5342bd5f76 100644 --- a/deps/libuv.version +++ b/deps/libuv.version @@ -1,2 +1,2 @@ LIBUV_BRANCH=julia-uv1.9.0 -LIBUV_SHA1=52d72a52cc7ccd570929990f010ed16e2ec604c8 +LIBUV_SHA1=d8ab1c6a33e77bf155facb54215dd8798e13825d diff --git a/test/socket.jl b/test/socket.jl index 1d215ec237efc..7e9a05b7075a5 100644 --- a/test/socket.jl +++ b/test/socket.jl @@ -351,3 +351,32 @@ let @test test_connect(addr) end +# Issues #18818 and #24169 +mutable struct RLimit + cur::Int64 + max::Int64 +end +function with_ulimit(f::Function, stacksize::Int) + RLIMIT_STACK = 3 # from /usr/include/sys/resource.h + rlim = Ref(RLimit(0, 0)) + # Get the current maximum stack size in bytes + rc = ccall(:getrlimit, Cint, (Cint, Ref{RLimit}), RLIMIT_STACK, rlim) + @assert rc == 0 + current = rlim[].cur + try + rlim[].cur = stacksize * 1024 + ccall(:setrlimit, Cint, (Cint, Ref{RLimit}), RLIMIT_STACK, rlim) + f() + finally + rlim[].cur = current + ccall(:setrlimit, Cint, (Cint, Ref{RLimit}), RLIMIT_STACK, rlim) + end + nothing +end +@static if is_apple() + @testset "Issues #18818 and #24169" begin + with_ulimit(7001) do + @test getaddrinfo("localhost") isa IPAddr + end + end +end