Page 1 of 1

Stack size weirdness - would love an explanation!

Posted: Wed Apr 20, 2011 8:43 am
by skylark2
I discovered something really odd today:

My executables weren't built with a large enough stack size for some situations. Easy enough fix - just recompile with a larger stack. Did that, no more problems. What's confusing me is the symptoms:

Executable run by calling it from php under Apache - no problem. No error messages, correct results.
Same executable run on same machine with same parameters in same location from the command line (with full administrator privileges) - dies with a stack fault.

This machine is running Windows XP and Apache 2.2.

Executable run by calling it from php under IIS - kills the server.
Same executable run on same machine with same parameters in same location from the command line - dies with a stack fault.

Can anyone satisfy my curiosity as to how running an executable through Apache would somehow give it a bigger stack size?

Re: Stack size weirdness - would love an explanation!

Posted: Thu Apr 21, 2011 1:31 am
by Weirdan
That depends on what gets stored on the stack I imagine. If you, for example, store process' environment on the stack, it might easily be very different between CLI and various webserver environments.