-
-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Description
Dear developers:
Thank you for your checking. Similarly, in the function AllocDynarecMap, the lock &mutex_mmap also may not be released. The fix is to insert pthread_mutex_unlock(&mutex_mmap); before returning.
Line 436 in f000951
| pthread_mutex_lock(&mutex_mmap); |
uintptr_t AllocDynarecMap(dynablock_t* db, size_t size)
{
if(!size)
return 0;
if(size>MMAPSIZE-2*sizeof(blockmark_t)) {
#ifndef USE_MMAP
pthread_mutex_lock(&mutex_mmap); // here
void *p = NULL;
if(posix_memalign(&p, box64_pagesize, size)) {
dynarec_log(LOG_INFO, "Cannot create dynamic map of %zu bytes\n", size);
return 0; // return without releasing
}
mprotect(p, size, PROT_READ | PROT_WRITE | PROT_EXEC);
#else
void* p = mmap(NULL, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
if(p==(void*)-1) {
dynarec_log(LOG_INFO, "Cannot create dynamic map of %zu bytes\n", size);
return 0; // return without releasing
}
#endif
...;
return ret;
}
Best,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels