-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retrieving the interpreter_base fails if done after interpreter gets invalidated. Related to #2740
- Loading branch information
1 parent
99d680b
commit 79ac37a
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* -*- Mode: C; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ | ||
|
||
#include "util.h" | ||
|
||
size_t page_size; | ||
|
||
static void breakpoint(void) { | ||
int break_here = 1; | ||
(void)break_here; | ||
} | ||
|
||
void callback(__attribute__((unused)) uint64_t env, char* name, map_properties_t* props) { | ||
if (strstr(name, "/ld-") != 0) { | ||
test_assert(0 == munmap((void*)(uintptr_t)props->start, page_size)); | ||
void* p = (void*)mmap((void*)(uintptr_t)props->start, page_size, PROT_NONE, MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, -1, 0); | ||
test_assert(p != MAP_FAILED); | ||
} | ||
} | ||
|
||
int main(void) { | ||
page_size = sysconf(_SC_PAGESIZE); | ||
FILE* maps_file = fopen("/proc/self/maps", "r"); | ||
iterate_maps(0, callback, maps_file); | ||
breakpoint(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from util import * | ||
|
||
send_gdb('break breakpoint') | ||
expect_gdb('Breakpoint 1') | ||
send_gdb('c') | ||
expect_gdb('Breakpoint 1') | ||
send_gdb('checkpoint') | ||
expect_gdb('Checkpoint 1 at') | ||
send_gdb('restart 1') | ||
expect_gdb('stopped') | ||
|
||
ok() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source `dirname $0`/util.sh | ||
record invalid_interpreter$bitness | ||
debug invalid_interpreter |