Closed Bug 322806 Opened 16 years ago Closed 15 years ago

ARM crash [@ XPTC_InvokeByIndex]

Categories

(Core :: XPCOM, defect)

1.8 Branch
Other
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: apm, Assigned: apm)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)
Build Identifier: Mozilla/5.0 (X11; U; Linux armv5tejl; en-US; rv:1.8) Gecko/20051224 Debian/1.4.99+1.5rc3.dfsg-2 Firefox/1.5

While testing the ARM system emulation in QEMU I noticed that firefox
segfaults without the below change.

Seems that the inputs for the inline asm in XPTC_InvokeByIndex() in
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp need an
additional memory input in order to prevent gcc from optimizing away
the initialization of the structure used by the asm.

diff -ur firefox-1.4.99+1.5rc3.dfsg/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp /usr/local/arm/sid/home/apm/src/firefox-1.4.99+1.5rc3.dfsg/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
--- firefox-1.4.99+1.5rc3.dfsg/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp	2005-10-14 00:33:10.000000000 +0300
+++ /usr/local/arm/sid/home/apm/src/firefox-1.4.99+1.5rc3.dfsg/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp	2005-12-25 15:15:46.000000000 +0200
@@ -212,7 +212,7 @@
     "add	sp, sp, r4	\n\t"	/* restore stack pointer		*/
     "mov	%0, r0		\n\t"	/* the result...			*/
     : "=r" (result)
-    : "r" (&my_params)
+    : "r" (&my_params), "m" (my_params)
     : "r0", "r1", "r2", "r3", "r4", "ip", "lr", "sp"
     );


Reproducible: Always

Steps to Reproduce:
1. Install Debian/sid for ARM
2. Install firefox (apt-get install firefox)
3. Try to start firefox (firefox)

Actual Results:  
Segmentation fault, illegal instruction, etc. depending on what happens to be in the uninitialized memory used by the inline asm.

Expected Results:  
Firefox starts.

The debian bug is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344846
Assignee: nobody → dougt
Severity: normal → critical
Component: General → XPCOM
Keywords: crash
Product: Firefox → Core
QA Contact: general → xpcom
Summary: ARM XPTC_InvokeByIndex → ARM crash [@ XPTC_InvokeByIndex]
Version: unspecified → 1.8 Branch
Attached patch patch from reporter (obsolete) — Splinter Review
Depends on: 106864
*** Bug 339782 has been marked as a duplicate of this bug. ***
Comment on attachment 208034 [details] [diff] [review]
patch from reporter

this works,

"m" is memory_operand

memory_operand is kinda vaguely explained here:
http://landfill.mozilla.org/mxr-test/gcc-4.0.2/source/gcc/doc/gccint.info#10890

info about arm/thumb for it is here:
http://landfill.mozilla.org/mxr-test/gcc-4.0.2/source/gcc/config/arm/arm.md#3282

an example of use is here:
http://landfill.mozilla.org/mxr-test/gcc-4.0.2/source/gcc/testsuite/gcc.dg/arm-asm.c
Attachment #208034 - Flags: superreview?(shaver)
Attachment #208034 - Flags: review+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 208034 [details] [diff] [review]
patch from reporter

mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp 	1.9
Attachment #208034 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee: dougt → apm
Crash Signature: [@ XPTC_InvokeByIndex]
You need to log in before you can comment on or make changes to this bug.