You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ross Gardler <rg...@apache.org> on 2006/01/19 18:12:02 UTC

Dispatcher gives stack overflow

I'm trying to get the listLocations plugin (or rather a copy of it) 
working with the Dispatcher. However, I'm getting a stack overflow.

Here's how my plugin differes from the current listLocations one:

Added a contract to resources/themes/common/html (but not created a *fv 
file yet so the contract is not being used).

Defined the structurer and themer plugins to forrest.properties

Added project.theme=default and project.theme-extension=.fv to forrest 
properties.

Added a forrest.properties.xml file (with a value for my contract), but 
nothing else, so it isn' really being used yet, since the contract s not 
being used either.

Doing Forrest run and http://localhsot:8888 results in a 500 response. 
The console reports there has been a stack overflow.

Looking in the logs I see there is a problem with the locationmap. I am 
seeing entried like this:

PARAM: '2' VALUE: 
'linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-index'
PARAM: '0' VALUE: 
'structurer-properties.html.linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-index'
PARAM: '1' VALUE: 'html'

It looks to me like we have a loop between the sitemap and the 
locationmap. However, due to the masses of indirection between these two 
files my tired old brain can't work out what on earth is happening, or 
what is supposed to be happening.

I'll have another look at it when I have a refreshed head in the 
morning. But I want to flag this up as another really good example why 
we need remove this indirection as Tim suggested (see 
http://issues.apache.org/jira/browse/FOR-783 )

Ross




Reading mails carefully (was Re: Dispatcher gives stack overflow)

Posted by Thorsten Scherler <th...@apache.org>.
Hi all, hi Ross,

to recall the context:

El jue, 19-01-2006 a las 18:38 +0100, Thorsten Scherler escribió:
...
> Bottom line, to point this out all the time does not fix it, you can
> either wait for the final dispatcher release or fix it yourself. 
> 
> Sorry, ATM I am busy to bring up lenya zones and have a basic
> infrastructure to work on the doco pub (lenya publication - forrest
> rendering). As soon as I have lenya zones working like I want it, I
> will
> focus my time again to release the dispatcher (Cyriaque brought us
> closer to this point on forrest Friday, thanks again).
> 
> Till then 783 is for me a wont-fix since it will be fixed in the final
> release with the rewrite of v2.
> 
> P.S.: you know me, but again I want to point out no offense intended
> at
> any time. ;-)

I say 
a) to bring the issue up often, does not fix it (as a matter of fact)
b) that it will be fixed in the final release (as compromise)
c) I would not be available to help because I am busy (as explanation)
d) state when the issue will be solved (after finishing setting up
lenya.zones - the explanation why I am busy ATM)
e) point again to the well known jira issue FOR-783 (as well mail
archive recorded, where you can find further mails related to this
issue) 

...and last but not least explicit state "no offense intended at
> any time. ;-)"

Ross gives the following reply:

El jue, 19-01-2006 a las 19:40 +0000, Ross Gardler escribió:
> Thorsten Scherler wrote:
> > 
...
> >>I'll have another look at it when I have a refreshed head in the 
> >>morning. But I want to flag this up as another really good example why 
> >>we need remove this indirection as Tim suggested (see 
> >>http://issues.apache.org/jira/browse/FOR-783 )
> 
> <snip/>
> 
> > Bottom line, to point this out all the time does not fix it, you can
> > either wait for the final dispatcher release or fix it yourself. 
> 
> Please, lets not go down this particular route again. Nobody has asked 
> you to fix anything. Please do not take things personally.
> 
> My mail clearly states I will look at it again when I have time and a 
> clear head (see quoted text above). In the meantime I believe it is 
> helpful to us all if this kind of problem is documented in our mail 
> archives so that we can all learn from it.

Now I am a bit confused. 

Who is taking things personally?

Please read mails carefully (I as well fail on this far too often). 

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Dispatcher gives stack overflow

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> El jue, 19-01-2006 a las 19:40 +0000, Ross Gardler escribió:
> 
> ...
> 
>>>Hmm, never saw this in my life. ...but wait do you have a match="*.hmtl"
>>>in your plugin?
>>
>>No. Only pattern="^(.*?)([^/]*)locations.xml$"
>>
>>
>>>>It looks to me like we have a loop between the sitemap and the 
>>>>locationmap. 
>>>
>>>
>>>hmm, I do not think so.
>>
>>Something is adding all those "-linkmap" sections to the request. And it 
>>sure looks like a loop to me. Maybe, you'll be more convinced if I tell 
>>you that before the one copied above is a whole series that look like 
>>this...
>>
>>PARAM: 'hint' VALUE: 'structurer.html.index'
>>
>>...
>>
>>LEVEL 2
>>PARAM: '2' VALUE: 'linkmap-index'
>>PARAM: '0' VALUE: 'structurer.html.linkmap-index'
>>PARAM: '1' VALUE: 'html'
>>LEVEL 1 is named 'lm'
>>PARAM: '../hint' VALUE: 'structurer.html.linkmap-index
>>
>>...
>>
>>got location: cocoon://prepare.structurer.html.linkmap-index
>>
>>...
>>
>>PARAM: 'hint' VALUE: 'structurer.html.linkmap-linkmap-index'
>>
>>...
>>
>>got location: cocoon://prepare.structurer.html.linkmap-linkmap-index
>>
>>...
>>
>>PARAM: 'hint' VALUE: 'structurer.html.linkmap-linkmap-linkmap-index'
>>
>>...
>>
>>got location: cocoon://prepare.structurer.html.linkmap-linkmap-linkmap-index
>>
>>...
>>
>>And so on...
> 
> 
> Hmm, yeah that seems like a loop. I just tried the same think and the
> same happens to me. 
> 
> Then I looked into site.xml and found:
> <forrestPlugins label="Plugins Index" href="site:forrest/plugins"
> description="Index of Forrest Plugins"/>
> 
> I changed this to 
> <!--<forrestPlugins label="Plugins Index" href="site:forrest/plugins"
> description="Index of Forrest Plugins"/>-->
> 
> ...and voila, it is working. Then I remembered finally that somebody
> reported stack overflows with the dispatcher and found:
> http://issues.apache.org/jira/browse/FOR-738
> 
> This seems to be the cause of your problems, v2 is again not working
> with site: in general (I did some tests with the lenya.zones site [based
> on v2]). Maybe it is because of the indirections of lm and v2, but it
> seems to be more, once again, the jxpath problem.

Thanks Thorsten. This means that the same problem will occur for all 
plugins, since the above link is a part of the template.

Not a huge problem in the short term.

Ross


Re: Dispatcher gives stack overflow

Posted by Thorsten Scherler <th...@apache.org>.
El jue, 19-01-2006 a las 19:40 +0000, Ross Gardler escribió:

...
> > Hmm, never saw this in my life. ...but wait do you have a match="*.hmtl"
> > in your plugin?
> 
> No. Only pattern="^(.*?)([^/]*)locations.xml$"
> 
> >>It looks to me like we have a loop between the sitemap and the 
> >>locationmap. 
> > 
> > 
> > hmm, I do not think so.
> 
> Something is adding all those "-linkmap" sections to the request. And it 
> sure looks like a loop to me. Maybe, you'll be more convinced if I tell 
> you that before the one copied above is a whole series that look like 
> this...
> 
> PARAM: 'hint' VALUE: 'structurer.html.index'
> 
> ...
> 
> LEVEL 2
> PARAM: '2' VALUE: 'linkmap-index'
> PARAM: '0' VALUE: 'structurer.html.linkmap-index'
> PARAM: '1' VALUE: 'html'
> LEVEL 1 is named 'lm'
> PARAM: '../hint' VALUE: 'structurer.html.linkmap-index
> 
> ...
> 
> got location: cocoon://prepare.structurer.html.linkmap-index
> 
> ...
> 
> PARAM: 'hint' VALUE: 'structurer.html.linkmap-linkmap-index'
> 
> ...
> 
> got location: cocoon://prepare.structurer.html.linkmap-linkmap-index
> 
> ...
> 
> PARAM: 'hint' VALUE: 'structurer.html.linkmap-linkmap-linkmap-index'
> 
> ...
> 
> got location: cocoon://prepare.structurer.html.linkmap-linkmap-linkmap-index
> 
> ...
> 
> And so on...

Hmm, yeah that seems like a loop. I just tried the same think and the
same happens to me. 

Then I looked into site.xml and found:
<forrestPlugins label="Plugins Index" href="site:forrest/plugins"
description="Index of Forrest Plugins"/>

I changed this to 
<!--<forrestPlugins label="Plugins Index" href="site:forrest/plugins"
description="Index of Forrest Plugins"/>-->

...and voila, it is working. Then I remembered finally that somebody
reported stack overflows with the dispatcher and found:
http://issues.apache.org/jira/browse/FOR-738

This seems to be the cause of your problems, v2 is again not working
with site: in general (I did some tests with the lenya.zones site [based
on v2]). Maybe it is because of the indirections of lm and v2, but it
seems to be more, once again, the jxpath problem.

We need to see what gives v3 with the site:, but if it is fixed there it
wont fix in v2, if not we need to dig in again why Davids workaround for
site: is not working anymore.

HTH

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Dispatcher gives stack overflow

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> El jue, 19-01-2006 a las 17:12 +0000, Ross Gardler escribió:
> 
>>I'm trying to get the listLocations plugin (or rather a copy of it) 
>>working with the Dispatcher. However, I'm getting a stack overflow.
>>
>>Here's how my plugin differes from the current listLocations one:
>>

...

>>Added project.theme=default and project.theme-extension=.fv to forrest 
>>properties.
>>
> 
> 
> required/optional 
> 
> ...ah I just see project.theme=default does not exist anymore!!! it is
> now common.

Checked with common theme, same result.

>>Added a forrest.properties.xml file (with a value for my contract), but 
>>nothing else, so it isn' really being used yet, since the contract s not 
>>being used either.
>>
>>Doing Forrest run and http://localhsot:8888 results in a 500 response. 
> 
> 
> Yeah, because http://localhsot != http://localhost (or is it a spelling
> error only in this mail?)

Spelling in the mail. Status Code 500 is a server configuration error.

>>The console reports there has been a stack overflow.
>>
> 
> 
> Hmm, stack overflow I only saw in raw occasion while developing this
> stuff (normally it was an error *I* made and leaded to a looping
> behavior). 
> 
> 
>>Looking in the logs I see there is a problem with the locationmap. I am 
>>seeing entried like this:
>>
>>PARAM: '2' VALUE: 
>>'linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-index'
>>PARAM: '0' VALUE: 
>>'structurer-properties.html.linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-index'
>>PARAM: '1' VALUE: 'html'
>>
> 
> 
> Hmm, never saw this in my life. ...but wait do you have a match="*.hmtl"
> in your plugin?

No. Only pattern="^(.*?)([^/]*)locations.xml$"

>>It looks to me like we have a loop between the sitemap and the 
>>locationmap. 
> 
> 
> hmm, I do not think so.

Something is adding all those "-linkmap" sections to the request. And it 
sure looks like a loop to me. Maybe, you'll be more convinced if I tell 
you that before the one copied above is a whole series that look like 
this...

PARAM: 'hint' VALUE: 'structurer.html.index'

...

LEVEL 2
PARAM: '2' VALUE: 'linkmap-index'
PARAM: '0' VALUE: 'structurer.html.linkmap-index'
PARAM: '1' VALUE: 'html'
LEVEL 1 is named 'lm'
PARAM: '../hint' VALUE: 'structurer.html.linkmap-index

...

got location: cocoon://prepare.structurer.html.linkmap-index

...

PARAM: 'hint' VALUE: 'structurer.html.linkmap-linkmap-index'

...

got location: cocoon://prepare.structurer.html.linkmap-linkmap-index

...

PARAM: 'hint' VALUE: 'structurer.html.linkmap-linkmap-linkmap-index'

...

got location: cocoon://prepare.structurer.html.linkmap-linkmap-linkmap-index

...

And so on...

I have no idea why this is happening yet. My head still hurts too much 
to dive into the sitemap/linkmap stuff.

>>I'll have another look at it when I have a refreshed head in the 
>>morning. But I want to flag this up as another really good example why 
>>we need remove this indirection as Tim suggested (see 
>>http://issues.apache.org/jira/browse/FOR-783 )

<snip/>

> Bottom line, to point this out all the time does not fix it, you can
> either wait for the final dispatcher release or fix it yourself. 

Please, lets not go down this particular route again. Nobody has asked 
you to fix anything. Please do not take things personally.

My mail clearly states I will look at it again when I have time and a 
clear head (see quoted text above). In the meantime I believe it is 
helpful to us all if this kind of problem is documented in our mail 
archives so that we can all learn from it.

Ross



Re: Dispatcher gives stack overflow

Posted by Thorsten Scherler <th...@apache.org>.
El jue, 19-01-2006 a las 17:12 +0000, Ross Gardler escribió:
> I'm trying to get the listLocations plugin (or rather a copy of it) 
> working with the Dispatcher. However, I'm getting a stack overflow.
> 
> Here's how my plugin differes from the current listLocations one:
> 
> Added a contract to resources/themes/common/html (but not created a *fv 
> file yet so the contract is not being used).
> 

optional

> Defined the structurer and themer plugins to forrest.properties
> 

required 

> Added project.theme=default and project.theme-extension=.fv to forrest 
> properties.
> 

required/optional 

...ah I just see project.theme=default does not exist anymore!!! it is
now common.

> Added a forrest.properties.xml file (with a value for my contract), but 
> nothing else, so it isn' really being used yet, since the contract s not 
> being used either.
> 
> Doing Forrest run and http://localhsot:8888 results in a 500 response. 

Yeah, because http://localhsot != http://localhost (or is it a spelling
error only in this mail?)

> The console reports there has been a stack overflow.
> 

Hmm, stack overflow I only saw in raw occasion while developing this
stuff (normally it was an error *I* made and leaded to a looping
behavior). 

> Looking in the logs I see there is a problem with the locationmap. I am 
> seeing entried like this:
> 
> PARAM: '2' VALUE: 
> 'linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-index'
> PARAM: '0' VALUE: 
> 'structurer-properties.html.linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-linkmap-index'
> PARAM: '1' VALUE: 'html'
> 

Hmm, never saw this in my life. ...but wait do you have a match="*.hmtl"
in your plugin?

> It looks to me like we have a loop between the sitemap and the 
> locationmap. 

hmm, I do not think so.

> However, due to the masses of indirection between these two 
> files my tired old brain can't work out what on earth is happening, or 
> what is supposed to be happening.
> 
> I'll have another look at it when I have a refreshed head in the 
> morning. But I want to flag this up as another really good example why 
> we need remove this indirection as Tim suggested (see 
> http://issues.apache.org/jira/browse/FOR-783 )
> 

Actually only one word why I originally did it, because it lets the user
override each and every step of v2. Like I said in earlier mails I agree
that it need a cleanup and promised that the dispatcher will have
addressed it. Anyway I do not even thing that it is related with your
current problem. 

Bottom line, to point this out all the time does not fix it, you can
either wait for the final dispatcher release or fix it yourself. 

Sorry, ATM I am busy to bring up lenya zones and have a basic
infrastructure to work on the doco pub (lenya publication - forrest
rendering). As soon as I have lenya zones working like I want it, I will
focus my time again to release the dispatcher (Cyriaque brought us
closer to this point on forrest Friday, thanks again).

Till then 783 is for me a wont-fix since it will be fixed in the final
release with the rewrite of v2.

P.S.: you know me, but again I want to point out no offense intended at
any time. ;-)

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)