Message-Id: <200508140310.j7E3AhST014198@delorie.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Gary R. Van Sickle" To: Subject: RE: Cygwin.dll crash, alloca and custom stack Date: Sat, 13 Aug 2005 22:10:34 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <42FE98AC.9050503@bitmead.com> X-IsSubscribed: yes > -----Original Message----- > From: cygwin-owner AT cygwin DOT com > [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Chris > Anyway, this similar code does work under Linux, or at least > it appears to: > It's a long walk from "at least appears to work" to "does work". [snip] > >You just threw away the stack and jumped into space. What did you > >expect to happen? > > While I don't claim to be an uber-expert in assembler, I know > I didn't "jump into space". Yeah dude, you did. You pulled the rug out from under the C runtime, Cygwin, and apparently even the OS. It is not within the jurisdiction of a C program to do that. > I've written task switching > programs in C under DOS that switch stacks with no problem. > Neither Windows nor Linux is DOS. What Korny said: what you're trying to do is nuts. Frankly I'd be surprised if gcc is even putting the asm() statements in the resulting machine code unmolested. > >Christopher Faylor wrote: > > >I would expect that a multi-threaded linux app would not > like the above. > > That may well be, but I can't see why. Multiple threads > generally are just saving and restoring the registers, and > don't care what stack those registers point to. In the old > days with user space threading, I presume the user space code > would be doing what I'm trying to do and creating its own stack. > This ain't the Good Old Days, and you're not writing a task switcher, which is the only legitimate reason to be doing what you're trying to do. -- Gary R. Van Sickle -- 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/