Bug 1983696

Summary: firefox: Port to dynamic PTHREAD_STACK_MIN (glibc 2.34 related)
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: firefoxAssignee: Gecko Maintainer <gecko-bugs-nobody>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: erack, gecko-bugs-nobody, jhorak, kai-engert-fedora, klaas, pjasicek, rhughes, rstrode, sandmann, stransky, trpost
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1983703 1984792 (view as bug list) Environment:
Last Closed: 2021-07-23 11:08:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1976892, 1983703, 1984792    
Attachments:
Description Flags
Patch to remove stack size optimization for the Watchdog thread
none
https://bugzilla.redhat.com/show_bug.cgi?id=1983703 patch none

Description Florian Weimer 2021-07-19 14:12:28 UTC
Created attachment 1803339 [details]
Patch to remove stack size optimization for the Watchdog thread

This code in js/xpconnect/src/XPCJSContext.cpp fails to build with glibc 2.34:

static constexpr size_t kWatchdogStackSize =
    PTHREAD_STACK_MIN < 32 * 1024 ? 32 * 1024 : PTHREAD_STACK_MIN;

I'm not sure to what extent this optimization is important, given that the kernel will not use memory for unused areas of the stack. The use of PTHREAD_STACK_MIN is dubious anyway because the constant only means that pthread_attr_setstack will not fail. It doesn't say that the thread stack is useful for running any application code.

Comment 1 Florian Weimer 2021-07-20 07:09:56 UTC
Created attachment 1803523 [details]
https://bugzilla.redhat.com/show_bug.cgi?id=1983703 patch

Comment 2 Florian Weimer 2021-07-22 08:58:12 UTC
There is another use of PTHREAD_STACK_MIN in security/sandbox/linux/launch/SandboxLaunch.cpp, also fixed by the patch.