NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-macppc/54953: 5.0 binaries on 9.0_RC2 macppc dumps core in jemalloc(3)



The following reply was made to PR port-macppc/54953; it has been noted by GNATS.

From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: port-macppc/54953: 5.0 binaries on 9.0_RC2 macppc dumps core in
 jemalloc(3)
Date: Tue, 11 Feb 2020 17:37:50 +0300

 $ gdb -q netbsd-5.2.3/bin/test
 ...
 Program received signal SIGSEGV, Segmentation fault.
 0xfdda2268 in malloc () from /lib/libc.so.12
 (gdb) x/5i $pc-16
    0xfdda2258 <malloc+88>:  lwz     r31,0(r4)
    0xfdda225c <malloc+92>:  add     r5,r4,r31
    0xfdda2260 <malloc+96>:  lwz     r6,-12(r5)
    0xfdda2264 <malloc+100>: add     r31,r6,r2
 => 0xfdda2268 <malloc+104>: lbz     r7,0(r31)
 (gdb) p/x $r31
 $11 = 0x1802ca4
 (gdb) x/x $r31
 0x1802ca4:        Cannot access memory at address 0x1802ca4
 (gdb) p/x $r2
 $12 = 0x1809ca4
 (gdb) p/x $r6
 $13 = 0xffff9000
 (gdb) p/x $r5
 $14 = 0xfdeb7d28
 (gdb) p/x $r4
 $15 = 0xfdda2248
 (gdb) x/x $r4	# uwe: R_PPC_REL32 _GLOBAL_OFFSET_TABLE_ (see below)
 0xfdda2248 <malloc+72>:     0x00115ae0
 
 
 $ powerpc--netbsd-objdump -dr jemalloc.pico | less +/'<malloc>:'
 00003e88 <malloc>:
 ...
     # uwe: this is where $r4 above points to
     3ed0:       00 00 00 00     .long 0x0
                         3ed0: R_PPC_REL32       _GLOBAL_OFFSET_TABLE_
 ...
     3ee0:	83 e4 00 00	lwz	r31,0(r4)
     3ee4:	7c a4 fa 14	add	r5,r4,r31
     3ee8:	80 c5 00 00	lwz	r6,0(r5)
 			3eea: R_PPC_GOT_TPREL16 je_tsd_tls
     3eec:	7f e6 12 14	add	r31,r6,r2
 			3eec: R_PPC_TLS je_tsd_tls
     3ef0:	88 ff 00 00	lbz	r7,0(r31)
 
 
 Compiling that file with -S -mregnames I get this asm (prettified a
 bit to improve readability):
 
 	lwz	%r31, 0(%r4)
 	add	%r5, %r4, %r31
 	lwz	%r6, je_tsd_tls@got@tprel(%r5)
 	add	%r31, %r6, je_tsd_tls@tls
 	lbz	%r7, 0(%r31)
 
 -uwe
 


Home | Main Index | Thread Index | Old Index