Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#2571 exit flags not reset: reset on init. #2572

Merged
merged 3 commits into from
Jul 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/dynamo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,8 @@ dynamo_exit_post_detach(void)
#ifdef UNIX
post_execve = false;
#endif
vm_areas_post_exit();
heap_post_exit();
}

dcontext_t *
Expand Down
6 changes: 6 additions & 0 deletions core/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,12 @@ heap_exit()
heapmgt = &temp_heapmgt;
}

void
heap_post_exit()
{
heap_exiting = false;
}

/* FIXME:
* detect if the app is who we're fighting for memory, if so, don't
* free memory, else the app will just keep grabbing more.
Expand Down
1 change: 1 addition & 0 deletions core/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ bool rel32_reachable_from_vmcode(byte *target);
/* heap management */
void heap_init(void);
void heap_exit(void);
void heap_post_exit(void); /* post exit to support reattach */
void heap_reset_init(void);
void heap_reset_free(void);
void heap_thread_init(dcontext_t *dcontext);
Expand Down
6 changes: 6 additions & 0 deletions core/vmareas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,12 @@ vm_areas_exit()
return 0;
}

void
vm_areas_post_exit()
{
vm_areas_exited = false;
}

void
vm_areas_thread_reset_init(dcontext_t *dcontext)
{
Expand Down
4 changes: 4 additions & 0 deletions core/vmareas.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ vm_areas_init(void);
int
vm_areas_exit(void);

/* post cleanup to support reattach */
void
vm_areas_post_exit(void);

/* thread-shared initialization that should be repeated after a reset */
void
vm_areas_reset_init(void);
Expand Down