Bug#824449: firefox: FTBFS on sparc64 due to wrong platform definitions

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Fri May 20 21:06:06 UTC 2016


Hi!

Some more updates:

Jose Marchesi from Oracle has provided me with two old patches that
were used to address the problem with Firefox 17.

Those patches are:

- xulrunner-linux-sparc64-xpcom.patch
- xulrunner-linux-sparc64.patch

Those patches didn't apply anymore right away. I had to update some
paths (src was omitted in some cases), plus the two following
changes:

1. I adjusted the padding in JSTryNote so it would be 64-bit aligned
   again as Firefox 46 changed stackDepth from uint16_t to uint32_t.

2. The patch to memory/jemalloc/src/include/jemalloc/internal
   /jemalloc_internal.h.in can't be applied anymore at all, even
   with editing. The code section is gone.

With these changes included, the new patch (sparc64-fixes.patch)
applies without problems but compiling Firefox will still crash
xpcshell:

(sid)root at deb4g:/build/firefox-ORgwZM/firefox-46.0.1# export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/build/firefox-ORgwZM/firefox-46.0.1/build-browser/dist/bin/
(sid)root at deb4g:/build/firefox-ORgwZM/firefox-46.0.1#
./build-browser/dist/bin/xpcshell

(process:240502): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Segmentation fault
(sid)root at deb4g:/build/firefox-ORgwZM/firefox-46.0.1#

The backtrace looks like this:

(gdb) bt
#0  0xfff8000102a117c4 in js::gc::Cell::storeBuffer (this=<optimized
out>) at /build/firefox-F4xXKx/firefox-46.0.1/js/src/gc/Heap.h:1339
#1  js::HeapSlot::post (target=..., slot=0, kind=js::HeapSlot::Slot,
owner=0xfff8000112523070, this=0xfff8000112523090)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/gc/Barrier.h:692
#2  js::HeapSlot::set (this=0xfff8000112523090,
owner=owner at entry=0xfff8000112523070, slot=slot at entry=0, v=...,
kind=js::HeapSlot::Slot)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/gc/Barrier.h:679
#3  0xfff8000102a13634 in js::NativeObject::setSlot
(this=0xfff8000112523070, value=..., slot=0)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/vm/NativeObject.h:824
#4  0xfff8000102a13758 in js::NativeObject::setReservedSlot (v=...,
index=0, this=<optimized out>)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/vm/NativeObject.h:890
#5  js::ClonedBlockObject::create (cx=cx at entry=0xfff800010a73a400,
block=..., enclosing=...)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/vm/ScopeObject.cpp:945
#6  0xfff8000102a18f1c in js::ClonedBlockObject::createGlobal
(cx=cx at entry=0xfff800010a73a400, global=...)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/vm/ScopeObject.cpp:976
#7  0xfff80001029b43fc in js::GlobalObject::createInternal
(cx=cx at entry=0xfff800010a73a400,
    clasp=0xfff8000103e07028
<JSRuntime::createSelfHostingGlobal(JSContext*)::shgClass>) at
/build/firefox-F4xXKx/firefox-46.0.1/js/src/vm/GlobalObject.cpp:278
#8  0xfff8000102a062bc in JSRuntime::createSelfHostingGlobal
(cx=cx at entry=0xfff800010a73a400)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/vm/SelfHosting.cpp:1956
#9  0xfff8000102a08988 in JSRuntime::initSelfHosting
(this=this at entry=0xfff800010c3d2000, cx=cx at entry=0xfff800010a73a400)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/vm/SelfHosting.cpp:1988
#10 0xfff8000102876f74 in js::NewContext (rt=0xfff800010c3d2000,
rt at entry=0x0, stackChunkSize=stackChunkSize at entry=8192)
    at /build/firefox-F4xXKx/firefox-46.0.1/js/src/jscntxt.cpp:121
#11 0xfff8000102876fbc in JS_NewContext (rt=0x0,
stackChunkSize=stackChunkSize at entry=8192) at
/build/firefox-F4xXKx/firefox-46.0.1/js/src/jsapi.cpp:573
#12 0xfff8000101058308 in XPCJSContextStack::InitSafeJSContext
(this=0xfff800010b248240)
    at
/build/firefox-F4xXKx/firefox-46.0.1/js/xpconnect/src/XPCJSContextStack.cpp:122
#13 0xfff80001010738ac in nsXPConnect::InitStatics () at
/build/firefox-F4xXKx/firefox-46.0.1/js/xpconnect/src/nsXPConnect.cpp:126
#14 0xfff800010105ccd4 in xpcModuleCtor () at
/build/firefox-F4xXKx/firefox-46.0.1/js/xpconnect/src/XPCModule.cpp:13
#15 0xfff800010229b818 in Initialize () at
/build/firefox-F4xXKx/firefox-46.0.1/layout/build/nsLayoutModule.cpp:436
#16 0xfff8000100bf9070 in nsComponentManagerImpl::KnownModule::Load
(this=0xfff800010b22f280)
    at
/build/firefox-F4xXKx/firefox-46.0.1/xpcom/components/nsComponentManager.cpp:898
#17 0xfff8000100bfa018 in nsFactoryEntry::GetFactory
(this=0xfff800010b23a180)
    at
/build/firefox-F4xXKx/firefox-46.0.1/xpcom/components/nsComponentManager.cpp:1934
#18 0xfff8000100bfa8d4 in
nsComponentManagerImpl::CreateInstanceByContractID
(this=0xfff800010a7f60c0,
    aContractID=0xfff8000102bb8b98 "@mozilla.org/moz/jsloader;1",
aDelegate=0x0, aIID=..., aResult=0x7feffffe930)
    at
/build/firefox-F4xXKx/firefox-46.0.1/xpcom/components/nsComponentManager.cpp:1232
#19 0xfff8000100bfc298 in nsComponentManagerImpl::GetServiceByContractID
(this=0xfff800010a7f60c0,
    aContractID=0xfff8000102bb8b98 "@mozilla.org/moz/jsloader;1",
aIID=..., aResult=0x7feffffeac0)
    at
/build/firefox-F4xXKx/firefox-46.0.1/xpcom/components/nsComponentManager.cpp:1592
#20 0xfff8000100c28514 in CallGetService (aContractID=0xfff8000102bab760
<nsISupports::COMTypeInfo<nsISupports, void>::kIID> "", aIID=...,
aResult=0x0,
    aResult at entry=0x7feffffeac0) at
/build/firefox-F4xXKx/firefox-46.0.1/xpcom/glue/nsComponentManagerUtils.cpp:69
#21 0xfff8000100c28538 in nsGetServiceByContractID::operator()
(this=this at entry=0x7feffffeb58, aIID=...,
aInstancePtr=aInstancePtr at entry=0x7feffffeac0)
    at
/build/firefox-F4xXKx/firefox-46.0.1/xpcom/glue/nsComponentManagerUtils.cpp:280
#22 0xfff8000100c202b0 in nsCOMPtr_base::assign_from_gs_contractid
(this=this at entry=0x7feffffeba0, aGS=..., aIID=...)
    at /build/firefox-F4xXKx/firefox-46.0.1/xpcom/glue/nsCOMPtr.cpp:103
#23 0xfff8000100c24c28 in nsCOMPtr<nsISupports>::nsCOMPtr (aGS=...,
this=0x7feffffeba0)
    at
/build/firefox-F4xXKx/firefox-46.0.1/build-browser/dist/include/nsCOMPtr.h:855
#24 NS_InitXPCOM2 (aResult=0x7feffffedd8, aBinDirectory=<optimized out>,
aAppFileLocationProvider=<optimized out>)
    at /build/firefox-F4xXKx/firefox-46.0.1/xpcom/build/XPCOMInit.cpp:724
---Type <return> to continue, or q <return> to quit---
#25 0xfff8000100c24de0 in NS_InitXPCOM2 (aResult=0x1,
aBinDirectory=0x7fefffff598, aAppFileLocationProvider=0x7fefffff5a8,
aAppFileLocationProvider at entry=0x7feffffee90)
    at /build/firefox-F4xXKx/firefox-46.0.1/xpcom/build/XPCOMInit.cpp:481
#26 0xfff800010107a794 in XRE_XPCShellMain (argc=1, argv=0x7fefffff598,
envp=0x7fefffff5a8) at
/build/firefox-F4xXKx/firefox-46.0.1/js/xpconnect/src/XPCShellImpl.cpp:1424
#27 0x0000010000004710 in main (argc=1, argv=0x7fefffff598,
envp=0x7fefffff5a8) at
/build/firefox-ORgwZM/firefox-46.0.1/js/xpconnect/shell/xpcshell.cpp:54
(gdb)

Michael Karcher was able to identify this as an issue with JSValue which
has been reported before upstream [1]. The suggested fix, using a hint
for mmap to force memory being allocated above 0x0000070000000000UL
which doesn't work on Linux however, since the hint is completely
ignored on consecutive calls and the memory is again allocated
in the lower area:

root at deb4g:~# cat vmtest.c
#include <stdio.h>
#include <sys/mman.h>

int main(void)
{
	void *ptr1, *ptr2, *ptr3;
	ptr1 = mmap(NULL, 1024*1024, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
	ptr2 = mmap((void*)0x0000070000000000UL, 1024*1024, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
	ptr3 = mmap((void*)0x0000070000000000UL, 1024*1024, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
	printf("%p %p %p\n", ptr1, ptr2, ptr3);
}
root at deb4g:~# ./vmtest
0xfff800010038e000 0x70000000000 0xfff800010048e000
root at deb4g:~#

Thus, in order to fix this issue on sparc64/Linux, a more elaborate
fix will have to be developed.

Adrian

> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=994133

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xulrunner-linux-sparc64-xpcom.patch
Type: text/x-patch
Size: 13518 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/attachments/20160520/0251436a/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xulrunner-linux-sparc64.patch
Type: text/x-patch
Size: 6155 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/attachments/20160520/0251436a/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sparc64-fixes.patch
Type: text/x-patch
Size: 15882 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/attachments/20160520/0251436a/attachment-0005.bin>


More information about the pkg-mozilla-maintainers mailing list