Closed
Bug 339782
Opened 19 years ago
Closed 17 years ago
[ARM] XPTC_InvokeByIndex crashes when cross-compiled under GCC 3.4.x with EABI (CodeSourcery)
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gdx, Assigned: blassey)
Details
Attachments
(1 file, 3 obsolete files)
|
5.74 KB,
patch
|
benjamin
:
superreview+
beltzner
:
approval1.9+
asac
:
approval1.8.1.next?
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.7
I crosscompiled Firefox 1.5.0.1 under http://scratchbox.org/ using CodeSourcery toolchain with EABI support (ARM) and I have problem to run even ./TestXPTCInvoke
$ ./TestXPTCInvoke
calling direct:
1 + 1 = 2
1L + 1L = 2
2 * 2 = 4
2L * 2L = 4
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
1 + 2 = 3.000000f
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000f
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 +1 15 + 16 + 17 + 18 + 19 + 20 = 210.000000f
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = 66.000000
moo cow = milk
calling via invoke:
1 + 1 = 2
1L + 1L = 0
Segmentation fault (core dumped)
Reproducible: Always
erm, complete steps (including full urls, not generic "http://vendor/" ones) to get codesourcery toolchain would be nice (telling me specific steps for downloading and using scratchbox to configure it are fine, i'd even settle for debian or similar package steps). ignoring that, please build w/ --enable-debugger-info-modules (--enable-debug would be better) --disable-strip, and get a stack trace from gdb (see the unix debugging faq <http://www.mozilla.org/unix/debugging-faq.html>).
that said, i'm using gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2). according to gcc it's compiled with --target=arm-none-linux-gnueabi, and i don't have problems with mozilla-trunk.
unfortunately my scratchbox is busy in the x86 configuration atm, so i can't coax it into giving me TestXPTCInvoke.
| Reporter | ||
Comment 2•19 years ago
|
||
(In reply to comment #1)
> erm, complete steps (including full urls, not generic "http://vendor/" ones) to
> get codesourcery toolchain would be nice (telling me specific steps for
> downloading and using scratchbox to configure it are fine, i'd even settle for
I'm using toolchain from http://scratchbox.org/download/files/sbox-releases/stable/tarball/scratchbox-toolchain-arm-gcc3.44csn-glibc2.3-1.0.3-i386.tar.gz
> debian or similar package steps). ignoring that, please build w/
> --enable-debugger-info-modules (--enable-debug would be better)
> --disable-strip, and get a stack trace from gdb (see the unix debugging faq
> <http://www.mozilla.org/unix/debugging-faq.html>).
(...)
Reading symbols from /lib/ld-linux.so.3...done.
Loaded symbols for /lib/ld-linux.so.3
#0 0x400dc498 in XPTC_InvokeByIndex (that=0x16560, methodIndex=0,
paramCount=16, params=0xbe9f3ac0) at xptcinvoke_arm.cpp:217
217 );
(gdb) bt
#0 0x400dc498 in XPTC_InvokeByIndex (that=0x16560, methodIndex=0,
paramCount=16, params=0xbe9f3ac0) at xptcinvoke_arm.cpp:217
Cannot access memory at address 0x0
(gdb)
> that said, i'm using gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2).
> according to gcc it's compiled with --target=arm-none-linux-gnueabi, and i
> don't have problems with mozilla-trunk.
This is very strange because is exactly the same toolchain.
sh-2.05b$ export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
sh-2.05b$ ./TestXPTCInvoke
sh-2.05b$ ./TestXPTCInvoke --help
sh-2.05b$ uname -a
Linux swift 2.6.16-1-686-smp #2 SMP Tue Apr 25 20:45:37 UTC 2006 arm GNU/Linux
sh-2.05b$ gcc -v
Reading specs from /scratchbox/compilers/cs2005q3.2-glibc-arm/lib/gcc/arm-none-linux-gnueabi/3.4.4/specs
Reading specs from /scratchbox/compilers/cs2005q3.2-glibc-arm/gcc.specs
rename spec cpp to old_cpp
Configured with: /home/kl/cs2005q3-2_toolchain/gcc/glibc/work/gcc-2005q3-2/configure --target=arm-none-linux-gnueabi --host=i386-linux --build=i386-linux --prefix=/scratchbox/compilers/cs2005q3.2-glibc-arm --with-headers=/scratchbox/compilers/cs2005q3.2-glibc-arm/usr/include --enable-languages=c,c++ --enable-shared --enable-threads --disable-libssp --disable-libstdcxx-pch --disable-checking --enable-__cxa_atexit --program-transform-name=s/^-/arm-linux-/ --program-prefix=arm-linux- --with-cpu= --enable-interwork
Thread model: posix
gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)
no crash. quite happy. i can check to see if we have any evil patches floating around. if we do, this bug is a duplicate.
ok, we have two patches of interest
one to xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp and one to xpcom/reflect/xptcall/src/md/unix/Makefile.in
now i just need to figure out which bug covers them.
Whiteboard: DUPEME
in the future, please search before filing bugs. that bug is in the same component as this one and has enough of the same keywords in the summary that it should have been found.
*** This bug has been marked as a duplicate of 322806 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
| Reporter | ||
Comment 5•19 years ago
|
||
(In reply to comment #4)
> in the future, please search before filing bugs. that bug is in the same
> component as this one and has enough of the same keywords in the summary that
> it should have been found.
Of course I tried patch from bug 322806 but it did't help.
I think that PRUint64 and double has bad alignment on the stack. During compile I have warnings:
xptcinvoke_arm.cpp: In function `void invoke_copy_to_stack(PRUint32*, PRUint32, nsXPTCVariant*)':
xptcinvoke_arm.cpp:112: warning: cast from `PRUint32*' to `PRInt64*' increases required alignment of target type
xptcinvoke_arm.cpp:116: warning: cast from `PRUint32*' to `PRUint64*' increases required alignment of target type
xptcinvoke_arm.cpp:118: warning: cast from `PRUint32*' to `double*' increases required alignment of target type
| Reporter | ||
Comment 6•19 years ago
|
||
I forgot add that my toolchain is a little diffrent:
$ gcc -v
Reading specs from /scratchbox/compilers/arm-linux-cs344-2.3/bin/../lib/gcc/arm-none-linux-gnueabi/3.4.4/specs
Reading specs from /scratchbox/compilers/arm-linux-cs344-2.3/gcc.specs
rename spec cpp to old_cpp
Configured with: /scratch/paul/2005q3-2/src/gcc-2005q3/configure --disable-nls --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-languages=c,c++ --enable-shared --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --disable-checking --prefix=/opt/codesourcery --enable-symvers=gnu --enable-__cxa_atexit --enable-threads --enable-shared --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/paul/2005q3-2/install/linux-gnueabi/arm-none-linux-gnueabi/libc
Thread model: posix
gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)
i'll look at this again tomorrow. also, if you're trying patches, it'd definitely help if you indicate things you try and whether they help/hurt/do nothing when you file the bug. (unfortunately i have ~100 patches in my tree and i'm very new to it, since someone else collected them for me.)
| Reporter | ||
Comment 8•19 years ago
|
||
Timeless could you show me yours options to mozilla and patches which you applies please?
sorry, i really am working on getting to this. but i have quite a number of things i need to do and this is among them.
Comment 10•19 years ago
|
||
i'm going to reopen this since the reporter disagrees. i'll try to find someone who can track this down.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Comment 11•19 years ago
|
||
I am using Codesourcery ARM tolchain and,
I have no such problems with current trunk + patch from bug
https://bugzilla.mozilla.org/show_bug.cgi?id=349002
https://bugzilla.mozilla.org/attachment.cgi?id=247274
Grzegorz you try trunk + this patch?
timeless could you apply this patch?
Comment 12•18 years ago
|
||
Seeing the same TestXPTCInvoke crash as the original reporter, additionally firefox crashes on startup. Attached patch fixes both.
The crashes are due to xptcall creating bad call stack in some conditions due to new alignment requirements in EABI.
Updated•18 years ago
|
Attachment #284299 -
Attachment description: Fixes EABI alignment issues in xptcall → Patch to fix EABI related alignment issues in xptcall
Updated•18 years ago
|
Attachment #284299 -
Flags: review?(timeless)
Comment 13•18 years ago
|
||
+#define DOUBLEWORD_ALIGN(p) ((PRUint32 *)((((PRUint32)(p)) + 7) & 0xfffffff8))
...
Maybe it possible to move this macro somewhere in xptcall.h, near nsXPTCMiniVariant ....?
Comment 14•18 years ago
|
||
Possible, yes, but is it really a good idea to put a very machine specific piece of code into a public header?
Attachment #284299 -
Flags: review?(timeless) → review+
| Assignee | ||
Comment 15•18 years ago
|
||
being cautious until we know this doesn't break other stuff
Attachment #284299 -
Attachment is obsolete: true
Updated•18 years ago
|
Assignee: nobody → dougt
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 16•18 years ago
|
||
Comment on attachment 287567 [details] [diff] [review]
Updated patch to be specific to EABI
can you move this comment up to where we define VAR_STACK_SIZE_64:
+
+ /* Note that we give a "worst case" estimate of how much stack _might_ be
+ * needed (for __ARM_EABI__), rather than the real count - this should be safe */
+
w/ that change r=
Attachment #287567 -
Flags: review+
Updated•18 years ago
|
Attachment #287567 -
Flags: superreview?(benjamin)
| Assignee | ||
Comment 17•18 years ago
|
||
comment moved per dougT's request
Updated•18 years ago
|
Attachment #287745 -
Flags: superreview?(benjamin)
Attachment #287745 -
Flags: review-
Updated•18 years ago
|
Attachment #287567 -
Attachment is obsolete: true
Attachment #287567 -
Flags: superreview?(benjamin)
Comment 18•18 years ago
|
||
Comment on attachment 287745 [details] [diff] [review]
Same as above, but comment moved
dougt, did you mean to r- here?
Comment 19•18 years ago
|
||
Comment on attachment 287745 [details] [diff] [review]
Same as above, but comment moved
this is working for me. lets get a quick SR on this so that we can get this landed.
Attachment #287745 -
Flags: superreview?(benjamin)
Attachment #287745 -
Flags: superreview?
Attachment #287745 -
Flags: review-
Attachment #287745 -
Flags: review+
Comment 20•18 years ago
|
||
Comment on attachment 287745 [details] [diff] [review]
Same as above, but comment moved
requesting SR from the wind isn't very quick at all. :(
Updated•18 years ago
|
Attachment #287745 -
Flags: superreview? → superreview?(benjamin)
Comment 21•18 years ago
|
||
Comment on attachment 287745 [details] [diff] [review]
Same as above, but comment moved
>diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
> #include "xptcprivate.h"
> #include "xptiprivate.h"
>+//#include <stdio.h>
Since this is debugging-only I'd wager, please remove it completely.
> static nsresult
> PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args)
> {
>+
>+ /*
>+#ifdef __ARM_EABI__
>+ printf("__ARM_EABI__\n");
>+#else
>+ printf("not __ARM_EABI__\n");
>+#endif
>+ */
This was for debugging, right? remove it or explain what it's for ;-)
Attachment #287745 -
Flags: superreview?(benjamin) → superreview+
| Assignee | ||
Comment 22•17 years ago
|
||
Attachment #287745 -
Attachment is obsolete: true
Attachment #292771 -
Flags: superreview?
| Assignee | ||
Updated•17 years ago
|
Attachment #292771 -
Flags: superreview? → superreview?(benjamin)
Updated•17 years ago
|
Attachment #292771 -
Flags: superreview?(benjamin) → superreview+
Updated•17 years ago
|
Flags: blocking1.9?
Updated•17 years ago
|
Attachment #292771 -
Flags: approval1.9?
Comment 23•17 years ago
|
||
this is ARM specific.
Updated•17 years ago
|
Assignee: dougt → blassey
Comment 24•17 years ago
|
||
Comment on attachment 292771 [details] [diff] [review]
removed commented out garbage that bsmedberg pointed out
a=beltzner for 1.9
Attachment #292771 -
Flags: approval1.9? → approval1.9+
Updated•17 years ago
|
Keywords: checkin-needed
Comment 25•17 years ago
|
||
thanks!
Status: NEW → RESOLVED
Closed: 19 years ago → 17 years ago
Resolution: --- → FIXED
Comment 26•17 years ago
|
||
fixed.
Updated•17 years ago
|
Keywords: checkin-needed
Updated•17 years ago
|
Flags: blocking1.9?
Comment 27•16 years ago
|
||
Comment on attachment 292771 [details] [diff] [review]
removed commented out garbage that bsmedberg pointed out
We need this to get a working tbird 2 on arm in ubuntu.
I think it should be save enough to approve to 1.8.1 branch especially given that ffox is eol already.
Attachment #292771 -
Flags: approval1.8.1.next?
You need to log in
before you can comment on or make changes to this bug.
Description
•