Stack size weirdness - would love an explanation!

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
skylark2
Forum Commoner
Posts: 32
Joined: Wed Jun 16, 2010 6:00 am

Stack size weirdness - would love an explanation!

Post 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?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Stack size weirdness - would love an explanation!

Post 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.
Post Reply