This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libsigsegv error handling


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Reini Urban on 7/22/2009 2:24 AM:
>> Is there a chance that this represents a bug in
>> libsigsegv SEH handling that needs to be reported upstream?
> 
> I'll report that, if it turns out so.

I've already mentioned it to Bruno, and am still working on a fix.  I have
a simple testcase - on cygwin 1.5 or 1.7, calling open(NULL,O_RDONLY)
before installing the libsigsegv handler returns -1 with EFAULT, but
calling it after installing the handler kills the app with a spurious
claim of a sigsegv.  But on Solaris, the same test case returns -1 with
EFAULT in both places.

Since SEH triggers for more reasons than SIGSEGV: the fix HAS to be that
the libsigsegv SEH handler inspects the faulting address, and if it is
stack overflow deals with it immediately (since cygwin has no sigaltstack
for libsigsegv to deal with it after SIGSEGV has been raised), but for
_all other addresses_, libsigsegv must let the address propagate onto the
cygwin SEH handler, and deal with all other faults only if they are
re-raised via a SIGSEGV handler (stack overflow is the only form of
SIGSEGV where an alternate stack is important; all other synchronous SEGV
can be dealt with in-place, and libsigsegv should not change behavior for
SEH faults that cygwin decides are not worthy of a SIGSEGV).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpm94IACgkQ84KuGfSFAYALxgCfbtFe5LXgS0i/apjaruLU/VFj
D2IAoLhF86bQU7pvqC76D2z+A+mTIdvi
=PUtR
-----END PGP SIGNATURE-----

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]