Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Subject: RE: G++ guru's please comment - Re: FW: pthread_create problem in Cygwin 1.1.8-2] MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 Date: Mon, 9 Apr 2001 09:38:57 +1000 content-class: urn:content-classes:message Message-ID: Thread-Topic: G++ guru's please comment - Re: FW: pthread_create problem in Cygwin 1.1.8-2] Thread-Index: AcDAg6CrZoV+mMLNReewvfheUQC8FQAAJKFg From: "Robert Collins" To: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id TAA08444 > -----Original Message----- > From: Christopher Faylor [mailto:cgf AT redhat DOT com] > Sent: Monday, April 09, 2001 9:35 AM > To: cygwin AT cygwin DOT com > Subject: Re: G++ guru's please comment - Re: FW: > pthread_create problem > in Cygwin 1.1.8-2] > > > On Mon, Apr 09, 2001 at 07:21:09AM +1000, Robert Collins wrote: > >----- Original Message ----- > >From: "Joost Kraaijeveld" > > > >>>1) It's possible it's a problem with the thread exiting > code, could you > >>>try using a pthread_exit call instead of return and report back. > >>I replaced return 0 with pthread_exit(0) andf now id does > not crash on > >>any computer. > > > >hmm. This really needs a compiler expert to jump in and comment now > >(that reduces the likelyhood that it's a thread specific fault. > > It's not likely that it is a compiler problem. pthread_create calls > __pthread_create which calls the user function. If the user function > returns it should it a __pthread_exit. If it doesn't hit the > __pthread_exit, then that would mean that the stack is corrupted > somehow. > > That should be pretty simple to debug. It should be, so I did. I haven't got a working binary to compare with (Earnie: please mail me your working one, with symbols.) I think it's a problem in static code so I should be able to see the difference.. Background: pthread_create starts the new thread with a wrapper function. The wrapper function runs the thread function, and when the user function returns then cleans up the unix structures and calls ExitThread(0); The crash occurs _before_ control returns to the wrapper function. This implies it's a problem in the return code. Other things we know: the return in the try{} is at fault. Returning outside the try{} works ok. Calling pthread_exit directly works ok. I can't see any syncronisation issues with the source that Joost provided. In short I think this is a 2.95.3 g++ problem. > > >>> 2) What cygwin1.dll are you using? I'm using a custom > build ~= to the > >> > latest snapshot. > >> $ uname -a > >> CYGWIN_NT-5.0 ABRARACOURCIX 1.1.8(0.34/3/2) 2001-01-31 > 10:08 i686 unknown > > i.e., not a snapshot. > > cgf Which is interesting: I see the behaviour with my threads code, and so does Joost, but Earnie doesn't. Earnie is running gcc 2.95.2, Joost and I are both running 2.95.3. Rob > > -- > Want to unsubscribe from this list? > Check out: http://cygwin.com/ml/#unsubscribe-simple > > -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple