Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Oct 1999 23:57:19 -0500 (CDT)
From:      Kevin Day <toasty@dragondata.com>
To:        newton@internode.com.au (Mark Newton)
Cc:        gupz@hotmail.com (Dodge Ram), freebsd-hackers@FreeBSD.ORG
Subject:   Re: Handling segV's
Message-ID:  <199910160457.XAA21178@celery.dragondata.com>
In-Reply-To: <199910160305.MAA67986@gizmo.internode.com.au> from "Mark Newton" at Oct 16, 1999 12:35:57 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910160457.XAA21178>