From a49a446ade09c7f0bcd7b6672422e49dba808c98 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Tue, 17 Oct 2017 23:51:44 -0700 Subject: [PATCH] Update libuv commit 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 --- .../md5 | 1 - .../sha512 | 1 - .../md5 | 1 + .../sha512 | 1 + deps/libuv.version | 2 +- test/socket.jl | 30 +++++++++++++++++++ 6 files changed, 33 insertions(+), 3 deletions(-) delete mode 100644 deps/checksums/libuv-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/md5 delete mode 100644 deps/checksums/libuv-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/sha512 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-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/md5 b/deps/checksums/libuv-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/md5 deleted file mode 100644 index 3399b978883bd..0000000000000 --- a/deps/checksums/libuv-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -8e84e1a3332fd2eb63e6c9d0eaa731b1 diff --git a/deps/checksums/libuv-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/sha512 b/deps/checksums/libuv-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/sha512 deleted file mode 100644 index cdaf96971b71f..0000000000000 --- a/deps/checksums/libuv-c5a4e584989669ad48c1728b35063291e16f85ee.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -53f636422d8ac2c1e738625868e4b000b0e332c1f362564ced7e740ff94019a68017ab8674f85653133a0a9c5c48db78dd043e4d2ab9b9e8451b2cb10a27ddd0 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 1a59e7be3fd44..bfc5342bd5f76 100644 --- a/deps/libuv.version +++ b/deps/libuv.version @@ -1,2 +1,2 @@ LIBUV_BRANCH=julia-uv1.9.0 -LIBUV_SHA1=c5a4e584989669ad48c1728b35063291e16f85ee +LIBUV_SHA1=d8ab1c6a33e77bf155facb54215dd8798e13825d diff --git a/test/socket.jl b/test/socket.jl index 57658b465ea09..0b7a62bc7e2e9 100644 --- a/test/socket.jl +++ b/test/socket.jl @@ -414,3 +414,33 @@ end @test 0 == ccall(:jl_tcp_reuseport, Int32, (Ptr{Void},), s.handle) end 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 Sys.isapple() + @testset "Issues #18818 and #24169" begin + with_ulimit(7001) do + @test getaddrinfo("localhost") isa IPAddr + end + end +end