Skip to content

Commit

Permalink
Revert "Catch writes to protected memory in mmapped arrays (fix #3434)"
Browse files Browse the repository at this point in the history
This reverts commit caa4bfa.
  • Loading branch information
timholy committed May 27, 2014
1 parent caa4bfa commit 87c3e38
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion test/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 87c3e38

Please sign in to comment.