httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <>
Subject Re: [apreq2] Crash during env test startup on Win32
Date Wed, 22 Dec 2004 15:50:04 GMT
On Wed, 22 Dec 2004, Markus Wichitill wrote:

> Joe Schaefer wrote:
> > Markus Wichitill <> writes:
> >>Joe Schaefer wrote:
> >>>Somehow your local mod_apreq might be linking against another
> >>>libapreq2, which could explain the req corruption.
> >>
> >>It's linking against the old installed libapreq2.dll. I'm not sure
> >>why, I don't think it used to do that before.
> >
> > IIRC Randy fixed this in the Win32 build a long time ago.
> Hm, how did he do that? The DLL search order in WinXP SP1 and newer is
>     1. Directory from which app loaded (executable directory)
>     2. System directory
>     3. 16-bit system directory
>     4. Windows directory
>     5. Current directory
>     6. Directories listed in the PATH environment variable
> So no matter what PATH says, the old apache2\bin\libapreq2.dll in the
> executable directory should be found first. Maybe that always happened and
> we only didn't notice it because it didn't crash by chance?
> There's a recent related change by Randy in
> but that should't make a difference in this case?

That change was to put the $APREQ2_SRC\win32\libs\ directory
first in the PATH (where the built libapreq2.dll is placed),
but I guess that's not enough to prevent such problems in
all cases, since as you listed, $APACHE2\bin\libapreq2.dll
is loaded first, if it's found (since this is where
Apache.exe lives, and is started from). You're right that
this problem may always have been there and just not noticed
until, as you found, one tries a build with a relatively old
libapreq2.dll installed (when I test things, I remove an old
install first, just to be sure).

Do you have any ideas how one could get around this? One
presumably can't easily change the order of directories that
dlls are searched for, and so when one starts Apache, the
directory that Apache.exe is in gets automatically pushed to
the front of the list, meaning an old libapreq2.dll gets
used first, if present. One could move an installed
libapreq2.dll out of the way first for the duration of the
tests, but that's probably dangerous, in case the tests
abort, potentially leaving a borked install. One other idea
is to insert an Apache LoadFile directive in httpd.conf to
load, early on, the just-built libapreq2.dll - I'll give
this a try.

best regards,

View raw message