RE: Bug in g++: Testcase exits with segmentation fault

2003-01-14 Thread Boris Schaeling


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Chris
 January
 Sent: Tuesday, January 14, 2003 6:01 PM
 To: Boris Schaeling
 Cc: [EMAIL PROTECTED]
 Subject: RE: Bug in g++: Testcase exits with segmentation fault

 [...]
 The bug is actually in your testcase.
 The line:
   Observers.push_back(observer());
 creates a temporary observer object. So when the line
   observer::observer() { Select.give(this); }
 calls give(), it leaves a dangling pointer.

Oh, you are right. I've forgotten to use a smart pointer ... thanks for your
feedback!

Boris


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Bug in g++: Testcase exits with segmentation fault

2003-01-13 Thread Boris Schaeling
The testcase attached to this mail compiled with g++ 2.95.3-10 or g++ 3.2
20020927 under Cygwin 1.3.18 exits with segmentation fault. It seems to be
an error in g++ as the testcase doesn't work under Linux either. Can anyone
help or do I have to report this error to the GCC website?

BTW I found two ways to make the testcase work:
1) Change line 64 (and 70 respectively) and use observer *Observer instead
of std::listobserver. I compiled the testcase with STLport-4.5.3 under
Linux to see if it's a bug in the Standard Library but got again
segmentation fault.
2) Remove line 75 which is a simple poll(NULL, 0, 2000). It works without
this line but I don't know why.

Boris



testcase.cpp
Description: Binary data
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


1999 C++ bug reappears after upgrade to 1.3.17

2002-12-06 Thread Boris Schaeling
I upgraded Cygwin 1.3.12-2 to 1.3.17-1 and now can't run one of my C++
programs any more: A simple call of a virtual member function crashs Windows
98 (no problems under Linux). I found a bug report dated 03/1999 that
reminds me of my C++ program and has a testcase attached that causes a Blue
Screen of Death: http://sources.redhat.com/ml/cygwin/1999-03/msg00474.html

Does this testcase work for anyone under Cygwin 1.3.17-1 and Windows 98?

Boris


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




AW: modified poll() patch

2002-03-19 Thread Boris Schaeling



 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag
 von Corinna Vinschen
 Gesendet: Dienstag, 19. März 2002 11:55
 An: [EMAIL PROTECTED]
 Betreff: Re: modified poll() patch

 [...]
 thanks for the patch but could you please send a diff related to
 the latest from current cvs?  I didn't back out your patch since

Hi Corinna,

I've attached patch and changelog.

Boris



change.log2
Description: Binary data


poll.patch2
Description: Binary data

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


modified poll() patch

2002-03-16 Thread Boris Schaeling

Here is the new poll() patch. Now invalid descriptors are recognized
(invalid = positive descriptors including 0 which are not open). If there
are invalid descriptors poll() returns immediately with the count of invalid
descriptors. The timer value is ignored. That's the way Linux handles this
case.

As far as I can see there is only one bug left in this poll() function: If a
descriptor is closed revents is set to POLLIN and not to POLLHUP. That's the
way previous poll() functions worked, too. This shouldn't be a problem as
read() will return 0 and tell the application that the socket can be closed.

I changed the test case, too (see polltest2.c). Hopefully this poll()
doesn't cause any problems any more.

Boris



newpoll2.cc
Description: Binary data


poll.patch2
Description: Binary data


polltest2.c
Description: Binary data

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


poll() bugs and patch

2002-03-13 Thread Boris Schaeling

There are several bugs in poll():
- poll() must return 0 if no descriptor is ready and the timer expires. It
works correctly if all descriptors are non-negative. Otherwise poll()
returns the count of negative descriptors which is wrong.
- The implementation of poll() must call cygwin_select() even if all
descriptors are invalid. Currently poll() returns immediately - and ignores
any timer value. The return value is wrong again because of the bug above.
- If the timer expires revents must be 0 and must not be set to anything
else like POLLNVAL, POLLHUP or whatever.
- If cygwin_select() returns -1 revents must be 0 and must not be set to
POLLERR. Eg. a signal interrupting poll() doesn't mean an error has occured
for a TCP connection.
- If an error is pending revents must be set to POLLERR.
- The implementation of poll() has a local variable called open_fds that
isn't used. I can't see why this variable exists.

I've attached three files:
- newpoll.cc has a new implementation of poll() which fixes the bugs.
- patch.cc is the patch.
- polltest.c is a testcase.

I rebuilt cygwin1.dll with my poll() function so there should be no problems
when compiling.

Boris



newpoll.cc
Description: Binary data


patch.cc
Description: Binary data


polltest.c
Description: Binary data

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


AW: poll() bugs and patch

2002-03-13 Thread Boris Schaeling



 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag
 von Corinna Vinschen
 Gesendet: Mittwoch, 13. März 2002 15:06
 An: [EMAIL PROTECTED]
 Betreff: Re: poll() bugs and patch

 [...]
 Thanks for the patch but that's not quite the way to contribute a
 patch.  I'm missing a ChangeLog entry and, worse, we don't have a
 copyright assignment from you.  Due to licensing issues we need the
 copyright assignment as described on http://cygwin.com/contrib.html
 before we can incorporate the patch.  It's bigger than what is
 slipping through the cracks as insignificant.

Okay. I thought this is only a small patch and were a little bit lazy. I'll
see what I can do. :)

 It would really be nice if you could send us this assignment (which
 unfortunately has to be send via snail mail so this takes some time)

Can I fax the assignment?

Boris


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




AW: poll() bugs and patch

2002-03-13 Thread Boris Schaeling



 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag
 von Corinna Vinschen
 Gesendet: Mittwoch, 13. März 2002 18:14
 An: [EMAIL PROTECTED]
 Betreff: Re: poll() bugs and patch

 [...]
  Actually, I'm inclined to just let this one in.  There isn't a lot of
  new code, it's mainly just rearranged.

 Ok with me.  However, I'll not take that patch w/o a ChangeLog entry.
 Please create one, Boris.

Here they are:
- change.log
- poll.patch
- newpoll.cc (new implementation)
- polltest.c (testcase)

HTH,
Boris



change.log
Description: Binary data


poll.patch
Description: Binary data


polltest.c
Description: Binary data


newpoll.cc
Description: Binary data

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/