Subject: Re: one program, one machine, two wildly different execution times
To: David Maxwell <david@vex.net>
From: Jim Bernard <jbernard@mines.edu>
List: current-users
Date: 04/21/2003 07:25:33
On Sun, Apr 20, 2003 at 11:27:08PM -0400, David Maxwell wrote:
> I'll be surprised if the variables end up at different addresses (unless
> you program does mallocs, which are affected by random input data
> because it's doing crypto of some sort) - but it would be informative in
> diagnosing the problem if that is the case.
It turns out that stack alignment is the problem. It is, under the
current scheme used by execve, affected by both argv and the environment,
so you can get either alignment by changing, e.g., the name of the program
or the current and/or previous working directories. I'll be filing a PR
later today with details, a small C program that demonstrates the effect,
and a (nonideal) fix.
Thanks again for the suggestions!
--Jim