NetBSD-Bugs archive

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

Re: port-mips/59064 (jemalloc switch to 5.3 broke userland)



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

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: Rin Okuyama <rokuyama.rk%gmail.com@localhost>
Cc: Martin Husemann <martin%duskware.de@localhost>, gnats-bugs%NetBSD.org@localhost,
	port-mips-maintainer%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost,
	netbsd-bugs%NetBSD.org@localhost, martin%NetBSD.org@localhost, simonb%NetBSD.org@localhost,
	joerg%NetBSD.org@localhost
Subject: Re: port-mips/59064 (jemalloc switch to 5.3 broke userland)
Date: Mon, 14 Apr 2025 14:38:13 +0000

 If I run in live gdb, it works fine -- the value v0 fished out of the
 GOT seems plausible:
 
 (gdb) set environment LD_LIBRARY_PATH = /var/tmp/20250413/lib
 (gdb) break malloc_default
 Function "malloc_default" not defined.
 Make breakpoint pending on future shared library load? (y or [n]) y
 Breakpoint 1 (malloc_default) pending.
 (gdb) run
 Starting program: /var/tmp/20250413/rdhwr
 tcb_syscall 0x786b2000
 tcb_rdhwr 0x786b2000
 
 Breakpoint 1, 0x7853be1c in malloc_default ()
    from /var/tmp/20250413/lib/libc.so.12
 (gdb) display/i $pc
 1: x/i $pc
 => 0x7853be1c <malloc_default+20>:      lw      v0,-23368(gp)
 (gdb) si
 0x7853be20 in malloc_default () from /var/tmp/20250413/lib/libc.so.12
 1: x/i $pc
 => 0x7853be20 <malloc_default+24>:      .word   0x7c03e83b
 (gdb) si
 0x7853be24 in malloc_default () from /var/tmp/20250413/lib/libc.so.12
 1: x/i $pc
 => 0x7853be24 <malloc_default+28>:      sd      s1,64(sp)
 (gdb) print $v0
 $1 = -28664
 (gdb) print (void *)$v1
 $2 = (void *) 0x786b9008
 
 I get the same address in $gp live or post-mortem:
 
 (gdb) print (void *)$gp
 $4 = (void *) 0x78694270 <path+752>
 
 So whatever is initializing -23368(gp), that is, 0x7868e728, in the
 GOT, seems to be doing something wrong -- but only when run normally,
 not under gdb!
 


Home | Main Index | Thread Index | Old Index