Xref: utzoo comp.lang.c:14335 comp.sys.m68k:1029 Path: utzoo!attcan!uunet!mcvax!hp4nl!orcenl!bengsig From: bengsig@orcenl.uucp (Bjorn Engsig) Newsgroups: comp.lang.c,comp.sys.m68k Subject: Re: Messing with 0 ptr on m68020 & sys V / 68 Summary: That's normal Keywords: m68k null pointer Message-ID: <208.nlunix6@orcenl.uucp> Date: 28 Nov 88 09:21:35 GMT References: <784@clinet.FI> Organization: ORACLE Europe, The Netherlands Lines: 17 In article <784@clinet.FI>, riku@clinet.FI (Riku Kalinen) writes: > Questions: > 1) Why? This causes reference thru 0 ptr to return 0 instead of core dump. > (Of course, if I try to write something there, everything crashes as it > should.) > 2) Who sets up process's memory when it is started? Kernel? > 3) Is there any good reasons to do this. This "bug" has to be present for many of the utilities to run. In e.g. the SCCS, lots of programs has a chain of pointers, which end by just referencing (xxx *)0 for reading. That's just the way it is coded. Your OS vendor the has to allow you to read from address 0, whatever is there, but you can of course not count on the contents, and (as you point out) writing there gives you a bus-error (or segmentation violation). -- Bjorn Engsig, ORACLE Europe \ / "Hofstaedter's Law: It always takes ..!uunet!mcvax!orcenl!bengsig X longer than you expect, even if you phone: +31 21 59 56 411 / \ take into account Hofstaedter's Law"