Subject: kern/98: semi-hack change to allow diagnosis of call 0 faults
To: None <gnats-admin>
From: None <sommerfeld@orchard.medford.ma.us>
List: netbsd-bugs
Date: 01/24/1994 22:05:06
>Number:         98
>Category:       kern
>Synopsis:       Semi-hack change to allow diagnosis of call through 0 faults.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 24 22:05:06 1994
>Originator:     Bill Sommerfeld
>Organization:
	None
>Release:        -current
>Environment:
    	
System: NetBSD orchard.medford.ma.us 0.9a ORCHARD#7 i386


>Description:
	DDB protects itself against recursive faults; however, this 
	doesn't apply on the initial entry into DDB, during which time the
	faulting instruction is diassembled.
	if the kernel just jumped through NULL, DDB takes a fault and *doesn't*
	longjump back to the ddb reader (because it hasn't gotten there yet..)
	and you wind up debugging the debugger, not the kernel...

>How-To-Repeat:
	Insert a call $0 instruction into the kernel somewhere :-)
>Fix:
	The enclosed fix protects only against a call through zero; the 
code should really do a probe-for-readable on the address instead.

	
*** 1.1	1994/01/25 05:08:54
--- db_disasm.c	1994/01/25 05:09:49
***************
*** 1072,1077 ****
--- 1072,1081 ----
  	int	len;
  	struct i_addr	address;
  
+ 	if (loc == NULL) {
+ 		printf("(null)\n");
+ 		return loc;
+ 	}
  	get_value_inc(inst, loc, 1, FALSE);
  	short_addr = FALSE;
  	size = LONG;
>Audit-Trail:
>Unformatted:

------------------------------------------------------------------------------