From 87c3e38b3314f3ce10106ab5432db7278eca0935 Mon Sep 17 00:00:00 2001 From: timholy Date: Mon, 26 May 2014 21:21:24 -0500 Subject: [PATCH] Revert "Catch writes to protected memory in mmapped arrays (fix #3434)" This reverts commit caa4bfa17aeaada0c66f33128e206477842f7eab. --- src/init.c | 8 +------- test/file.jl | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/init.c b/src/init.c index 93f46fa28e2df..a89f47e4f6b3e 100644 --- a/src/init.c +++ b/src/init.c @@ -140,18 +140,12 @@ void segv_handler(int sig, siginfo_t *info, void *context) { sigset_t sset; - if (in_jl_ || is_addr_on_stack(info->si_addr)) { // stack overflow + if (in_jl_ || is_addr_on_stack(info->si_addr)) { sigemptyset(&sset); sigaddset(&sset, SIGSEGV); sigprocmask(SIG_UNBLOCK, &sset, NULL); jl_throw(jl_stackovf_exception); } - else if (info->si_code == SEGV_ACCERR) { // writing to read-only memory (e.g., mmap) - sigemptyset(&sset); - sigaddset(&sset, SIGSEGV); - sigprocmask(SIG_UNBLOCK, &sset, NULL); - jl_throw(jl_memory_exception); - } else { uv_tty_reset_mode(); sigfillset(&sset); diff --git a/test/file.jl b/test/file.jl index b4db74f360502..7ae2674665be8 100644 --- a/test/file.jl +++ b/test/file.jl @@ -138,7 +138,6 @@ c = mmap_array(Uint8, (11,), s) @test c == "Hello World".data c = mmap_array(Uint8, (uint16(11),), s) @test c == "Hello World".data -@test_throws MemoryError c[1] = 0 # read-only memory @test_throws ErrorException mmap_array(Uint8, (int16(-11),), s) @test_throws ErrorException mmap_array(Uint8, (typemax(Uint),), s) close(s)