From owner-freebsd-hackers Tue Sep 15 08:55:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA02499 for freebsd-hackers-outgoing; Tue, 15 Sep 1998 08:55:30 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from artemis.syncom.net (artemis.syncom.net [206.64.31.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA02492 for ; Tue, 15 Sep 1998 08:55:27 -0700 (PDT) (envelope-from cyouse@artemis.syncom.net) Received: from localhost (localhost [[UNIX: localhost]]) by artemis.syncom.net (8.8.8/8.8.8) with SMTP id MAA27445; Tue, 15 Sep 1998 12:06:35 -0400 (EDT) Date: Tue, 15 Sep 1998 12:06:34 -0400 (EDT) From: Charles Youse To: Mikael Karpberg cc: Konrad Heuer , freebsd-hackers@FreeBSD.ORG Subject: Re: Catching SIGSEGV In-Reply-To: <199809151330.PAA00371@ocean.campus.luth.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 15 Sep 1998, Mikael Karpberg wrote: > My guess is that you would want to declare things like this: > > volatile int nsegv = 0; > volatile int *ptr; > int zero = 0; > > Then the restarted "buf = *ptr;" line will not use a buffered value for ptr > but read it from memory. I think. Unfortunately, because the value of ptr is most likely read from a register in the instruction that faults, declaring it volatile does not help. Volatile prevents optimization, but loading a value into a register to perform indirection is not an optimization, and in most cases (and on most architectures) this load is *required*. Restarting the instruction, despite the changed value of ptr, will not change the value in the register, and so the fault will occur again. Chuck Youse cyouse@syncom.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message