This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Cygwin.dll crash, alloca and custom stack
- From: "Gary R. Van Sickle" <g dot r dot vansickle at worldnet dot att dot net>
- To: <cygwin at cygwin dot com>
- Date: Sat, 13 Aug 2005 22:10:34 -0500
- Subject: RE: Cygwin.dll crash, alloca and custom stack
> -----Original Message-----
> From: cygwin-owner@cygwin.com
> [mailto:cygwin-owner@cygwin.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/