]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libthr: Use kern.stacktop for thread stack calculation.
authorDawid Gorecki <dgr@semihalf.com>
Wed, 13 Oct 2021 19:06:05 +0000 (21:06 +0200)
committerMarcin Wojtas <mw@FreeBSD.org>
Fri, 15 Oct 2021 08:21:56 +0000 (10:21 +0200)
commit78df56ccfcb40013a3e6904bd6d39836220c3550
treefbd4da22e4a2b56b1769e5f5bf16d9f2dd886a1b
parenta97d697122da2bfb0baae5f0939d118d119dae33
libthr: Use kern.stacktop for thread stack calculation.

Use the new kern.stacktop sysctl to retrieve the address of stack top
instead of kern.usrstack. kern.usrstack does not have any knowledge
of the stack gap, so this can cause problems with thread stacks.
Using kern.stacktop sysctl should fix most of those problems.
kern.usrstack is used as a fallback when kern.stacktop cannot be read.

Rename usrstack variables to stacktop to reflect this change.

Fixes problems with firefox and thunderbird not starting with
stack gap enabled.

PR: 239873
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D31898
lib/libthr/thread/thr_init.c
lib/libthr/thread/thr_private.h
lib/libthr/thread/thr_stack.c