HomeFreeBSD

libthr: Use kern.stacktop for thread stack calculation.

Description

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

(cherry picked from commit 78df56ccfcb40013a3e6904bd6d39836220c3550)

Details

Provenance
dgr_semihalf.comAuthored on Oct 13 2021, 7:06 PM
mwCommitted on Dec 30 2021, 3:25 PM
Reviewer
kib
Differential Revision
D31898: libthr: Use kern.stacktop for thread stack calculation.
Parents
rG532d925b6f02: kern_exec: Add kern.stacktop sysctl.
Branches
Unknown
Tags
Unknown