> On Solaris 11.4 on SPARC -- there is a reproducible failure to initialize a pthread condition variable -- an EINVAL(22) is returned from pthread_cond_init(...).
> The Solaris documentation for pthread_cond_init(cond, attr) suggests that EINVAL will be returned if the attr is invalid, but it's unclear how that could be the case here.
> The only thing noticeably different in the failing case is that the __pthread_cond_flags of the pthread_cond_t object are zero, where in the working cases they are not.
>
>
>
Code: Select all
> % DISPLAY=:2 /usr/gdb/10/bin/gdb ./Palemoon
> GNU gdb (GDB) 10.2
> Copyright (C) 2021 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "sparc-sun-solaris2.11".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from ./Palemoon...
> (gdb) break ConditionVariable.cpp:79
> No source file named ConditionVariable.cpp.
> Make breakpoint pending on future shared library load? (y or [n]) y
> Breakpoint 1 (ConditionVariable.cpp:79) pending.
> (gdb) commands
> Type commands for breakpoint(s) 1, one per line.
> End with a line saying just "end".
> >print ptCond
> >print *ptCond
> >print attr
> >next
> >end
> (gdb) run
> Starting program: /apps/Pale-Moon/obj-sparc-sun-solaris2.11/dist/bin/Palemoon
> [Thread debugging using libthread_db enabled]
> [New Thread 1 (LWP 1)]
> Loading JavaScript value pretty-printers; see js/src/gdb/README.
> If they cause trouble, type: disable pretty-printer .* SpiderMonkey
> [New LWP 2 ]
> [New Thread 2 (LWP 2)]
> [Switching to Thread 1 (LWP 1)]
>
> Thread 2 hit Breakpoint 1, js::ConditionVariable::ConditionVariable (this=0xf6b7a608) at /apps/Pale-Moon/platform/js/src/threading/posix/ConditionVariable.cpp:79
> 79 int r2 = pthread_cond_init(ptCond, &attr);
> $1 = (pthread_cond_t *) 0xf6b7a608
> $2 = {__pthread_cond_flags = {__pthread_cond_flag = "\345\345\345\345", __pthread_cond_type = 58853, __pthread_cond_magic = 58853}, __pthread_cond_data = 16565899579919558117}
> $3 = {__pthread_condattrp = 0xfece16c0}
> 80 MOZ_RELEASE_ASSERT(!r2);
> (gdb) print *ptCond
> $4 = {__pthread_cond_flags = {__pthread_cond_flag = "\000\004\000", __pthread_cond_type = 0, __pthread_cond_magic = 17238}, __pthread_cond_data = 0}
> (gdb) print r2
> $5 = 0
> (gdb) continue
> Continuing.
>
> Thread 2 hit Breakpoint 1, js::ConditionVariable::ConditionVariable (this=0xf6b7a618) at /apps/Pale-Moon/platform/js/src/threading/posix/ConditionVariable.cpp:79
> 79 int r2 = pthread_cond_init(ptCond, &attr);
> $6 = (pthread_cond_t *) 0xf6b7a618
> $7 = {__pthread_cond_flags = {__pthread_cond_flag = "\345\345\345\345", __pthread_cond_type = 58853, __pthread_cond_magic = 58853}, __pthread_cond_data = 16565899579919558117}
> $8 = {__pthread_condattrp = 0xfece16c0}
> 80 MOZ_RELEASE_ASSERT(!r2);
> (gdb) print *ptCond
> $9 = {__pthread_cond_flags = {__pthread_cond_flag = "\000\004\000", __pthread_cond_type = 0, __pthread_cond_magic = 17238}, __pthread_cond_data = 0}
> (gdb) print r2
> $10 = 0
> (gdb) continue
> Continuing.
>
> Thread 2 hit Breakpoint 1, js::ConditionVariable::ConditionVariable (this=0xf6b7a628) at /apps/Pale-Moon/platform/js/src/threading/posix/ConditionVariable.cpp:79
> 79 int r2 = pthread_cond_init(ptCond, &attr);
> $11 = (pthread_cond_t *) 0xf6b7a628
> $12 = {__pthread_cond_flags = {__pthread_cond_flag = "\345\345\345\345", __pthread_cond_type = 58853, __pthread_cond_magic = 58853}, __pthread_cond_data = 16565899579919558117}
> $13 = {__pthread_condattrp = 0xfece16c0}
> 80 MOZ_RELEASE_ASSERT(!r2);
> (gdb) print *ptCond
> $14 = {__pthread_cond_flags = {__pthread_cond_flag = "\000\004\000", __pthread_cond_type = 0, __pthread_cond_magic = 17238}, __pthread_cond_data = 0}
> (gdb) print r2
> $15 = 0
> (gdb) continue
> Continuing.
> [New LWP 3 ]
> [LWP 3 exited]
> [New LWP 4 ]
> [New LWP 5 ]
> [New Thread 4 (LWP 4)]
> [New Thread 5 ]
>
> Thread 2 hit Breakpoint 1, js::ConditionVariable::ConditionVariable (this=0xf69f69f4) at /apps/Pale-Moon/platform/js/src/threading/posix/ConditionVariable.cpp:79
> 79 int r2 = pthread_cond_init(ptCond, &attr);
> $16 = (pthread_cond_t *) 0xf69f69f4
> $17 = {__pthread_cond_flags = {__pthread_cond_flag = "\000\000\000", __pthread_cond_type = 0, __pthread_cond_magic = 0}, __pthread_cond_data = 0}
> $18 = {__pthread_condattrp = 0xfece1800}
> 80 MOZ_RELEASE_ASSERT(!r2);
> (gdb) print *ptCond
> $19 = {__pthread_cond_flags = {__pthread_cond_flag = "\000\000\000", __pthread_cond_type = 0, __pthread_cond_magic = 17238}, __pthread_cond_data = 0}
> (gdb) print r2
> $20 = 22
> (gdb) where
> #0 js::ConditionVariable::ConditionVariable() (this=0xf69f69f4) at /apps/Pale-Moon/platform/js/src/threading/posix/ConditionVariable.cpp:80
> #1 0xfc7ac3bc in js::GCHelperState::GCHelperState(JSRuntime*) (rt=0xf69f4108, this=0xf69f69f0) at /apps/Pale-Moon/platform/js/src/jsgc.h:920
> #2 js::gc::GCRuntime::GCRuntime(JSRuntime*) (this=0xf69f4528, rt=0xf69f4108) at /apps/Pale-Moon/platform/js/src/jsgc.cpp:867
> #3 0xfc970a48 in JSRuntime::JSRuntime(JSRuntime*) (this=0xf69f4108, parentRuntime=0x0) at /apps/Pale-Moon/platform/js/src/vm/Runtime.cpp:246
> #4 0xfc77dd3c in JSContext::JSContext(JSRuntime*) (this=0xf69f4000, parentRuntime=0x0) at /apps/Pale-Moon/platform/js/src/jscntxt.cpp:1027
> #5 0xfc78692c in js_new<JSContext, JSRuntime*&> () at /apps/Pale-Moon/obj-sparc-sun-solaris2.11/dist/include/js/Utility.h:345
> #6 js::NewContext(unsigned int, unsigned int, JSRuntime*) (maxBytes=33554432, maxNurseryBytes=16777216, parentRuntime=0x0) at /apps/Pale-Moon/platform/js/src/jscntxt.cpp:106
> #7 0xf9cac784 in mozilla::CycleCollectedJSContext::Initialize(JSContext*, unsigned int, unsigned int)
> (this=this@entry=0xfe425800, aParentContext=aParentContext@entry=0x0, aMaxBytes=aMaxBytes@entry=33554432, aMaxNurseryBytes=aMaxNurseryBytes@entry=16777216)
> at /apps/Pale-Moon/platform/xpcom/base/CycleCollectedJSContext.cpp:504
> #8 0xfa532b24 in XPCJSContext::Initialize() (this=this@entry=0xfe425800) at /apps/Pale-Moon/platform/js/xpconnect/src/XPCJSContext.cpp:3150
> #9 0xfa538094 in XPCJSContext::newXPCJSContext() () at /apps/Pale-Moon/platform/js/xpconnect/src/XPCJSContext.cpp:3321
> #10 0xfa55308c in nsXPConnect::nsXPConnect() (this=0xf6bdd2c0) at /apps/Pale-Moon/platform/js/xpconnect/src/nsXPConnect.cpp:68
> #11 0xfa5530e8 in nsXPConnect::InitStatics() () at /apps/Pale-Moon/platform/js/xpconnect/src/nsXPConnect.cpp:111
> #12 0xfa535c20 in xpcModuleCtor() () at /apps/Pale-Moon/platform/js/xpconnect/src/XPCModule.cpp:12
> #13 0xfc0f3ca8 in Initialize() () at /apps/Pale-Moon/platform/layout/build/nsLayoutModule.cpp:295
> #14 0xf9cfa4ec in nsComponentManagerImpl::KnownModule::Load() (this=0xf6907780) at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:840
> #15 0xf9cfaca4 in nsFactoryEntry::GetFactory() (this=0xf6932c60) at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1864
> #16 0xf9cfb0ac in nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**) (this=this@entry=
> 0xfe4ca400, aContractID=aContractID@entry=0xf9ab3e58 "@mozilla.org/moz/jsloader;1", aDelegate=aDelegate@entry=0x0, aIID=..., aResult=0xffbfed40, this=<optimized out>)
> at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1166
> #17 0xf9cfc254 in nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**)
> (aResult=<optimized out>, aIID=..., aDelegate=0x0, aContractID=0xf9ab3e58 "@mozilla.org/moz/jsloader;1", this=0xfe4ca400, this=<optimized out>)
> at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1142
> #18 nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**) (this=0xfe4ca400, aContractID=0xf9ab3e58 "@mozilla.org/moz/jsloader;1", aIID=..., aResult=0xffbfee1c)
> at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1525
> #19 0xf9d339bc in CallGetService(char const*, nsID const&, void**) (aResult=0xffbfee1c, aIID=..., aContractID=<optimized out>)
> at /apps/Pale-Moon/platform/xpcom/glue/nsComponentManagerUtils.cpp:68
> #20 nsGetServiceByContractID::operator()(nsID const&, void**) const (this=0xffbfee14, aIID=..., aInstancePtr=0xffbfee1c)
> at /apps/Pale-Moon/platform/xpcom/glue/nsComponentManagerUtils.cpp:279
> #21 0xf9d2a014 in nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID const&) (this=this@entry=0xffbfee94, aGS=..., aIID=...)
> --Type <RET> for more, q to quit, c to continue without paging--c
> at /apps/Pale-Moon/platform/xpcom/glue/nsCOMPtr.cpp:94
> #22 0xf9d2e7c0 in nsCOMPtr<nsISupports>::nsCOMPtr(nsGetServiceByContractID) (aGS=..., this=0xffbfee94) at /apps/Pale-Moon/obj-sparc-sun-solaris2.11/dist/include/nsCOMPtr.h:895
> #23 NS_InitXPCOM2(nsIServiceManager**, nsIFile*, nsIDirectoryServiceProvider*) (aResult=0xfe41c5e4, aBinDirectory=<optimized out>, aAppFileLocationProvider=<optimized out>) at /apps/Pale-Moon/platform/xpcom/build/XPCOMInit.cpp:737
> #24 0xfc3ea6b4 in ScopedXPCOMStartup::Initialize() (this=0xfe41c5e4) at /apps/Pale-Moon/platform/toolkit/xre/nsAppRunner.cpp:1197
> #25 0xfc3f07cc in XREMain::XRE_main(int, char**, nsXREAppData const*) (this=this@entry=0xffbff0a8, argc=argc@entry=1, argv=argv@entry=0xffbff724, aAppData=aAppData@entry=0xffbff250) at /apps/Pale-Moon/platform/toolkit/xre/nsAppRunner.cpp:3993
> #26 0xfc3f0a44 in XRE_main(int, char**, nsXREAppData const*, uint32_t) (argc=1, argv=0xffbff724, aAppData=0xffbff250, aFlags=<optimized out>) at /apps/Pale-Moon/platform/toolkit/xre/nsAppRunner.cpp:4079
> #27 0x0001a18c in do_main(int, char**, char**, nsIFile*) (argc=argc@entry=1, argv=argv@entry=0xffbff724, envp=envp@entry=0xffbff72c, xreDirectory=0xfe460080) at /apps/Pale-Moon/palemoon/app/nsBrowserApp.cpp:247
> #28 0x0001a654 in main(int, char**, char**) (argc=1, argv=0xffbff724, envp=0xffbff72c) at /apps/Pale-Moon/palemoon/app/nsBrowserApp.cpp:367
> (gdb) quit
> A debugging session is active.
>
> Inferior 1 [process 15037 ] will be killed.
>
> Quit anyway? (y or n) y