Mailing List Archive

[mod_backhand-users] module order and byHostname seg fault?
Hi,

I'm testing the backhand module with the jserv module in an attempt to
get load balancing of both static and dynamic pages.
When loading the backhand module after the jserv I find that the
byHostname sev faults on trying to access the hostname in the
serverstats structure.
This seems to go away when loading the module before the jserv.
Is this a know feature of modules or a bug?

--
Regards,
M

--
Martin Sillence / Unix/Internet developer / PR Newswire Europe Ltd.
martin.sillence@prnewswire.co.uk / Tel: 01865 785065 / Fax: 01865 785100
--
For support call 01865 785055
---
EMail Disclaimer: http://www.oit.net/prne_disclaimer.txt
[mod_backhand-users] module order and byHostname seg fault? [ In reply to ]
Martin,

Though I have never heard of this particular bug, this is definitely a
possible side effect of module loading order. I would like to think that
mod_backhand doesn't munge any of the variables it is passed. I was pretty
careful when I wrote it to not do this.

If jserv is not so careful, it could feasibly *change* some of the variables
in the request_rec struct for its own internal use. I am *not* claiming that
it does this, as I have never examined the code. It just seems intuitive that
if when mod_jserv's hooks are called before mod_backhand's it crashed then
something must be happening in mod_jserv's hooks.

The odd things is that the byHostname function doesn't really use any of the
servers variables. Hmmm...

Another thing -- if you are running on Solaris, things don't work right with
BackhandFromSO unless mod_bakchand is compiled statically into Apache. It
doesn't appreciate loaded modules loading other modules for some reason I
cannot determine.


Martin Sillence wrote:
> I'm testing the backhand module with the jserv module in an attempt to
> get load balancing of both static and dynamic pages.
> When loading the backhand module after the jserv I find that the
> byHostname sev faults on trying to access the hostname in the
> serverstats structure.
> This seems to go away when loading the module before the jserv.
> Is this a know feature of modules or a bug?

--
Theo Schlossnagle
1024D/A8EBCF8F/13BD 8C08 6BE2 629A 527E 2DC2 72C2 AD05 A8EB CF8F
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7
[mod_backhand-users] module order and byHostname seg fault? [ In reply to ]
"Theo E. Schlossnagle" wrote:
>
> Martin,
>
> Though I have never heard of this particular bug, this is definitely a
> possible side effect of module loading order. I would like to think that
> mod_backhand doesn't munge any of the variables it is passed. I was pretty
> careful when I wrote it to not do this.
>
> If jserv is not so careful, it could feasibly *change* some of the variables
> in the request_rec struct for its own internal use. I am *not* claiming that
> it does this, as I have never examined the code. It just seems intuitive that
> if when mod_jserv's hooks are called before mod_backhand's it crashed then
> something must be happening in mod_jserv's hooks.

I was wondering if it might be a feature of the global nature of the
serverstats structure?
I'm a little suspicious of a global extern in a loadable module....
The passed parameters are OK.
I've not delved deeply have you tried it with any other modules? Is it
normal to have externs in modules?

--
Regards,
M

--
Martin Sillence / Unix/Internet developer / PR Newswire Europe Ltd.
martin.sillence@prnewswire.co.uk / Tel: 01865 785065 / Fax: 01865 785100
--
For support call 01865 785055
---
EMail Disclaimer: http://www.oit.net/prne_disclaimer.txt
[mod_backhand-users] module order and byHostname seg fault? [ In reply to ]
The serverstats structure isn't actually externed, mod_backhand.c owns that
one. It is just externed in other source files so that they can see it.
serverstats *should* function just like the apache scoreboard -- as I took
most of the code from that.

I should be fine to have externs in a shared object, but as far as I know
mod_backhand doesn't have any.

As for the seg fault in byHostname, the only places I could imagin it
happening are around the lines where the free() occurs. Do you have any idea
on what line it is dying?

Martin Sillence wrote:
> I was wondering if it might be a feature of the global nature of the
> serverstats structure?
> I'm a little suspicious of a global extern in a loadable module....
> The passed parameters are OK.
> I've not delved deeply have you tried it with any other modules? Is it
> normal to have externs in modules?


--
Theo Schlossnagle
1024D/A8EBCF8F/13BD 8C08 6BE2 629A 527E 2DC2 72C2 AD05 A8EB CF8F
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7