delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/14/13:06:47

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 14 Jan 2003 13:06:07 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Chris January <chris AT atomice DOT net>
cc: Boris Schaeling <boriss AT web DOT de>, <cygwin AT cygwin DOT com>
Subject: RE: Bug in g++: Testcase exits with segmentation fault
In-Reply-To: <LPEHIHGCJOAIPFLADJAHMEFIDDAA.chris@atomice.net>
Message-ID: <Pine.GSO.4.44.0301141304400.10883-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Tue, 14 Jan 2003, Chris January wrote:

> > 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::list<observer>". 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.
>
> 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.
>
> Chris

True, but not the issue here.  Even buggy programs shouldn't *crash* the
compiler.  Just my 2c.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019