Commit 4ee5e29b authored by plind44@gmail.com's avatar plind44@gmail.com

Prevent segfault if file cannot be opened when --ll_prof is used.

TEST=

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/16107002

Patch from Dusan Milosavljevic <Dusan.Milosavljevic@rt-rk.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14889 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 09c489ea
......@@ -591,6 +591,10 @@ void OS::SignalCodeMovingGC() {
// kernel log.
int size = sysconf(_SC_PAGESIZE);
FILE* f = fopen(FLAG_gc_fake_mmap, "w+");
if (f == NULL) {
OS::PrintError("Failed to open %s\n", FLAG_gc_fake_mmap);
OS::Abort();
}
void* addr = mmap(OS::GetRandomMmapAddr(),
size,
PROT_READ | PROT_EXEC,
......
......@@ -344,6 +344,10 @@ void OS::SignalCodeMovingGC() {
// kernel log.
int size = sysconf(_SC_PAGESIZE);
FILE* f = fopen(FLAG_gc_fake_mmap, "w+");
if (f == NULL) {
OS::PrintError("Failed to open %s\n", FLAG_gc_fake_mmap);
OS::Abort();
}
void* addr = mmap(NULL, size, PROT_READ | PROT_EXEC, MAP_PRIVATE,
fileno(f), 0);
ASSERT(addr != MAP_FAILED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment