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: 1.5.19: changes have broken Qt3


On 24 May 2006 13:07, clayne@anodized.com wrote:

> On Wed, May 24, 2006 at 11:40:58AM +0100, Dave Korn wrote:
>>> Actually, is this really a fault in gdb? Cygwin is throwing a SIGSEGV
>>> signal, correct? GDB does what it's told, stops on SIGSEGV by default.
>>> 
>>> -cl
>> 
>>   But it doesn't interact properly with cygwin's exception handling ->
>> signal mechanism, and the task dies, when it should just run on.
>> 
>>   Anyone who's doing any serious debugging on Cygwin very seriously wants
>> to build their own gdb and insight from current CVS.  It's much improved
>> of late. 
> 
> Right, or bless their sanity - as it won't last long. But I'm just trying to
> debate that it's no "lacking" of gdb that it's catching SIGSEGV signals
> which are being artificially generated by cygwin.

  It's not a SIGSEGV.  It's actually a protection fault, which is one variety
of exception.  Cygwin's job is to catch the faulting access using a structured
exception handler and translate it into a signal - if, and only if, the
exception does in fact represent an event that should be reported to userland
as a signal.  If, as in this case, the exception is part of cygwin's internal
access checking and should not be reported as a signal to userland, cygwin's
job is to catch the faulting access and /not/ translate it into a signal.

  Now bear in mind that we're not talking about any old version of gdb here:
we're very specifically discussing the cygwin-targeted version of gdb.  That
means it should understand about cygwin's signal handling mechanism, and it
should know that some exceptions will be translated into signals and others
will not, and it should leave cygwin to handle that and only report a SIGSEGV
(or any other kind of signal) when cygwin decides to turn a particular
exception into a signal, and not when it doesn't.  It's an old
hangover/win32-ism that it intercepts all the windows exceptions and attempts
to interpret them to the user as SIGs of some kind; might make sense if it was
attempting to debug a windows native (msvcrt-based) application, but does not
make sense for a cygwin app these days; long long ago, it was a reasonable
design compromise when gdb was first being targeted at wintel platforms.

> What's the design mechanism for the entire 'check for non-initialized space
> and segfault if uninitialized' when it comes to statically initialized
> pthreads objects in the first place, btw? Why not just have pthread_mutex_t
> (for example actually be a pthread_mutex_t instead of it being a type'd
> pointer to the real pthread_mutex_t? Why dynamically initialize space for
> it at all via the check bunk memory->throw fault->alloc real memory for
> real pthread_mutex_t as opposed to "initialiize the mutex->if bunk space,
> segfault as usual" ? 

  In order to comply with the complex way the POSIX spec allows you to have
*either* static linktime initialisation *or* dynamic runtime initialisation of
all these objects.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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


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