Closed Bug 43024 Opened 24 years ago Closed 23 years ago

xptcall dumps core on Irix 6.5 (and rld misses symbols)

Categories

(Core :: XPCOM, defect, P3)

SGI
IRIX
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: michal, Assigned: shaver)

Details

Running 
  ./run-mozilla.sh ./TestXPTCInvoke
results in series of rld errors:

327472:./TestXPTCInvoke: rld: Error: unresolvable symbol in ./libxpcom.so:
Stub83__14nsXPTCStubBase

nm -C shows that library references nsXPTCStubBase::Stub*() and defines
nsXPTCStubBase::Stub*(void).

BTW, this is filed as bug#11420, marked as duplicate of 10061, which IMHO is
about something else.

I replaced the __14nsXPTCStubBaseGv with __14nsXPTCStubBase in file 
  mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_irix.s

That helps the rld, but the test dies anyway:

./run-mozilla.sh -g ./TestXPTCInvoke 
MOZILLA_FIVE_HOME=.
  LD_LIBRARY_PATH=.:/software/mozilla/bin:/software/gnu/lib
     LIBRARY_PATH=.
       SHLIB_PATH=.
          LIBPATH=.
       ADDON_PATH=.
      MOZ_PROGRAM=./TestXPTCInvoke
      MOZ_TOOLKIT=
        moz_debug=1
     moz_debugger=
/usr/bin/dbx ./TestXPTCInvoke 
dbx version 7.3 MR 55458_Apr30_MR Apr 30 1999 13:44:41
Overlapping regions: finding functions/setting breakpoints
may not work reliably till program is run (rld moves DSOs,
removing overlaps).
Overlapping regions: 0x5fd30000 to 0x5ffa6000 and 0x5ff90000 to 0x5ffef000
Executable /scratch/mozilla/dist/bin/./TestXPTCInvoke
(dbx) run
Process 329278 (TestXPTCInvoke) started
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.000000
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000f
calling via invoke:
Process 329278 (TestXPTCInvoke) stopped on signal SIGSEGV: Segmentation
violation (default) at [<unknown>:0 ,0x0]

I can not tell at the moment where it failed, but it looks like somewhere 
in the assembly. 

I tried to build on June 19-th, using gcc-2.95.2 on Irix 6.5.5m (using
./configure). 

Michal V.
IRIS not my groups area.  Assigning to asa to find a net community QA contact 
for this.
QA Contact: leger → asa
Adding qawanted keyword: anyone on IRIX?

Gerv
Keywords: qawanted
Refer to my comments and diffs in bug#10061
They are more a hack than a proper patch because it
seems very compiler and option specific.  I have managed
to get the test running and mozilla-bin and viewer not
crashing (for a while), but I still get ASSERTIONS for
NS_ENSURE stuff and then memory fault crash.  I can add
an attachment of this fix if you think it is suitable,
but it shouldn't be used to change CVS due to the
platform/compiler/options specificness.
I would like to apparently confirm this bug.
After a good deal of time wrestling with SONAME versions... i've
landed exactly as detailed here with lots of:
"250834:./mozilla-bin: rld: Error: unresolvable symbol in
/build/package/libxpcom.so: Stub69__14nsXPTCStubBase"...s

thank you for your efforts folks!
setting bug status to New
Status: UNCONFIRMED → NEW
Ever confirmed: true
John, I don't recognize any module mentioned in the problem report, I think this 
would be yours.  If not you can assign it back or if you know who should own it, 
it assign it on.
Assignee: rayw → jband
These 'nix xptcall bugs go to shaver.

Patches *gratefully* accepted!
Assignee: jband → shaver
This patch should fix the problems described here and in bug#10061. I failed to
create an attachment, so I am posting it here.

diff -u -r ./xpcom/reflect/xptcall/src/md/unix/Makefile.in
/software/mozilla/xpcom/reflect/xptcall/src/md/unix/Makefile.in
--- ./xpcom/reflect/xptcall/src/md/unix/Makefile.in     Thu Aug 24 11:24:09
2000+++ /software/mozilla/xpcom/reflect/xptcall/src/md/unix/Makefile.in     Wed
Aug 23 12:08:57 2000
@@ -159,9 +159,6 @@
 ifneq ($(basename $(OS_RELEASE)),5)
 CPPSRCS                := xptcinvoke_irix.cpp xptcstubs_irix.cpp
 ASFILES                := xptcinvoke_asm_irix.s xptcstubs_asm_irix.s
-ifdef GNU_CC
-ASFLAGS                += -Wa,-D__GNUC__
-endif
 endif
 endif
 
diff -u -r ./xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_irix.s
/software/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_irix.s
--- ./xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_irix.s   Thu Aug 24
11:34:47 2000
+++ /software/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_irix.s  
Wed Jun  7 16:41:10 2000
@@ -73,36 +73,25 @@
        REG_L   a0, A0OFF(sp)   # a0 - that
        REG_L   a1, A1OFF(sp)   # a1 - methodIndex
 
-#ifdef __GNUC__
-       # t1 = methodIndex * 8
-       # (use shift instead of mult)
-       sll     t1, a1, 3
-#else
        # t1 = methodIndex * 12
        # (use shift and subtract trick instead of mult)
        sll     t1, a1, 2
        subu    t1, t1, a1
        sll     t1, t1, 2
-#endif
 
        # calculate the function we need to jump to,
        # which must then be saved in t9
        lw      t9, 0(a0)
        addu    t9, t9, t1
-#ifdef __GNUC__
-       lw      t9, 12(t9)      # t9 = *(that+t1+offset)        
-#else
-       lw      t9, 20(t9)      # t9 = *(that+t1+offset)        
-#endif
+       li      t2, 20
+       addu    t9, t9, t2
+       lw      t9, 0(t9)       # t9 = *(that+t1+20)    
+
        # calculate the proper "this" pointer for the
        # function that they asked for
        lw      t0, 0(a0)
        addu    t0, t1
-#ifdef __GNUC__
-       lh      t0, 8(t0)       
-#else
        lw      t0, 12(t0)
-#endif
        addu    a0, a0, t0
 
        # get register save area from invoke_copy_to_stack
diff -u -r ./xpcom/reflect/xptcall/src/md/unix/xptcinvoke_irix.cpp
/software/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_irix.cpp
--- ./xpcom/reflect/xptcall/src/md/unix/xptcinvoke_irix.cpp     Wed Aug 23
16:41:07 2000
+++ /software/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_irix.cpp    
Wed Jun  7 16:41:17 2000
@@ -106,9 +106,9 @@
            break;
         case nsXPTType::T_FLOAT:
            if (i < N_ARG_REGS)
-              ((float*)regs)[(i<<1)+1] = s->val.f;
+              ((double*)regs)[i] = s->val.f;
            else
-              *((float*)d++) = s->val.f;
+              *((double*)d++) = s->val.f;
            break;
         case nsXPTType::T_DOUBLE:
            if (i < N_ARG_REGS)
diff -u -r ./xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_irix.s
/software/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_irix.s
--- ./xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_irix.s    Wed Aug 23
16:40:02 2000
+++ /software/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_irix.s   
Wed Jun  7 16:41:18 2000
@@ -28,7 +28,7 @@
 
 #define SENTINEL_ENTRY(nn)         /* defined in cpp file, not here */
 
-#define STUB_ENTRY(nn)    MAKE_STUB(nn, Stub/**/nn/**/__14nsXPTCStubBase)
+#define STUB_ENTRY(nn)    MAKE_STUB(nn, Stub/**/nn/**/__14nsXPTCStubBaseGv)
 
 #define MAKE_STUB(nn, name)                                    \
 NESTED(name, FRAMESZ, ra);                                     \
I believe you will need the __GNUC__ preprocessing for the
suggested change to STUB_ENTRY in xptcstubs_asm_irix.s.
That is the Gv is required for native MIPSpro compilers.

I have used gcc and now using native compilers.  I agree
with the changes (see bug 10061 ).  Using native MIPSpro
7.3.1.1 compilers the only problem with TestXPTCInvoke is
the floating point stuff.  This is a gcc problem as well.
Yes, the last patch should read

--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_irix.s      Mon Aug 28
12:26:36 2000
+++ /software/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_irix.s  
Wed Jun  7 16:41:18 2000
@@ -28,12 +28,8 @@
 
 #define SENTINEL_ENTRY(nn)         /* defined in cpp file, not here */
 
-#ifdef __GNUC__
-#define STUB_ENTRY(nn)    MAKE_STUB(nn, Stub/**/nn/**/__14nsXPTCStubBase)
-#else
 #define STUB_ENTRY(nn)    MAKE_STUB(nn, Stub/**/nn/**/__14nsXPTCStubBaseGv)
-#endif
-
+
 #define MAKE_STUB(nn, name)                                    \
 NESTED(name, FRAMESZ, ra);                                     \
        SETUP_GP;                                               \

Due to bug#21308 (the resolution described there does not work for me)
I had to switch to native compilers (MIPSPro 7.3 - BTW, is anyone having the
problems with instantiation of basic_nsPromiseFlatString and with library link
order in webshell/tests/viewer and xpfe/bootstrap, or is it just me?). Using
this, I ran into bug#30427.
This is a good old one.  Are we still seeing it?
Ive just tested this on IRIX 6.5 using MIPSpro compilers, and I dont see the 
problem.
Good enough for me!

(Please reopen if you're still seeing this.)
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.