Cygwin.dll crash, alloca and custom stack

Gary R. Van Sickle g.r.vansickle@worldnet.att.net
Sun Aug 14 09:50:00 GMT 2005


> >> 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".
> 
> Are you saying it doesn't work, or are you just generally in 
> a grumpy mood?
> 

...?  I'm saying exactly what I said.  I'm in no particular "mood".

> >> 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.
> 
> Uh, C doesn't have a "runtime".

Ubboy.  Dude, you just showed the class that you have about 5 to 10 years
more baking to do before the notion of dinking with esp should even be
crossing your mind.

>  And as you noticed, this is 
> not a pure C program. 
> Is there some law that I have to write pure C programs?

No, but there is a law that you have to learn to walk before you can run.
You are trying to sprint a marathon before you're even able to stand erect.

> As to 
> whether I'm "pulling the rug out" from the OS, there is no 
> reason to assume that should be so. There is no reason why an 
> OS should particularly care where I put my stack. The world 
> doesn't revolve around the C language's assumptions,

Actually a large part of it does, but that's immaterial to our current
discussion.

> but it 
> could well be that Windows does care. That's why I'm asking 
> my question here. Not so that you can express your general 
> dissatisfaction with non-C programmers, but so that people 
> who might actually know can speak up.
> 

I actually know.  There is no reason you should be worrying about esp given:
- The program you're writing.
- Your level of knowledge of the C language, compilers, runtimes, Cygwin,
and Oses.

You are attacking the wrong problem in the wrong way.  That is the best way
to guarantee disaster.  Since I suspect you do not wish disaster, I and
others are trying to point that fact out to you.

> 
> >> I've written task switching
> >> programs in C under DOS that switch stacks with no problem.
> >> 
> >
> >Neither Windows nor Linux is DOS.  
> 
> This is true, but so what?

So what?  DOS was not even an OS, it was a single-threaded filesystem and
program loader.  The other two do their own task switching.

> Unless you have specific 
> information that Windows or Linux cares, you are just being grumpy.
> 

Or helpful, as the case may be.

> >What Korny said: what you're trying to do is nuts. 
> 
> Whether what I want to do will work or not is one thing. But 
> telling me that trying to do it is "nuts", is.. well nuts. 

Telling you the truth is "nuts"?  Well, since you don't seem to want to
listen to simple facts, maybe you're right.

> How in heck would you know if trying to do such a thing is 
> nuts?

Because I've both written interpreters and manipulated system stack
pointers, and I know that there is no connection between the two.

> Just because you don't understand the legitimate 
> reasons for wanting to do it doesn't mean that it is.
> 

In the post you're replying to, I listed the legitimate reasons for wanting
to do it.  Here they are again:

- If you're writing a task switcher.

You're not doing any of the things on that list, are you?  If not, then you
have no legitimate reason to be trying to dink with esp in the way that you
are.  There's no more to understand.

> >Frankly I'd be surprised if gcc is even putting the asm() 
> statements in the resulting machine code unmolested.
> 
> You seem to be surprised by a lot of things.
> 

Mainly by how pointing out simple facts to you throws you into such a silly
rage.

> >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.
> 
> Oh yeah, you are some kind of god of computer science that 
> you can pronounce judgements about what kind of things are 
> "legitimate"? 

No, just an old country programmer who can recognize the "wrong
problem+wrong solution=disaster" situation when he sees it.

> Do you actually realise that not all computer languages can 
> be implemented with a model of one stack?
> 

Do you actually realize that there are far better ways to implement stacks
for interpreters than dinking with esp?  Ways that actually have a chance of
working?  I suggest you investigate those alternatives instead of trying to
do something that cannot work, and then getting all pissy when people try to
dissuade you from wasting your time.

And don't make me break out my Turing Machine on you about that statement of
yours.

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



More information about the Cygwin mailing list