delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/13/23:10:47

Message-Id: <200508140310.j7E3AhST014198@delorie.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
From: "Gary R. Van Sickle" <g DOT r DOT vansickle AT worldnet DOT att DOT net>
To: <cygwin AT cygwin DOT com>
Subject: RE: Cygwin.dll crash, alloca and custom stack
Date: Sat, 13 Aug 2005 22:10:34 -0500
MIME-Version: 1.0
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/

- Raw text -


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