Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Dec 2001 17:06:04 +0200
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        gnome@FreeBSD.org, freebsd-alpha@FreeBSD.org
Subject:   Re: native mozilla not building on alpha
Message-ID:  <3C2C8A5C.70EA706C@FreeBSD.org>
References:  <15363.47667.320500.37327@grasshopper.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
I've added your patches into 0.9.7. As for your problems with starting
Mozilla on alpha, I think that it would be better to submit your
report to Mozilla developers instead, because they obviously have more
clue about what's going on.

Thanks!

-Maxim

Andrew Gallatin wrote:
> 
> Hi,
> 
> I've fixed a few bugs which get mozilla most of the way through the
> compile on alpha, but it crashes with a segv in the final stages of
> the build.
> 
> I've appended a patch.  This patch adds 3 files which do the
> following:
> 
> files/patch-nsprpub::pr::include::md::_freebsd.cfg:
> 
> - Add IS_64, like other 64-bit platforms have.
> 
> files/patch-xpfe::bootstrap::nsAppRunner.cpp:
> 
> - Use ieeefp.h rather than floatingpoint.h so that fpsetmask() proto
> gets used on alpha
> 
> files/patch-extensions::transformiix::source::base::Double.cpp
> 
> - Use ieeefp.h rather than floatingpoint.h so that fpsetmask() proto
> gets used on alpha
> - FP_X_DNML does not exist on alpha; do not use it.
> 
> Hoever, things still don't work.  The build dies like this:
> 
> gmake[1]: Leaving directory `/home/gallatin/ports/www/mozilla/work/mozilla/mailnews'
> gmake[1]: Entering directory `/home/gallatin/ports/www/mozilla/work/mozilla/l10n'
> gmake[2]: Entering directory `/home/gallatin/ports/www/mozilla/work/mozilla/l10n/langpacks'
> gmake[2]: Leaving directory `/home/gallatin/ports/www/mozilla/work/mozilla/l10n/langpacks'
> gmake[1]: Leaving directory `/home/gallatin/ports/www/mozilla/work/mozilla/l10n'
> gmake[1]: Entering directory `/home/gallatin/ports/www/mozilla/work/mozilla/xpfe/bootstrap'
> ../../config/nsinstall -R -m 755 mozilla-bin ../../dist/bin
> ../../config/nsinstall -R mozilla ../../dist/bin
> ../../config/nsinstall -R splash.xpm ../../dist/bin
> gmake[1]: Leaving directory `/home/gallatin/ports/www/mozilla/work/mozilla/xpfe/bootstrap'
> Type Manifest File: /home/gallatin/ports/www/mozilla/work/mozilla/dist/bin/components/xpti.dat
> nsNativeComponentLoader: autoregistering begins.
> *** Registering UcharUtil components (all right -- a generic module!)
> *** Registering nsUConvModule components (all right -- a generic module!)
> *** Registering nsUCvJAModule components (all right -- a generic module!)
> RegSelf Shift_JIS to Unicode converter complete
> RegSelf EUC-JP to Unicode converter complete
> RegSelf ISO-2022-JP to Unicode converter complete
> RegSelf Unicode to Shift_JIS converter complete
> <...>
> *** Chrome Registration of skin: Checking for contents.rdf at jar:resource:/chrome/venkman.jar!/skin/modern/venkman/
> *** Chrome Registration of locale: Checking for contents.rdf at jar:resource:/chrome/venkman.jar!/locale/en-US/venkman/
> *** Chrome Registration of package: Checking for contents.rdf at jar:resource:/chrome/messenger.jar!/content/messenger/
> *** Chrome Registration of package: Checking for contents.rdf at jar:resource:/chrome/messenger.jar!/content/messenger-region/
> *** Chrome Registration of locale: Checking for contents.rdf at jar:resource:/chrome/en-US.jar!/locale/en-US/messenger/
> *** Chrome Registration of locale: Checking for contents.rdf at jar:resource:/chrome/US.jar!/locale/US/messenger-region/Segmentation fault - core dumped
> *** Error code 139
> 
> Stop in /home/gallatin/ports/www/mozilla.
> *** Error code 1
> 
> Stop in /home/gallatin/ports/www/mozilla.
> *** Error code 1
> 
> Stop in /home/gallatin/ports/www/mozilla.
> <DING!>thunder/gallatin:mozilla> echo $cwd
> /usr/ports/www/mozilla
> 
> Examining the core file, I see that XPTC_InvokeByIndex is calling a
> null function (eg, it's jumping to 0 and dying with a SEGV).
> 
> <10:11am>thunder/gallatin:bin>gdb regxpcom regxpcom.core
> GNU gdb 4.18
> Copyright 1998 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "alpha-unknown-freebsd"...
> Core was generated by `regxpcom'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /home/gallatin/ports/www/mozilla/work/mozilla/dist/bin/./libxpcom.so...done.
> <...>
> Reading symbols from /home/gallatin/ports/www/mozilla/work/mozilla/dist/bin/components/libabsyncsvc.so...done.
> Reading symbols from /usr/libexec/ld-elf.so.1...done.
> #0  0x0 in ?? ()
> (gdb) bt
> #0  0x0 in ?? ()
> (gdb) info frame
> Stack level 0, frame at 0x0:
>  pc = 0x0; saved pc 0x1601c2c94
>  Arglist at 0xffffffffffffffd0, args:
>  Locals at unknown address, Previous frame's sp is 0x0
> (gdb) l * 0x1601c2c94
> 0x1601c2c94 is in invoke_copy_to_stack(unsigned long *, unsigned int, nsXPTCVariant *) (xptcinvoke_linux_alpha.cpp:94).
> 
> < actually, this is a lie, its really in XPTC_InvokeByIndex >:
> 
> 
> (gdb) disassemble 0x1601c2c94
> Dump of assembler code for function XPTC_InvokeByIndex:
> 0x1601c2c00 <XPTC_InvokeByIndex>:   ldah        gp,10(t12)
> <..>
> 
> The saved PC matches up to where it tries to call a null virtual function (Line 169 of xptcinvoke_linux_alpha).
> 
> If I run the mozzila script in work/mozilla/dist/bin with -g, and set
> breaks in XPTC_InvokeByIndex, I see that this happens the second time
> that XPTC_InvokeByIndex is called.  The stack looks like this the
> first time it's called (when it does not crash):
> 
> (gdb) where
> #0  0x1602fac00 in XPTC_InvokeByIndex () at xptcinvoke_linux_alpha.cpp:94
> #1  0x160dee618 in XPCWrappedNative::CallMethod (ccx=@0x11ffa680, mode=301966648) at xpcwrappednative.cpp:2009
> #2  0x160dfdc90 in XPC_WN_GetterSetter (cx=0x120214400, obj=0x11ffa680, argc=0, argv=0x12022a080, vp=0x11ffa7f0)
>     at xpcwrappednativejsops.cpp:1298
> #3  0x1601005cc in js_Invoke (cx=0x120214400, argc=301967568, flags=301967544) at jsinterp.c:832
> #4  0x1601009e0 in js_InternalInvoke (cx=0x120214400, obj=0x12017d8d0, fval=4833409232, flags=538433744, argc=0,
>     argv=0x0, rval=0x0) at jsinterp.c:924
> #5  0x16011d594 in js_GetProperty (cx=0x120214400, obj=0x12017d8d0, id=4834069696, vp=0x11ffaac8) at jsobj.c:2440
> #6  0x16010a898 in js_Interpret (cx=0x120214400, result=0x160e50494) at jsinterp.c:2623
> #7  0x160100d14 in js_Execute (cx=0x120214400, chain=0x12017d730, script=0x1, down=0x0, special=0, result=0x11ffa870)
>     at jsinterp.c:1012
> #8  0x1600d25cc in JS_ExecuteScript (cx=0x120214400, obj=0x9, script=0x1, rval=0x120219780) at jsapi.c:3273
> #9  0x160e51d60 in mozJSComponentLoader::GlobalForLocation (this=0x12016c800,
>     aLocation=0x5425ec15 <Error reading address 0x5425ec15: Bad address>, component=0xffffffff80000001)
>     at mozJSComponentLoader.cpp:1177
> #10 0x160e50494 in mozJSComponentLoader::ModuleForLocation (this=0x12016c800,
>     registryLocation=0x12016a380 "rel:nsProxyAutoConfig.js", component=0x12016c900) at mozJSComponentLoader.cpp:988
> #11 0x160e4eed0 in mozJSComponentLoader::AttemptRegistration (this=0x12016c800, component=0x12016c900, deferred=0)
>     at mozJSComponentLoader.cpp:828
> #12 0x160e4e9b8 in mozJSComponentLoader::AutoRegisterComponent (this=0x12016c800, when=9, component=0x12016c900,
>     registered=0x11ffb284) at mozJSComponentLoader.cpp:769
> #13 0x160e4de94 in mozJSComponentLoader::RegisterComponentsInDir (this=0x12016c800, when=0, dir=0xffffffff80000000)
>     at mozJSComponentLoader.cpp:588
> #14 0x160e4da18 in mozJSComponentLoader::AutoRegisterComponents (this=0x120219780, when=9, aDirectory=0x1)
>     at mozJSComponentLoader.cpp:544
> #15 0x160299ef0 in nsComponentManagerImpl::AutoRegisterImpl (this=0x120060200, when=538019104, inDirSpec=0x1)
>     at nsComponentManager.cpp:2933
> #16 0x1602988f8 in nsComponentManagerImpl::AutoRegister (this=0x120060200, when=0, inDirSpec=0x0)
>     at nsComponentManager.cpp:2834
> #17 0x16029c570 in nsComponentManager::AutoRegister (when=0, directory=0x0) at nsComponentManager.cpp:3579
> #18 0x120016924 in NS_SetupRegistry_1 (needAutoreg=539072384) at nsSetupRegistry.cpp:56
> #19 0x12000fc5c in main1 (argc=536976136, argv=0x0, nativeApp=0x0) at nsAppRunner.cpp:1145
> #20 0x120012498 in main (argc=1, argv=0x11ffb5e8) at nsAppRunner.cpp:1630
> (gdb) c
> 
> And like this when it does crash:
> 
> (gdb) where
> #0  0x1602fac00 in XPTC_InvokeByIndex () at xptcinvoke_linux_alpha.cpp:94
> #1  0x160dee618 in XPCWrappedNative::CallMethod (ccx=@0x11ffa910, mode=301967304) at xpcwrappednative.cpp:2009
> #2  0x160dfd9e4 in XPC_WN_CallMethod (cx=0x120214400, obj=0x12017f9b0, argc=0, argv=0x11ffa910, vp=0x11ffaa80)
>     at xpcwrappednativejsops.cpp:1266
> #3  0x1601005cc in js_Invoke (cx=0x120214400, argc=0, flags=0) at jsinterp.c:832
> #4  0x1601009e0 in js_InternalInvoke (cx=0x120214400, obj=0x12017f9b0, fval=4833409488, flags=0, argc=0, argv=0x0,
>     rval=0x0) at jsinterp.c:924
> #5  0x16012149c in js_TryMethod (cx=0x120214400, obj=0x12017f9b0, atom=0x120190f40, argc=0, argv=0x0, rval=0x11fface0)
>     at jsobj.c:3371
> #6  0x16011f438 in js_DefaultValue (cx=0x120214400, obj=0x12017f9b0, hint=JSTYPE_STRING, vp=0x11ffad00) at jsobj.c:2890
> #7  0x1601490dc in js_ValueToString (cx=0x120214400, v=4833409456) at jsstr.c:2568
> #8  0x1600f63c4 in js_ReportUncaughtException (cx=0x120214400) at jsexn.c:817
> #9  0x1600d25ec in JS_ExecuteScript (cx=0x120214400, obj=0xc, script=0x1, rval=0x120245a80) at jsapi.c:3276
> #10 0x160e51d60 in mozJSComponentLoader::GlobalForLocation (this=0x12016c800,
>     aLocation=0x5425ec15 <Error reading address 0x5425ec15: Bad address>, component=0xffffffff80000001)
>     at mozJSComponentLoader.cpp:1177
> #11 0x160e50494 in mozJSComponentLoader::ModuleForLocation (this=0x12016c800,
>     registryLocation=0x12016a380 "rel:nsProxyAutoConfig.js", component=0x12016c900) at mozJSComponentLoader.cpp:988
> #12 0x160e4eed0 in mozJSComponentLoader::AttemptRegistration (this=0x12016c800, component=0x12016c900, deferred=0)
>     at mozJSComponentLoader.cpp:828
> #13 0x160e4e9b8 in mozJSComponentLoader::AutoRegisterComponent (this=0x12016c800, when=12, component=0x12016c900,
>     registered=0x11ffb284) at mozJSComponentLoader.cpp:769
> #14 0x160e4de94 in mozJSComponentLoader::RegisterComponentsInDir (this=0x12016c800, when=0, dir=0xffffffff80000000)
>     at mozJSComponentLoader.cpp:588
> #15 0x160e4da18 in mozJSComponentLoader::AutoRegisterComponents (this=0x120245a80, when=12, aDirectory=0x1)
>     at mozJSComponentLoader.cpp:544
> #16 0x160299ef0 in nsComponentManagerImpl::AutoRegisterImpl (this=0x120060200, when=538019104, inDirSpec=0x1)
>     at nsComponentManager.cpp:2933
> #17 0x1602988f8 in nsComponentManagerImpl::AutoRegister (this=0x120060200, when=0, inDirSpec=0x0)
>     at nsComponentManager.cpp:2834
> #18 0x16029c570 in nsComponentManager::AutoRegister (when=0, directory=0x0) at nsComponentManager.cpp:3579
> #19 0x120016924 in NS_SetupRegistry_1 (needAutoreg=539253376) at nsSetupRegistry.cpp:56
> #20 0x12000fc5c in main1 (argc=536976136, argv=0x0, nativeApp=0x0) at nsAppRunner.cpp:1145
> #21 0x120012498 in main (argc=1, argv=0x11ffb5e8) at nsAppRunner.cpp:1630
> 
> I don't know didly squat about the convoluted glue that XPTC_Invoke
> seems to be doing.  Any suggestions on how I can find where the bogus
> (0x0) PC is coming from?  It seems to have something to do with
> reporting an uncaught Javascript exception.
> 
> Is Javascript itself 64-bit safe?  It generates loads of worrisome messages:
> 
> Building deps for jsparse.c
> cc -o jsparse.o -c -DOSTYPE=\"FreeBSD4\" -DOSARCH=\"FreeBSD\" -DOJI -DEXPORT_JS_API  -DJS_USE_SAFE_ARENA   -I../../dist/include/js -I../../dist/include -I/home/gallatin/ports/www/mozilla/work/mozilla/dist/include/nspr  -I/usr/local/include -I/usr/local/include   -I. -I/usr/X11R6/include   -fPIC -I/usr/X11R6/include  -I/usr/X11R6/include -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -O -pipe -mcpu=ev56 -pipe  -DDEBUG -DDEBUG_gallatin -DTRACING -g -I/usr/X11R6/include  -I/usr/X11R6/include -include ../../config-defs.h -DMOZILLA_CLIENT jsparse.c
> jsparse.c: In function `HasFinalReturn':
> jsparse.c:446: warning: cast increases required alignment of target type
> jsparse.c:463: warning: cast increases required alignment of target type
> jsparse.c: In function `FunctionDef':
> jsparse.c:794: warning: cast to pointer from integer of different size
> jsparse.c: In function `Statement':
> <...>
> 
> Thanks,
> 
> Drew
> 
> --- /dev/null   Tue Nov 27 08:10:33 2001
> +++ files/patch-nsprpub::pr::include::md::_freebsd.cfg  Mon Nov 26 17:17:31 2001
> @@ -0,0 +1,13 @@
> +--- nsprpub/pr/include/md/_freebsd.cfg.orig    Mon Nov 26 17:07:20 2001
> ++++ nsprpub/pr/include/md/_freebsd.cfg Mon Nov 26 17:15:01 2001
> +@@ -93,8 +93,8 @@
> +
> + #elif defined(__alpha)
> +
> +-#define IS_LITTLE_ENDIAN 1
> +-#undef  IS_BIG_ENDIAN
> ++#define       IS_64
> ++
> + #define       HAVE_LONG_LONG
> + #define       HAVE_ALIGNED_DOUBLES
> + #define       HAVE_ALIGNED_LONGLONGS
> --- /dev/null   Tue Nov 27 08:10:33 2001
> +++ files/patch-xpfe::bootstrap::nsAppRunner.cpp        Mon Nov 26 17:00:02 2001
> @@ -0,0 +1,11 @@
> +--- xpfe/bootstrap/nsAppRunner.cpp.orig        Mon Nov 26 16:53:29 2001
> ++++ xpfe/bootstrap/nsAppRunner.cpp     Mon Nov 26 16:54:12 2001
> +@@ -1060,7 +1060,7 @@
> +
> + #if defined(FREEBSD)
> + // pick up fpsetmask prototype.
> +-#include <floatingpoint.h>
> ++#include <ieeefp.h>
> + #endif
> +
> + // Note: nativeApp is an owning reference that this function has responsibility
> --- /dev/null   Tue Nov 27 08:10:33 2001
> +++ files/patch-extensions::transformiix::source::base::Double.cpp      Mon Nov 26 16:58:32 2001
> @@ -0,0 +1,23 @@
> +--- extensions/transformiix/source/base/Double.cpp.orig        Mon Nov 26 16:55:21 2001
> ++++ extensions/transformiix/source/base/Double.cpp     Mon Nov 26 16:56:08 2001
> +@@ -41,7 +41,7 @@
> + #endif
> + //A trick to handle IEEE floating point exceptions on FreeBSD - E.D.
> + #ifdef __FreeBSD__
> +-#include <floatingpoint.h>
> ++#include <ieeefp.h>
> + #endif
> + #ifndef TX_EXE
> + #include "prdtoa.h"
> +@@ -56,7 +56,11 @@
> +
> + //A trick to handle IEEE floating point exceptions on FreeBSD - E.D.
> + #ifdef __FreeBSD__
> ++#ifdef __alpha__
> ++fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP;
> ++#else
> + fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML;
> ++#endif
> + fp_except_t oldmask = fpsetmask(~allmask);
> + #endif
> +

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C2C8A5C.70EA706C>