[Solaris] Runtime error: failure to initialize a pthread condition variable

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Michele

[Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-07, 20:56

We now have a completed Palemoon build going into execution but it is failing thusly:

> 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

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1498
Joined: 2018-10-28, 19:56
Location: Georgia

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by athenian200 » 2021-05-07, 22:13

Honestly, I'm not 100% sure exactly what's happening there, but I notice it's happening in the JS engine. I remember hearing that JavaScript on SPARC is limited to interpreter only, because there isn't currently a SPARC implementation of the bytecode compiler. There's a lot of low-level assembly code and MASM-type stuff in JS, and it's possible something SPARC-specific needs to be added to make it work, but I don't really have a clear idea from the debugging output where to start.

Is it possible that either you didn't disable the compiler, or else something is in there in the failing code that depends on the architecture having a working bytecode compiler? That's the only thing I can think of right off the bat. Congratulations on getting it to compile though. That is a lot further than I got, I kept having issues getting it to find the right path for something or other.

If the the JavaScript engine from Firefox 52ESR doesn't have issues compiling and running on that system, then it's possible that something was changed later that led to issues, or some SPARC-specific JS code was never updated when some other parts were changed. I don't work on the JavaScript engine myself, honestly, so I don't have a lot of insight.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-07, 23:57

We're currently running Firefox 52.9.0 ESR and it is working (I'm posting from that now).

It doesn't seem to have got nearly far enough to try *executing* any javascript when it fails.
However, if you use gdb to bypass the assertion for the initialization failure, it gets as far as putting
up the display, and then fails for [bug 2]... the not-main-thread problem. (See next post).

I don't see any way to explicitly disable the JavaScript JIT compiler.
Last edited by Michele on 2021-05-08, 00:03, edited 1 time in total.

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-08, 00:00

This is Bug 2:

Running on Solaris 11.4 on SPARC -- the security manager code, which asserts that it is called only from the main thread, seems to be called from some other thread. This is reproducible.

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) 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 LWP    3        ]
> [LWP    3         exited]
> [New LWP    4        ]
> [New LWP    5        ]
> [New LWP    6        ]
> [New LWP    7        ]
> [New LWP    8        ]
> [New LWP    9        ]
> [New LWP    10        ]
> [New LWP    11        ]
> [New LWP    12        ]
> [New LWP    13        ]
> [New LWP    14        ]
> [New LWP    15        ]
> [New LWP    16        ]
> [New LWP    17        ]
> [New LWP    18        ]
> [New LWP    19        ]
> [New LWP    20        ]
> [New LWP    21        ]
> [New LWP    22        ]
> [New LWP    23        ]
> [New LWP    24        ]
> [New LWP    25        ]
> [New LWP    26        ]
> [New LWP    27        ]
> [New LWP    28        ]
> [New LWP    29        ]
> [New LWP    30        ]
> [New LWP    31        ]
> [New LWP    32        ]
> [New LWP    33        ]
> [New LWP    34        ]
> [New LWP    35        ]
> [New LWP    36        ]
> [New LWP    37        ]
> [New LWP    38        ]
> [New LWP    39        ]
> [New LWP    40        ]
> [New LWP    41        ]
> [New LWP    42        ]
> [New LWP    43        ]
> [New LWP    44        ]
> [New LWP    45        ]
> [New LWP    46        ]
> [New LWP    47        ]
> [New LWP    48        ]
> [New LWP    49        ]
> [New LWP    50        ]
> [New LWP    51        ]
> [New LWP    52        ]
> [New LWP    53        ]
> [New LWP    54        ]
> [New LWP    55        ]
> [New LWP    56        ]
> [New LWP    57        ]
> [New LWP    58        ]
> [New LWP    59        ]
> [New LWP    60        ]
> [New LWP    61        ]
> [New LWP    62        ]
> [New LWP    63        ]
> [New LWP    64        ]
> [New LWP    65        ]
> [New LWP    66        ]
> [New LWP    67        ]
> [New LWP    68        ]
> [New LWP    69        ]
> [New LWP    70        ]
> [New LWP    71        ]
> [New LWP    72        ]
> [New LWP    73        ]
> [New LWP    74        ]
> [New LWP    75        ]
> [New LWP    76        ]
> [New LWP    77        ]
> [New LWP    78        ]
> [New LWP    79        ]
> [New LWP    80        ]
> [New LWP    81        ]
> [New LWP    82        ]
> [New LWP    83        ]
> [New LWP    84        ]
> [New LWP    85        ]
> [New LWP    86        ]
> [New LWP    87        ]
> [New LWP    88        ]
> [LWP    84         exited]
> [LWP    82         exited]
> [LWP    85         exited]
> [New LWP    89        ]
> [New LWP    90        ]
> [New LWP    91        ]
> [New LWP    92        ]
> [New LWP    93        ]
> [New LWP    94        ]
> [New LWP    95        ]
> [New LWP    96        ]
> [New LWP    97        ]
> [New LWP    98        ]
> [New LWP    99        ]
> [New LWP    100        ]
> Assertion failure: NS_IsMainThread(), at /apps/Pale-Moon/platform/security/manager/ssl/nsNSSComponent.cpp:261
> [New Thread 4 (LWP 4)]
> [New Thread 2 (LWP 2)]
> [New Thread 5        ]
> [New Thread 6        ]
> [New Thread 7        ]
> [New Thread 8        ]
> [New Thread 9        ]
> [New Thread 10        ]
> [New Thread 11        ]
> [New Thread 12        ]
> [New Thread 13        ]
> [New Thread 14        ]
> [New Thread 15        ]
> [New Thread 16        ]
> [New Thread 17        ]
> [New Thread 18        ]
> [New Thread 19        ]
> [New Thread 20        ]
> [New Thread 21        ]
> [New Thread 22        ]
> [New Thread 23        ]
> [New Thread 24        ]
> [New Thread 25        ]
> [New Thread 26        ]
> [New Thread 27        ]
> [New Thread 28        ]
> [New Thread 29        ]
> [New Thread 30        ]
> [New Thread 31        ]
> [New Thread 32        ]
> [New Thread 33        ]
> [New Thread 34        ]
> [New Thread 35        ]
> [New Thread 36        ]
> [New Thread 37        ]
> [New Thread 38        ]
> [New Thread 39        ]
> [New Thread 40        ]
> [New Thread 41        ]
> [New Thread 42        ]
> [New Thread 43        ]
> [New Thread 44 (LWP 44)]
> [New Thread 45 (LWP 45)]
> [New Thread 46        ]
> [New Thread 47        ]
> [New Thread 48        ]
> [New Thread 49        ]
> [New Thread 50        ]
> [New Thread 51        ]
> [New Thread 52        ]
> [New Thread 53        ]
> [New Thread 54        ]
> [New Thread 55        ]
> [New Thread 56        ]
> [New Thread 57        ]
> [New Thread 58        ]
> [New Thread 59        ]
> [New Thread 60        ]
> [New Thread 61        ]
> [New Thread 62        ]
> [New Thread 63        ]
> [New Thread 64        ]
> [New Thread 65        ]
> [New Thread 66        ]
> [New Thread 67        ]
> [New Thread 68        ]
> [New Thread 69        ]
> [New Thread 70        ]
> [New Thread 71        ]
> [New Thread 72        ]
> [New Thread 73        ]
> [New Thread 74        ]
> [New Thread 75        ]
> [New Thread 76        ]
> [New Thread 77        ]
> [New Thread 78        ]
> [New Thread 79        ]
> [New Thread 80        ]
> [New Thread 81        ]
> [New Thread 83        ]
> [New Thread 86        ]
> [New Thread 87        ]
> [New Thread 88        ]
> [New Thread 89        ]
> [New Thread 90        ]
> [New Thread 91 (LWP 91)]
> [New Thread 92        ]
> [New Thread 93        ]
> [New Thread 94        ]
> [New Thread 95 (LWP 95)]
> [New Thread 96        ]
> [New Thread 97        ]
> [New Thread 98        ]
> [New Thread 99        ]
> [New Thread 100 (LWP 100)]
> Thread 102 received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 4 (LWP 4)]
> nsNSSComponent::nsNSSComponent (this=0xf591c140) at /apps/Pale-Moon/platform/security/manager/ssl/nsNSSComponent.cpp:261
> 261       MOZ_RELEASE_ASSERT(NS_IsMainThread());
> (gdb) where
> #0  nsNSSComponent::nsNSSComponent() (this=0xf591c140) at /apps/Pale-Moon/platform/security/manager/ssl/nsNSSComponent.cpp:261
> #1  0xfc2ab4d4 in nsNSSComponentConstructor(nsISupports*, nsIID const&, void**) (aOuter=0x0, aIID=..., aResult=0xf5bfb280)
>     at /apps/Pale-Moon/platform/security/manager/ssl/nsNSSModule.cpp:173
> #2  0xf9d24204 in mozilla::GenericFactory::CreateInstance(nsISupports*, nsID const&, void**) (this=0xded86d60, aOuter=0x0, aIID=..., aResult=0xf5bfb280)
>     at /apps/Pale-Moon/platform/xpcom/glue/GenericFactory.cpp:16
> #3  0xf9cfb0b4 in nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**) (this=this@entry=
>     0xfe4ca400, aContractID=aContractID@entry=0xf9ab4ee0 "@mozilla.org/psm;1", aDelegate=aDelegate@entry=0x0, aIID=..., aResult=0xf5bfb280, this=<optimized out>)
>     at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1169
> #4  0xf9cfc234 in nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**)
>     (aResult=<optimized out>, aIID=..., aDelegate=0x0, aContractID=0xf9ab4ee0 "@mozilla.org/psm;1", this=0xfe4ca400, this=<optimized out>)
>     at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1142
> #5  nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**) (this=0xfe4ca400, aContractID=0xf9ab4ee0 "@mozilla.org/psm;1", aIID=..., aResult=0xf5bfb35c)
>     at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1525
> #6  0xf9d3399c in CallGetService(char const*, nsID const&, void**) (aResult=0xf5bfb35c, aIID=..., aContractID=<optimized out>)
>     at /apps/Pale-Moon/platform/xpcom/glue/nsComponentManagerUtils.cpp:68
> #7  nsGetServiceByContractID::operator()(nsID const&, void**) const (this=0xf5bfb354, aIID=..., aInstancePtr=0xf5bfb35c)
>     at /apps/Pale-Moon/platform/xpcom/glue/nsComponentManagerUtils.cpp:279
> #8  0xf9d29ff4 in nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID const&) (this=0xf5bfb3cc, aGS=..., aIID=...)
>     at /apps/Pale-Moon/platform/xpcom/glue/nsCOMPtr.cpp:94
> #9  0xfc2a2b10 in nsCOMPtr<nsINSSComponent>::nsCOMPtr(nsGetServiceByContractID) (aGS=..., this=0xf5bfb3cc)
>     at /apps/Pale-Moon/obj-sparc-sun-solaris2.11/dist/include/nsCOMPtr.h:554
> #10 EnsureNSSInitialized(EnsureNSSOperator) (op=<optimized out>) at /apps/Pale-Moon/platform/security/manager/ssl/nsNSSComponent.cpp:193
> #11 0xfc2a3298 in (anonymous namespace)::nsSSLSocketProviderConstructor(nsISupports*, nsIID const&, void**) (aOuter=0x0, aIID=..., aResult=0xf5bfb560)
>     at /apps/Pale-Moon/platform/security/manager/ssl/nsNSSModule.cpp:186
> #12 0xf9d24204 in mozilla::GenericFactory::CreateInstance(nsISupports*, nsID const&, void**) (this=0xf59120f0, aOuter=0x0, aIID=..., aResult=0xf5bfb560)
>     at /apps/Pale-Moon/platform/xpcom/glue/GenericFactory.cpp:16
> #13 0xf9cfb0b4 in nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**)
>     (this=this@entry=0xfe4ca400, aContractID=aContractID@entry=0xf5bfb608 "@mozilla.org/network/socket;2?type=ssl", aDelegate=aDelegate@entry=0x0, aIID=..., aResult=0xf5bfb560, this=<optimized out>) at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1169
> #14 0xf9cfc234 in nsComponentManagerImpl::CreateInstanceByContractID(char const*, nsISupports*, nsID const&, void**)
>     (aResult=<optimized out>, aIID=..., aDelegate=0x0, aContractID=0xf5bfb608 "@mozilla.org/network/socket;2?type=ssl", this=0xfe4ca400, this=<optimized out>)
>     at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1142
> #15 nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**) (this=0xfe4ca400, aContractID=0xf5bfb608 "@mozilla.org/network/socket;2?type=ssl", aIID=..., aResult=0xf5bfb6c0) at /apps/Pale-Moon/platform/xpcom/components/nsComponentManager.cpp:1525
> #16 0xf9f98a94 in CallGetService<nsISocketProvider>(char const*, nsISocketProvider**) (aDestination=0xf5bfb6c0, aContractID=<optimized out>) at /apps/Pale-Moon/obj-sparc-sun-solaris2.11/dist/include/nsServiceManagerUtils.h:90
> #17 nsSocketProviderService::GetSocketProvider(char const*, nsISocketProvider**) (this=this@entry=0xf5934090, type=type@entry=0xf5918110 "ssl", result=0xf5bfb6c0) at /apps/Pale-Moon/platform/netwerk/socket/nsSocketProviderService.cpp:39
> #18 0xf9dbcdbc in mozilla::net::nsSocketTransport::Init(char const**, unsigned int, nsACString_internal const&, unsigned short, nsACString_internal const&, unsigned short, nsIProxyInfo*) (this=this@entry=0xf5922800, types=types@entry=0xf5bfb7ac, typeCount=typeCount@entry=1, host=..., port=port@entry=443, hostRoute=..., portRoute=<optimized out>, givenProxyInfo=<optimized out>) at /apps/Pale-Moon/platform/netwerk/base/nsSocketTransport2.cpp:866
> #19 0xf9dc3cfc in mozilla::net::nsSocketTransportService::CreateRoutedTransport(char const**, unsigned int, nsACString_internal const&, int, nsACString_internal const&, int, nsIProxyInfo*, nsISocketTransport**) (this=this@entry=0xfe450700, types=types@entry=0xf5bfb7ac, typeCount=typeCount@entry=1, host=..., port=port@entry=443, hostRoute=..., portRoute=<optimized out>, portRoute@entry=443, proxyInfo=<optimized out>, result=<optimized out>) at /apps/Pale-Moon/platform/netwerk/base/nsSocketTransportService2.cpp:737
> #20 0xfa08f804 in mozilla::net::nsHttpConnectionMgr::nsHalfOpenSocket::SetupStreams(nsISocketTransport**, nsIAsyncInputStream**, nsIAsyncOutputStream**, bool) (this=this@entry=0xf5916320, transport=transport@entry=0xf5916340, instream=instream@entry=0xf5916348, outstream=0xf5916344, isBackup=isBackup@entry=false) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:2999
> #21 0xfa08fd40 in mozilla::net::nsHttpConnectionMgr::nsHalfOpenSocket::SetupPrimaryStreams() (this=0xf5916320) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:3106
> #22 0xfa090c24 in mozilla::net::nsHttpConnectionMgr::CreateTransport(mozilla::net::nsHttpConnectionMgr::nsConnectionEntry*, mozilla::net::nsAHttpTransaction*, unsigned int, bool, bool, bool) (this=this@entry=0xf06e9ec0, ent=ent@entry=0xf591e070, trans=trans@entry=0xdd5a6c00, caps=33, speculative=speculative@entry=false, isFromPredictor=isFromPredictor@entry=false, allow1918=allow1918@entry=true) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:1967
> #23 0xfa093cf4 in mozilla::net::nsHttpConnectionMgr::MakeNewConnection(mozilla::net::nsHttpConnectionMgr::nsConnectionEntry*, mozilla::net::nsHttpTransaction*) (this=this@entry=0xf06e9ec0, ent=ent@entry=0xf591e070, trans=trans@entry=0xdd5a6c00) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:1288
> #24 0xfa094e78 in mozilla::net::nsHttpConnectionMgr::TryDispatchTransaction(mozilla::net::nsHttpConnectionMgr::nsConnectionEntry*, bool, mozilla::net::nsHttpTransaction*) (this=this@entry=0xf06e9ec0, ent=ent@entry=0xf591e070, onlyReusedConnection=<optimized out>, trans=trans@entry=0xdd5a6c00) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:1603
> #25 0xfa095408 in mozilla::net::nsHttpConnectionMgr::ProcessNewTransaction(mozilla::net::nsHttpTransaction*) (this=this@entry=0xf06e9ec0, trans=trans@entry=0xdd5a6c00) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:1891
> #26 0xfa095470 in mozilla::net::nsHttpConnectionMgr::OnMsgNewTransaction(int, mozilla::net::ARefBase*) (this=0xf06e9ec0, priority=0, param=0xdd5a6c14) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:2184
> #27 0xfa096ec0 in RefPtr<mozilla::net::nsHttpConnectionMgr>::Proxy<void, int, mozilla::net::ARefBase*>::operator()<int&, RefPtr<mozilla::net::ARefBase>&>(int&, RefPtr<mozilla::net::ARefBase>&) (this=<optimized out>) at /apps/Pale-Moon/obj-sparc-sun-solaris2.11/dist/include/mozilla/RefPtr.h:337
> #28 mozilla::net::ConnEvent::Run() (this=<optimized out>) at /apps/Pale-Moon/platform/netwerk/protocol/http/nsHttpConnectionMgr.cpp:206
> #29 0xf9d0aa88 in nsThread::ProcessNextEvent(bool, bool*) (this=0xfe4507a0, aMayWait=<optimized out>, aResult=0xf5bfbbf7) at /apps/Pale-Moon/platform/xpcom/threads/nsThread.cpp:1140
> #30 0xf9d3756c in NS_ProcessNextEvent(nsIThread*, bool) (aThread=<optimized out>, aMayWait=<optimized out>) at /apps/Pale-Moon/platform/xpcom/glue/nsThreadUtils.cpp:355
> #31 0xf9dc2c00 in mozilla::net::nsSocketTransportService::Run() (this=0xfe450700) at /apps/Pale-Moon/platform/netwerk/base/nsSocketTransportService2.cpp:885
> #32 0xf9d0aa88 in nsThread::ProcessNextEvent(bool, bool*) (this=0xfe4507a0, aMayWait=<optimized out>, aResult=0xf5bfbd87) at /apps/Pale-Moon/platform/xpcom/threads/nsThread.cpp:1140
> #33 0xf9d3756c in NS_ProcessNextEvent(nsIThread*, bool) (aThread=<optimized out>, aMayWait=<optimized out>) at /apps/Pale-Moon/platform/xpcom/glue/nsThreadUtils.cpp:355
> #34 0xfa135ee4 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) (this=0xf5910050, aDelegate=0xf590a100) at /apps/Pale-Moon/platform/ipc/glue/MessagePump.cpp:337
> #35 0xfa0e8250 in MessageLoop::RunInternal() (this=0xf590a100) at /apps/Pale-Moon/platform/ipc/chromium/src/base/message_loop.cc:231
> #36 MessageLoop::RunHandler() (this=0xf590a100) at /apps/Pale-Moon/platform/ipc/chromium/src/base/message_loop.cc:224
> #37 MessageLoop::Run() (this=this@entry=0xf590a100) at /apps/Pale-Moon/platform/ipc/chromium/src/base/message_loop.cc:204
> #38 0xf9d068ec in nsThread::ThreadFunc(void*) (aArg=0xfe4507a0) at /apps/Pale-Moon/platform/xpcom/threads/nsThread.cpp:458
> #39 0xfee3077c in _pt_root (arg=0xf6b48240) at /apps/Pale-Moon/platform/nsprpub/pr/src/pthreads/ptthread.c:201
> #40 0xfec68cdc in _lwp_start () at /lib/libc.so.1
>


New Tobin Paradigm

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by New Tobin Paradigm » 2021-05-08, 00:29

Are you doing a debug build?

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1498
Joined: 2018-10-28, 19:56
Location: Georgia

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by athenian200 » 2021-05-08, 00:48

Michele wrote:
2021-05-08, 00:00
This is Bug 2:

Running on Solaris 11.4 on SPARC -- the security manager code, which asserts that it is called only from the main thread, seems to be called from some other thread. This is reproducible.
I can actually tell you what's going on with that one, it gave me quite a headache. Essentially, it's not clear from the error message, but NSS is failing to find some of shared libraries it needs. These can be either C++ libraries used by GCC, or some of the shared libraries built into the browser.

https://repo.palemoon.org/MoonchildProd ... 495f1deb6e

This is how I made sure it would always find the C++ libraries GCC uses on x86. I have it hard-coded to use GCC 7 right now, as I haven't tested heavily on other versions of GCC. But anyway, if you're using ./mach run and not actually using ./mach package and then unpacking, then there's an additional issue that would require you to use:

Code: Select all

export LD_LIBRARY_PATH=/apps/Pale-Moon/obj-sparc-sun-solaris2.11/dist/bin
Before invoking ./mach run. I meant to submit a patch for that issue, but I never got around to it.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-08, 00:58

It's not a debug build, but it is compiled with "-g" and the executables are not stripped, so we can see what's going on.
The assertion that's failing is a MOZ_RELEASER_ASSERT.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1498
Joined: 2018-10-28, 19:56
Location: Georgia

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by athenian200 » 2021-05-08, 01:20

Michele wrote:
2021-05-08, 00:58
The assertion that's failing is a MOZ_RELEASE_ASSERT.
Yeah, I know what assertion that is. NSS hides a lot of the details and won't tell you exactly what's going on there for security reasons. Basically, Solaris actually has a long-standing issue where it gets confused by linker paths that involve symlinks unless you explicitly use LD_LIBRARY_PATH, and unfortunately Mozilla's build/test system relies on temporary symlinks in dist/bin rather than simply copying the files to the place they'll be after the whole thing is unpacked. The old pre-mach build system accounted for this issue:

https://bug472269.bmoattachments.org/at ... ?id=360070

And I did something similar for mach in the patch I never submitted:

https://github.com/athenian200/UXP/comm ... 55b3cadacd

But yeah, that is probably what the NSS issue boils down to. You may also need to add the directory for the GCC libraries used for building to LD_LIBRARY_PATH for testing, at least until you figure out the right settings for MOZ_FIX_LINK_PATHS and rebuild. I'm sorry, I know this is a really confusing and counter-intuitive answer, but I saw that error hundreds of times and this is how I solved it after a month of scratching my head.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-09, 01:02

Well I am extremely pleased to report that we now have Pale Moon running on Solaris 11.4 SPARC. The response on my 64 CPU 2.85 GHz. T4-1 is smooth and snappy - faster than the old Firefox it came with.
ss20.jpg
More or less. Everything seems to work except for the search bar. If you type in a URL, any URL, it just sits there forever doing nothing. But if I type in a query in the search box in the Pale Moon home page and then click on the result, it takes me right to the page. That's odd.

I'd love to take credit for this accomplishment but I'm afraid my contribution didn't extend much beyond providing the hardware. All of the heavy lifting was done by my friend, a consummate computer scientist and genius programmer. I'd give him personal credit but don't have his permission to do so. Suffice it to say this achievement would not have happened without his laser-focused insight and dogged determination. There's still a few issues I'll address in a following post.

New Tobin Paradigm

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by New Tobin Paradigm » 2021-05-09, 01:06

On not-windows for some reason the search provider can't access the search engines until fully packaged. I haven't figured it out exactly why but it seems to have always been a thing. In any event, yeah. Just package up. Also, would you be willing to being a possible sparc build contributor at some arbitrary point in the future?

athenian200, check your configure shit and make sure sparc is included cause it obviously sparc works least works decently well for a hardly tested environment.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1498
Joined: 2018-10-28, 19:56
Location: Georgia

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by athenian200 » 2021-05-09, 14:32

I'm glad you got this working! I hope my input on the second bug helped out.

Well, I don't know the paths for everything on SPARC and I'm not used to working with it at all. I tried adding SPARC support to configure at one point and couldn't find all the right places to add it in. Which is probably why I couldn't build successfully.

I really would like to see the patches and process you used to get this building, though. You must have found everything I missed, and I'm really curious as to what was done. I could definitely clean up and complete a preliminary set of patches and make sure they tap into everything else I have for it, but I don't have an understanding right now of what needs to be included or checked to make SPARC work.

I may have been able to get Solaris working on x86 and x86_64, but when it comes to other architectures... well, I just don't have enough experience with other architectures and server hardware to be able to deal with what working on a SPARC system entails. The guy who got this working must be truly impressive. :)
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-09, 15:36

New Tobin Paradigm wrote:
2021-05-09, 01:06
On not-windows for some reason the search provider can't access the search engines until fully packaged. I haven't figured it out exactly why but it seems to have always been a thing. In any event, yeah. Just package up. Also, would you be willing to being a possible sparc build contributor at some arbitrary point in the future?
Mr. Big is working on the packaging right now. I'd be happy to help contribute any way I can. Would you like an account on my Sun T4-1?

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-09, 15:48

athenian200 wrote:
2021-05-09, 14:32
I'm glad you got this working! I hope my input on the second bug helped out.
Thank you, yes it did. I apologize for not mentioning it sooner but things have been moving quickly the past few days.
athenian200 wrote:
2021-05-09, 14:32
Well, I don't know the paths for everything on SPARC and I'm not used to working with it at all. I tried adding SPARC support to configure at one point and couldn't find all the right places to add it in. Which is probably why I couldn't build successfully.

I really would like to see the patches and process you used to get this building, though. You must have found everything I missed, and I'm really curious as to what was done. I could definitely clean up and complete a preliminary set of patches and make sure they tap into everything else I have for it, but I don't have an understanding right now of what needs to be included or checked to make SPARC work.

I may have been able to get Solaris working on x86 and x86_64, but when it comes to other architectures... well, I just don't have enough experience with other architectures and server hardware to be able to deal with what working on a SPARC system entails. The guy who got this working must be truly impressive. :)
Impressive is not the word. This man is beyond a genius. He is not only an expert C and C++ programmer but he has a very very deep knowledge of Solaris and SPARC. He's truly a natural. He can look at errors that make my eyes cross and go, "Oh, I think I see what's wrong here". We've been emailing back and forth behind the scenes and he motored through a pile of stuff I never mentioned here. I know there were a number of obscure endian issues. I'll ask if he'd mind creating an overview of how he accomplished this miracle but I'm already very much in his debt.

Bottom line, I'm just tickled to finally have a modern browser that didn't require Rust to build. My quest to declare my independence from Wintel is now complete.

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-09, 20:46

Here is a new nugget from the Master Programmer:

> This one about the dev/debug infrastructure --
>
> When you're using gdb-10 the "def" commands in the Pale-Moon/platform/.gdbinit are now ambiguous, for example:
>
> # run when using the auto-solib-add trick
> define prun
> [...]
> end
>
> results in
>
> (gdb) def prun
> Ambiguous command "def prun": define, define-prefix.
> (gdb) quit
>
> ... so the "def"s all need to be "define" to get the desired effect.
>

Michele

Re: [Solaris] Runtime error: failure to initialize a pthread condition variable

Unread post by Michele » 2021-05-10, 16:33

Well we made a package but it didn't help. I am still unable to visit a web site by typing its URL into the URL bar at the top of the window. I also don't get anything happening if I type a query into the search box at the top of the window. I *am* able to visit any site by typing it into the DuckDuckGo that appears on the PM home page and then clicking on that search result. But the new page appears in the same tab even though I have "open new links in a new tab" selected in Preferences. And if I right click the link and say "Open in New Tab", there, nothing happens.

We were discussing this and here's the latest from the master programmer:

I'm not sure what the real solution is for the hack I put in to ignore the ConditionVariable EINVAL problem. As far as I'm concerned there's some incompatibility between the way the JavaScript implementation is using pthread_cond_init() and the Solaris pthread library. At the moment, the code just ignores the failure and presses on -- which doesn't seem to have any fatal results, but could result in some odd behavior. Maybe even a problem with input in a javascript enabled input field ;-)

The icudt58b.dat is also not properly handled -- while the patches are sufficient to make it load the right file (the "b" version instead of the "l" version) the dependencies and targets aren't working correctly to have it build the right file -- which is why I just copied in Firefox's version, which should contain the same stuff.

Also, they seem to generate the package-manifest, and it doesn't include the icudt58b.dat and so needs editing, and it does contain a reference to "libfreebl3.so" which doesn't exist, either in firefox for SPARC or PaleMoon -- though PaleMoon has other incarnations of libfreebl3 --

./security/nss/lib/freebl/libfreebl.a
./security/nss/lib/freebl/SunOS_ABI32_FPU/libfreebl_32fpu_3.so
./security/nss/lib/freebl/SunOS_ABI32_INT64/libfreebl_32int64_3.so
./dist/Palemoon/libfreebl_32int64_3.chk
./dist/Palemoon/libfreebl_32fpu_3.so
./dist/Palemoon/libfreebl_32fpu_3.chk
./dist/Palemoon/libfreebl_32int64_3.so
./dist/bin/libfreebl_32fpu_3.so
./dist/bin/libfreebl_32int64_3.so
./dist/lib/libfreebl_32int64_3.so
./dist/lib/libfreebl_32fpu_3.so
./dist/lib/libfreebl.a

and the generated package manifest does have references to

bin/libfreebl_32fpu_3.so
bin/libfreebl_32int64_3.so

Probably an issue for someone who knows how the packaging works...

Locked