mirror of
git://git.musl-libc.org/musl
synced 2025-03-04 02:37:30 +00:00
fix overlap of thread stacks with thread tls segments
This commit is contained in:
parent
c62b9f3980
commit
42c36f957d
@ -130,7 +130,7 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attr,
|
|||||||
}
|
}
|
||||||
tsd = map + size - __pthread_tsd_size;
|
tsd = map + size - __pthread_tsd_size;
|
||||||
}
|
}
|
||||||
new = __copy_tls(tsd - libc.tls_size);
|
new = __copy_tls(stack = tsd - libc.tls_size);
|
||||||
new->map_base = map;
|
new->map_base = map;
|
||||||
new->map_size = size;
|
new->map_size = size;
|
||||||
new->pid = self->pid;
|
new->pid = self->pid;
|
||||||
@ -145,7 +145,6 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attr,
|
|||||||
}
|
}
|
||||||
new->unblock_cancel = self->cancel;
|
new->unblock_cancel = self->cancel;
|
||||||
new->canary = self->canary;
|
new->canary = self->canary;
|
||||||
stack = (void *)new;
|
|
||||||
|
|
||||||
a_inc(&libc.threads_minus_1);
|
a_inc(&libc.threads_minus_1);
|
||||||
ret = __clone(start, stack, flags, new, &new->tid, new, &new->tid);
|
ret = __clone(start, stack, flags, new, &new->tid, new, &new->tid);
|
||||||
|
Loading…
Reference in New Issue
Block a user