Subject: port-i386/10789: i386 ptrace cerror handling still broken (1.4.2+)
To: None <gnats-bugs@gnats.netbsd.org, jhawk@mit.edu>
From: None <felix@dworkin.nl>
List: netbsd-bugs
Date: 08/08/2000 19:25:12
>Number:         10789
>Category:       port-i386
>Synopsis:       ptrace error handling causes SIGSEGV in dynamic library
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 08 19:26:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Felix A. Croes
>Release:        NetBSD 1.4.2, NetBSD 1.4.3_ALPHA
>Organization:
	Dworkin B.V.
>Environment:
System: NetBSD pattern.dworkin.nl 1.4.2 NetBSD 1.4.2 (PATTERN) #0: Mon May 8 15:51:19 CEST 2000 felix@pattern.dworkin.nl:/usr/src/sys/arch/i386/compile/PATTERN i386


>Description:
	
The ptrace cerror handling was supposedly fixed in 1.4.3_ALPHA, but
it still causes gdb to coredump.

Same bug as previously reported in #9664.

>How-To-Repeat:
	
gdb <any-prog>
run
^C
print ((char*)0)[0]

>Fix:
*** src/lib/libc/arch/i386/sys/ptrace.S.old	Fri May  5 15:15:59 2000
--- src/lib/libc/arch/i386/sys/ptrace.S	Wed Aug  9 04:15:26 2000
***************
*** 64,70 ****
  err:
  #ifdef PIC
  	PIC_PROLOGUE
! 	jmp	PIC_PLT(CERROR)
  #else
  	jmp	CERROR
  #endif
--- 64,72 ----
  err:
  #ifdef PIC
  	PIC_PROLOGUE
! 	mov	PIC_GOT(CERROR), %ecx
! 	PIC_EPILOGUE
! 	jmp	%ecx
  #else
  	jmp	CERROR
  #endif
>Release-Note:
>Audit-Trail:
>Unformatted: