Bug in dlopen() (or following) code in Cygwin1.dll v 1.5.19-4

Norton Allen allen@huarp.harvard.edu
Thu Mar 16 15:47:00 GMT 2006


I just spent a full day tracking down something that is
either very similar or I'm getting thrown off by the
same red herring. [The text here was pulled from a
post on the cygwin-patches list, but the discussion was
redirected here]

> On Thu, Mar 02, 2006 at 10:11:39AM -0800, Gary Zablackis wrote:
>>Since installing Cygwin1.dll v 1.5.19-4, I have a problem with the
>>computer algebra system SAGE dying at startup with no error messages
>>(i.e.  I get returned to the bash prompt with no messages of any sort).
>>I tracked the problem down to verifyable_object_isvalid() in
>>winsup/thread.cc.  The added the check below corrects this problem:
>>
>>CHANGELOG:
>>2006-03-02 Gary Zablackis gzabl@yahoo.com
>> * thread.cc (verifyable_object_isvalid): check for
>>NULL object or reference
> 
> The "efault.faulted()" two lines above your change is supposed to catch
> NULL dereferences.

Whoa! This looks like voodoo action-at-a-distance. efault.faulted()
doesn't even get passed the pointer to know whether or not it's
NULL. I'm guessing that it must assume that this function
(verifyable_object_isvalid) will *only* be called with a
particular class of pointers. Is any of this documented anywhere?

Although efault.faulted() is supposed to catch the NULL dereferences,
is there a big downside to double-checking afterwards (particularly
if there are cases where it doesn't catch them?)

>  I suspect that you were probably misled by the fact
> that gdb might show a SEGV in this function but that is to be expected
> (see lots of discussion in the cygwin mailing list about this) and there
> are patches pending for gdb which will work around this behavior.

[I did try to find this discussion, but failed. Any hints on what
the subject line was?] FWIW, I also have symptoms of gdb dropping
into the background on certain 'next' commands. Issuing 'fg' gets
me back to where I was going.

Norton Allen


--
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/



More information about the Cygwin mailing list