Subject: Re: segmentation fault on fclose?
To: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
From: Chris G. Demetriou <>
List: current-users
Date: 09/06/1994 15:59:16
> Me too.  If I might offer a somewhat programmer-friendlier debugging
> aid,
> 	fclose(NULL) called
> 	Software abort (core dumped)
> 	% 
> might be preferred over
> 	Segmentation fault (core dumped)
> 	% 
> and having to fire up a debugger to discover where it died.

This "programmer-friendly" debugging aid:
	(1) is "user-unfriendly" -- 'users' are confused by the
		original message, and presenting them with more
		information just isn't going to help!
	(2) _doesn't_ help programmers that much -- 99% of the time,
		they'd need to use a debugger to find out where the
		program died, anyway.  It's not often that you have
		exactly one use of fclose() in your code.

special casing things like this just scare the hell out of me, because
i've used ULTRIX and OSF/1 enough to know what a problem the "fixing
up unaligned access" messages are...  (thankfully, i recently found out
how to disable the fix-ups!  8-)

I was also quite shocked to see that in OSF/1, there's the SysV
uswitch(2) syscall, which allows you to specify what the behaviour of
null pointer dereferences should be!  *twitch*.