From owner-freebsd-hackers Fri Oct 15 21:56:43 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from celery.dragondata.com (celery.dragondata.com [205.253.12.6]) by hub.freebsd.org (Postfix) with ESMTP id 6FC4814E74 for ; Fri, 15 Oct 1999 21:56:40 -0700 (PDT) (envelope-from toasty@celery.dragondata.com) Received: (from root@localhost) by celery.dragondata.com (8.9.3/8.9.3) id XAA21178; Fri, 15 Oct 1999 23:57:19 -0500 (CDT) (envelope-from toasty) From: Kevin Day Message-Id: <199910160457.XAA21178@celery.dragondata.com> Subject: Re: Handling segV's To: newton@internode.com.au (Mark Newton) Date: Fri, 15 Oct 1999 23:57:19 -0500 (CDT) Cc: gupz@hotmail.com (Dodge Ram), freebsd-hackers@FreeBSD.ORG In-Reply-To: <199910160305.MAA67986@gizmo.internode.com.au> from "Mark Newton" at Oct 16, 1999 12:35:57 PM X-Mailer: ELM [version 2.5 PL1] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Dodge Ram wrote: > > > Also, is there a list of reasons for a SIGSEGV ? > > Only one: "Your program is buggy" :-) > > - mark I've actually got a SIGSEGV/SIGBUS handler in one of my programs that I needed, and couldn't figure a way around... I mmap() files in, then copy them to a device. This works great except when someone tries to change that file during the copy. If the size of the file shrinks, I'll SIGBUS or SIGSEGV when i try to touch past the new file size. So, i setup a signal handler and longjmp into some recovery code. Perhaps there's a better way, but I don't consider this a bug really, and i'll get a SEGV. :) Kevin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message