You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Gregg L. Smith" <gl...@gknw.net> on 2011/07/01 06:31:28 UTC

Windows Laundry List pt3, mod_watchdog

Hi folks,

Well, this is the same chunk of Win32 specific debugging code causing this module to crash yet again. I remember suggesting it be removed before, now I am a little more adamant about it because it is really not needed, IMO of course. If you really got to have it there, please && a 
_DEBUG to the #ifdef WIN32.

This module is needed for heartmonitor (which has it's own problems coming under separate cover). So, either it crashes on win32 or it works, your choice :-) If your choice is let it fail, then get rid of it all, heartbeat, heartmonitor, lb_method_heartmonitor & watchdog on Windoze. Of course, if there is no improvement on documentation, most of it will go bye bye come GA anyway, per what is stated in STATUS.

Attached patch just gets rid of it.

Cheers,
Gregg



Re: Windows Laundry List pt3, mod_watchdog

Posted by "Gregg L. Smith" <gl...@gknw.net>.
On 12/5/2011 12:25 AM, Mladen Turk wrote:
> On 12/05/2011 08:41 AM, William A. Rowe Jr. wrote:
>> On 12/5/2011 1:22 AM, Mladen Turk wrote:
>>>
>>> Like said on another thread, give me couple of days and I'll fix the 
>>> issue.
>>> Well, as soon as I compile httpd-2.4 on windows which might be 
>>> tricky cause
>>> build procedure is completely broken and it doesn't compile any more 
>>> out of the box.
>>
>> It has been building for Gregg and I (at least somewhat recently)
>> so please be specific?  If this is your interesting psdk logic,
>> that might be a contributing factor.
>
> Nope. Its VS2008
> Put pcre, branches/apr-1.4.x, branches/apr-util-1.4.x, apr-iconv/trunk
> inside srclib
> Disabled deflate, ssl, lua, etc...
>
> Each project/module reports
> >Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
> >Copyright (C) Microsoft Corporation.  All rights reserved.
> >fatal error RC1107: invalid usage; use RC /? for Help
> >Project : error PRJ0002 : Error result 1 returned from 'C:\Program 
> Files\Microsoft SDKs\Windows\v6.0A\bin\rc.exe'.
>
Something that could probably be mentioned in compiling docs (if we have 
any)
   perl srclib/apr/build/cvtdsp.pl -2005

before converting the VC6 projects files

Regards



Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 12/05/2011 08:41 AM, William A. Rowe Jr. wrote:
> On 12/5/2011 1:22 AM, Mladen Turk wrote:
>>
>> Like said on another thread, give me couple of days and I'll fix the issue.
>> Well, as soon as I compile httpd-2.4 on windows which might be tricky cause
>> build procedure is completely broken and it doesn't compile any more out of the box.
>
> It has been building for Gregg and I (at least somewhat recently)
> so please be specific?  If this is your interesting psdk logic,
> that might be a contributing factor.

Nope. Its VS2008
Put pcre, branches/apr-1.4.x, branches/apr-util-1.4.x, apr-iconv/trunk
inside srclib
Disabled deflate, ssl, lua, etc...

Each project/module reports
 >Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
 >Copyright (C) Microsoft Corporation.  All rights reserved.
 >fatal error RC1107: invalid usage; use RC /? for Help
 >Project : error PRJ0002 : Error result 1 returned from 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\rc.exe'.

Then ...
123>.\mod_socache_dc.c(28) : fatal error C1083: Cannot open include file: 'distcache/dc_client.h': No such file or directory
123>Build log was saved at "file://c:\Workplace\httpd-2.4.x\modules\cache\Debug\BuildLog.htm"
123>mod_socache_dc - 1 error(s), 0 warning(s)


Then ...
126>------ Build started: Project: mod_lbmethod_rr, Configuration: Debug Win32 ------
126>Compiling...
126>mod_lbmethod_rr.c
126>.\mod_lbmethod_rr.c(54) : error C2039: 'name' : is not a member of 'proxy_balancer'
126>        c:\Workplace\httpd-2.4.x\modules\proxy\mod_proxy.h(430) : see declaration of 'proxy_balancer'


And finally it gives:
========== Build: 13 succeeded, 106 failed, 0 up-to-date, 0 skipped ==========


Regards
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 12/05/2011 08:41 AM, William A. Rowe Jr. wrote:
> On 12/5/2011 1:22 AM, Mladen Turk wrote:
>>
>> Like said on another thread, give me couple of days and I'll fix the issue.
>> Well, as soon as I compile httpd-2.4 on windows which might be tricky cause
>> build procedure is completely broken and it doesn't compile any more out of the box.
>
> It has been building for Gregg and I (at least somewhat recently)
> so please be specific?  If this is your interesting psdk logic,
> that might be a contributing factor.


OK, been able to compile with VS6 and SDK 2003R2
However recent dependency on pcre.dll still makes problems building.

This means we longer can compile httpd without
third party dependency. What's worse CMake is required to build that
so this is a huge step back, since we are not self contained any more
for the (at lest bare) compilation.

OK, whatever. Should have pay attention earlier.
Anyhow, why we require pcre.dll? Think it can be statically compiled.
using
-copy srclib\pcre\pcre.$(src_dll)
instead
copy srclib\pcre\pcre.$(src_dll)
allows to have pcre statically compiled (even the one from 2.2.x works)



Regards
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 12/5/2011 1:22 AM, Mladen Turk wrote:
> 
> Like said on another thread, give me couple of days and I'll fix the issue.
> Well, as soon as I compile httpd-2.4 on windows which might be tricky cause
> build procedure is completely broken and it doesn't compile any more out of the box.

It has been building for Gregg and I (at least somewhat recently)
so please be specific?  If this is your interesting psdk logic,
that might be a contributing factor.

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 12/04/2011 10:33 PM, Gregg L. Smith wrote:
> On 12/4/2011 8:46 AM, Rainer Jung wrote:
>> Picking up this old discussion:
>>
>> On 03.07.2011 19:40, William A. Rowe Jr. wrote:
>>> On 7/1/2011 12:26 AM, Mladen Turk wrote:
>>>> On 07/01/2011 06:31 AM, Gregg L. Smith wrote:
>>>>> Hi folks,
>>>>>
>>>>> Well, this is the same chunk of Win32 specific debugging code causing this module to
>>>>> crash yet again.
>>
>> Gregg: Can you tell us, in which line it is crashing?
> Debugger says here (see attached).
>
> WatchdogInterval set or not.
>

It actually means that pre-config failed.
I suspect that the change introducing

if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG)
	/* First time config phase -- skip. */
    return OK;
inside pre_config hook is the cause.

It bypasses creation of wd_server_conf, and the child_hook is missing the server conf.
So either the first one should be deleted or something similar should be done on child hook.

Like said on another thread, give me couple of days and I'll fix the issue.
Well, as soon as I compile httpd-2.4 on windows which might be tricky cause
build procedure is completely broken and it doesn't compile any more out of the box.



Regards
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 12/05/2011 10:57 PM, Gregg L. Smith wrote:
> On 12/5/2011 5:15 AM, Mladen Turk wrote:
> Please backport to 2.4.
>

Like said, already backported.


Regards
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by "Gregg L. Smith" <gl...@gknw.net>.
On 12/5/2011 5:15 AM, Mladen Turk wrote:
>
> Fixed in the trunk and 2.4.x
> Willing to retest?
>
> Regards

I see the change which was what I had suggested in the beginning, 
granted I did not have a real good technical reason other than "it then 
works" :)  I have not built trunk recently but making the exact 
modification to my 2.4 and yes, it is fixed, does not crash and the 
module works as it should. Please backport to 2.4.

Thanks Mladen!

I now revert my vote to drop this and heartbeat/heartmonitor modules 
from 2.4 on Windows.

Regards,

Gregg

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 12/04/2011 10:33 PM, Gregg L. Smith wrote:
> On 12/4/2011 8:46 AM, Rainer Jung wrote:
>> Picking up this old discussion:
>>>>>
>>>>> Well, this is the same chunk of Win32 specific debugging code causing this module to
>>>>> crash yet again.
>>
>> Gregg: Can you tell us, in which line it is crashing?
> Debugger says here (see attached).
>
> WatchdogInterval set or not.
>

Fixed in the trunk and 2.4.x
Willing to retest?

Regards
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by "Gregg L. Smith" <gl...@gknw.net>.
On 12/4/2011 8:46 AM, Rainer Jung wrote:
> Picking up this old discussion:
>
> On 03.07.2011 19:40, William A. Rowe Jr. wrote:
>> On 7/1/2011 12:26 AM, Mladen Turk wrote:
>>> On 07/01/2011 06:31 AM, Gregg L. Smith wrote:
>>>> Hi folks,
>>>>
>>>> Well, this is the same chunk of Win32 specific debugging code 
>>>> causing this module to
>>>> crash yet again.
>
> Gregg: Can you tell us, in which line it is crashing?
Debugger says here (see attached).

WatchdogInterval set or not.

This is logged
[Mon Nov 14 10:09:23.655800 2011] [watchdog:debug] [pid 2708:tid 172] 
[2708 - 5020] child second stage post config hook
[Mon Nov 14 10:09:30.441800 2011] [mpm_winnt:notice] [pid 5020:tid 156] 
Parent: child process exited with status 3221225477 -- Restarting.

Regards,

Gregg

Re: Windows Laundry List pt3, mod_watchdog

Posted by Rainer Jung <ra...@kippdata.de>.
Picking up this old discussion:

On 03.07.2011 19:40, William A. Rowe Jr. wrote:
> On 7/1/2011 12:26 AM, Mladen Turk wrote:
>> On 07/01/2011 06:31 AM, Gregg L. Smith wrote:
>>> Hi folks,
>>>
>>> Well, this is the same chunk of Win32 specific debugging code causing this module to
>>> crash yet again.

Gregg: Can you tell us, in which line it is crashing?

>> Getting the parent pid means we we are in the child process, so we must not
>> init the parent watchdog thread (see 'return OK;')
>
> That's not how to detect it, you break -X mode.

Not sure, he wants to detect the parent. A quick look through the winnt 
MPM shows the env var is generated in

static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE 
*child_exit_event, DWORD *child_pid)

so I guess it is not set when run in -X mode, which would lead to the 
correct result.

> There is an ap_mpm_query to determine if this is the child.

I had a short look at the MPM queries and didn't find an obvious fit. 
Are you talking about AP_MPMQ_GENERATION or which query do you mean?

I guess one could also check "parent_pid == my_pid" but as noted above 
the real crash might happen somewhere else. It would be nice if Gregg 
could provide further detail.

Regards,

Rainer

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 07/03/2011 08:58 PM, William A. Rowe Jr. wrote:
> On 7/3/2011 1:52 PM, William A. Rowe Jr. wrote:
>>
>
> Mladen, do you know anything of cl.exe's ability to generate dependencies?
> I've never looked before.

I created an util
http://myomake.svn.sourceforge.net/viewvc/myomake/trunk/misc/tools/windows/mkdepend/
as part of my next pet project: make/nmake/cmake/build.py replacement :)


Cheers
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 7/3/2011 1:52 PM, William A. Rowe Jr. wrote:
> 
> The answer is generating them from build.py etc, just as we generate
> the makefiles from config.m4.  In fact the right clues embedded in
> config.m4 files might let us use these as sources ;-)

And I'm willing to build the apr build.py features and config.m4 parser
(with some dnl WIN32: hints logic to work around the prickly stuff)
over the month of July.  I have some work stuff I have to wrap up in the
coming days, but then I'll jump on it.

If everyone likes the result, we'll purge the dsp/dsw/generated mak/dep
files (except for using a -win32-src.zip file which would pre-run the
py scripts).  The working solution should be a smaller tarball, since
vc6 generated mak files include quite a bit of cruft.

Mladen, do you know anything of cl.exe's ability to generate dependencies?
I've never looked before.

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 07/03/2011 08:52 PM, William A. Rowe Jr. wrote:
> On 7/3/2011 1:49 PM, Mladen Turk wrote:
>>
>> I offered that to the httpd couple of years back,
>> but the rejection was: "Who will maintain windows nmake files"
>> IMHO those are few order of magnitude simpler then maintaining
>> VS workspace/solutions/projects (how many we have them currently?)
>> 162 counting apr/apr-util/apr-iconv!
>> And that's easier to maintain? Yeah right.
>
> The answer is generating them from build.py etc, just as we generate
> the makefiles from config.m4.  In fact the right clues embedded in
> config.m4 files might let us use these as sources ;-)

No problem, just throw in dependencies.
We already need cmake for pcre, perl for openssl, now python ...
Why not just using the entire internet ;) ?


Cheers
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 7/3/2011 1:49 PM, Mladen Turk wrote:
> On 07/03/2011 07:40 PM, William A. Rowe Jr. wrote:
>> On 7/1/2011 12:26 AM, Mladen Turk wrote:
>>> On 07/01/2011 06:31 AM, Gregg L. Smith wrote:
>>>> Attached patch just gets rid of it.
>>>>
>>>
>>> This cannot be omitted.
>>> Getting the parent pid means we we are in the child process, so we must not
>>> init the parent watchdog thread (see 'return OK;')
>>
>> That's not how to detect it, you break -X mode.
>>
>> There is an ap_mpm_query to determine if this is the child.
> 
> OK. Now, that it builds I'll fix that.
> (after I upgrade my nmake makefiles from 2.2 to 2.3)
> 
> I offered that to the httpd couple of years back,
> but the rejection was: "Who will maintain windows nmake files"
> IMHO those are few order of magnitude simpler then maintaining
> VS workspace/solutions/projects (how many we have them currently?)
> 162 counting apr/apr-util/apr-iconv!
> And that's easier to maintain? Yeah right.

The answer is generating them from build.py etc, just as we generate
the makefiles from config.m4.  In fact the right clues embedded in
config.m4 files might let us use these as sources ;-)

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 07/03/2011 07:40 PM, William A. Rowe Jr. wrote:
> On 7/1/2011 12:26 AM, Mladen Turk wrote:
>> On 07/01/2011 06:31 AM, Gregg L. Smith wrote:
>>> Attached patch just gets rid of it.
>>>
>>
>> This cannot be omitted.
>> Getting the parent pid means we we are in the child process, so we must not
>> init the parent watchdog thread (see 'return OK;')
>
> That's not how to detect it, you break -X mode.
>
> There is an ap_mpm_query to determine if this is the child.

OK. Now, that it builds I'll fix that.
(after I upgrade my nmake makefiles from 2.2 to 2.3)

I offered that to the httpd couple of years back,
but the rejection was: "Who will maintain windows nmake files"
IMHO those are few order of magnitude simpler then maintaining
VS workspace/solutions/projects (how many we have them currently?)
162 counting apr/apr-util/apr-iconv!
And that's easier to maintain? Yeah right.


Regards
-- 
^TM

Re: Windows Laundry List pt3, mod_watchdog

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 7/1/2011 12:26 AM, Mladen Turk wrote:
> On 07/01/2011 06:31 AM, Gregg L. Smith wrote:
>> Hi folks,
>>
>> Well, this is the same chunk of Win32 specific debugging code causing this module to
>> crash yet again. I remember suggesting it be removed before, now I am a little more
>> adamant about it because it is really not needed, IMO of course. If you really got to
>> have it there, please&&  a
>> _DEBUG to the #ifdef WIN32.
>> This module is needed for heartmonitor (which has it's own problems coming under
>> separate cover). So, either it crashes on win32 or it works, your choice :-) If your
>> choice is let it fail, then get rid of it all, heartbeat, heartmonitor,
>> lb_method_heartmonitor&  watchdog on Windoze. Of course, if there is no improvement on
>> documentation, most of it will go bye bye come GA anyway, per what is stated in STATUS.
>> Attached patch just gets rid of it.
>>
> 
> This cannot be omitted.
> Getting the parent pid means we we are in the child process, so we must not
> init the parent watchdog thread (see 'return OK;')

That's not how to detect it, you break -X mode.

There is an ap_mpm_query to determine if this is the child.

Re: Windows Laundry List pt3, mod_watchdog

Posted by Mladen Turk <mt...@apache.org>.
On 07/01/2011 06:31 AM, Gregg L. Smith wrote:
> Hi folks,
>
> Well, this is the same chunk of Win32 specific debugging code causing this module to crash yet again. I remember suggesting it be removed before, now I am a little more adamant about it because it is really not needed, IMO of course. If you really got to have it there, please&&  a
> _DEBUG to the #ifdef WIN32.
> This module is needed for heartmonitor (which has it's own problems coming under separate cover). So, either it crashes on win32 or it works, your choice :-) If your choice is let it fail, then get rid of it all, heartbeat, heartmonitor, lb_method_heartmonitor&  watchdog on Windoze. Of course, if there is no improvement on documentation, most of it will go bye bye come GA anyway, per what is stated in STATUS.
> Attached patch just gets rid of it.
>

This cannot be omitted.
Getting the parent pid means we we are in the child process, so we must not
init the parent watchdog thread (see 'return OK;')

Parent watchdog thread is windows specific and allows to have a
watchdog registered in parent process since the way how parent
and child cooperate is different then on unixes since there's no
fork() available.

How exactly does it crash? You say
"either it crashes on win32 or it works" with a smiley,
is not very informative.


Regards
-- 
^TM