You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Ing. Andrea Vettori" <ma...@andreavettori.com> on 2007/07/05 01:14:43 UTC

[S2] App produces lot garbage IMPORTANT NEWS (I HOPE)

Hi,

for the readers of my previous messages I'm still facing the problem.  
After having upgraded the application server and even re-designed  
some code to not use JMS to exclude some possible causes now I think  
I've found something interesting. And it's struts related.

I've keeped some threads dump of when the server continually allocate  
and garbage collect large amount of data. Today I take seven of them.

Looking carefully to all of them I noticed there is ALWAYS the same  
http thread that's on the struts <s:password> tag handler on a  
specific jsp page. This page is used about one hundred times a day.  
But when the server is generating garbage there is always a thread in  
it. Moreover I trace the visits on a sql database so I'm sure that  
the thread is somewhat "locked" into that page and it's not many  
different visits to the same page.

Below you'll find the threads dump taken a few seconds one after the  
other,  in a moment when the server is producing garbage.

I'm not a thread dump expert reader but it seems to me that's some  
infinite loop that starts on org/apache/struts2/views/jsp/ 
ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)

The jsp source is at http://www.andreavettori.com/trace/ 
carrelloB_jsp.java

This page is "special" because there are TWO struts forms (with  
different name) both with a textfield and a password field, with the  
same name in the two forms. Both point to the same action class with  
different action name in struts.conf. Not sure if this is peculiar or  
not.

I'll try to read the sources of the various methods called in the  
thread dump but I hope that someone more expert on the struts source  
code can help me found IF this is the source of my problems.

P.S.
I'm using the simple template.


Thanks



"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at java/util/HashMap.get(Ljava/lang/Object;)Ljava/lang/Object; 
(Unknown Source)[optimized]
     at com/opensymphony/xwork2/util/OgnlUtil.compile(OgnlUtil.java: 
200)[inlined]
     at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
     at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]
     ^-- Holding lock: java/util/HashMap@0x2a9756cf00[thin lock]
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:122)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:113)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at java/util/HashMap.put(Ljava/lang/Object;Ljava/lang/Object;) 
Ljava/lang/Object;(Unknown Source)[optimized]
     at ognl/OgnlContext.put(OgnlContext.java:477)[optimized]
     at com/opensymphony/xwork2/util/OgnlValueStack 
$ObjectAccessor.getProperty(OgnlValueStack.java:61)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at com/opensymphony/xwork2/util/CompoundRootAccessor.getProperty 
(CompoundRootAccessor.java:101)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at ognl/ASTProperty.getValueBody(ASTProperty.java:92)[optimized]
     at ognl/SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
[optimized]
     at ognl/SimpleNode.getValue(SimpleNode.java:210)[optimized]
     at ognl/Ognl.getValue(Ognl.java:333)[inlined]
     at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
     at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:122)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at ognl/OgnlRuntime.getPropertyDescriptors(OgnlRuntime.java:1455) 
[optimized]
     ^-- Holding lock: ognl/OgnlRuntime$ClassCache@0x2a974ab820[thin  
lock]
     at ognl/OgnlRuntime.getPropertyDescriptor(OgnlRuntime.java:1475) 
[inlined]
     at ognl/OgnlRuntime.getGetMethod(OgnlRuntime.java:1259)[optimized]
     at ognl/OgnlRuntime.getMethodValue(OgnlRuntime.java:919)[inlined]
     at ognl/ObjectPropertyAccessor.getPossibleProperty 
(ObjectPropertyAccessor.java:53)[inlined]
     at ognl/ObjectPropertyAccessor.getProperty 
(ObjectPropertyAccessor.java:121)[inlined]
     at com/opensymphony/xwork2/util/OgnlValueStack 
$ObjectAccessor.getProperty(OgnlValueStack.java:58)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at com/opensymphony/xwork2/util/CompoundRootAccessor.getProperty 
(CompoundRootAccessor.java:101)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at ognl/ASTProperty.getValueBody(ASTProperty.java:92)[optimized]
     at ognl/SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
[optimized]
     at ognl/SimpleNode.getValue(SimpleNode.java:210)[optimized]
     at ognl/Ognl.getValue(Ognl.java:333)[inlined]
     at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
     at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:122)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at com/opensymphony/xwork2/util/OgnlValueStack 
$ObjectAccessor.getProperty(OgnlValueStack.java:58)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at com/opensymphony/xwork2/util/CompoundRootAccessor.getProperty 
(CompoundRootAccessor.java:101)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at ognl/ASTProperty.getValueBody(ASTProperty.java:92)[optimized]
     at ognl/SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
[optimized]
     at ognl/SimpleNode.getValue(SimpleNode.java:210)[optimized]
     at ognl/Ognl.getValue(Ognl.java:333)[inlined]
     at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
     at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:122)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at com/opensymphony/xwork2/util/OgnlValueStack 
$ObjectAccessor.getProperty(OgnlValueStack.java:59)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at com/opensymphony/xwork2/util/CompoundRootAccessor.getProperty 
(CompoundRootAccessor.java:101)[optimized]
     at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
     at ognl/ASTProperty.getValueBody(ASTProperty.java:92)[optimized]
     at ognl/SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
[optimized]
     at ognl/SimpleNode.getValue(SimpleNode.java:210)[optimized]
     at ognl/Ognl.getValue(Ognl.java:333)[inlined]
     at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
     at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:122)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:109)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
     at ognl/ASTProperty.getValueBody(ASTProperty.java:92)[optimized]
     at ognl/SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
[optimized]
     at ognl/SimpleNode.getValue(SimpleNode.java:210)[optimized]
     at ognl/Ognl.getValue(Ognl.java:333)[inlined]
     at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
     at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:122)
     at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
     at org/apache/struts2/components/Component.findValue 
(Component.java:313)
     at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)
     at org/apache/struts2/components/UIBean.end(UIBean.java:481)
     at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
     at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)
     at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)

--
Ing. Andrea Vettori
Responsabile Sistemi Informativi



--
Ing. Andrea Vettori
Consulente per l'Information Technology



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Found Denial Of Service (was [S2] App produces lot garbage IMPORTANT NEWS (I HOPE))

Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/5, Alexis Pigeon <pi...@gmail.com>:
>
> I'm not familiar enough with JIRA to file an issue right now, but I'll
> do so later today if I find some time...



Instead of creating a new issue, put a comment in this:
https://issues.apache.org/struts/browse/WW-2030

Antonio

Re: Found Denial Of Service (was [S2] App produces lot garbage IMPORTANT NEWS (I HOPE))

Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
Hi,

the cpu usage is by the garbage collector that's collecting a large  
amount of garbage !!


Il giorno 05/lug/07, alle ore 13:01, Alexis Pigeon ha scritto:

> I confirm the issue.
>
> Just try this on an existing S2 application :
>
> - add the field <s:password name="password"/>
> - add the proper getter and setter in the Action class
> - launch the app
> - in the added field, write %{password}
>
> -> in my case, the tomcat process is eating 100% of the cpu. no
> problem with memory consumption, though.
>
> Comments :
> - password can be replaced by any other string.
> - works with <s:textfield> tag too
>
> My config:
> Struts 2.0.8
> Xwork 2.0.3
> Tomcat 5.5.17
> Java 1.5
>
> I'm not familiar enough with JIRA to file an issue right now, but I'll
> do so later today if I find some time...
>
> On 05/07/07, Ing. Andrea Vettori <ma...@andreavettori.com> wrote:
>> Done.
>>
>> https://issues.apache.org/struts/browse/WW-2030
>>
>> I tried on two different struts application. Maybe others can try on
>> their app ???
>>
>> If it's not already addressed it's a very serious bug!
>>
>>
>> Il giorno 05/lug/07, alle ore 12:28, Antonio Petrelli ha scritto:
>>
>> > 2007/7/5, Ing. Andrea Vettori <ma...@andreavettori.com>:
>> >>
>> >> If the password field is named "password" and the password entered
>> >> value is %{password} than this loop is eating all memory...
>> >>
>> >> Don't think it's this to cause my problem BUT it's a  
>> potentially BIG
>> >> DOS problem !!!
>> >>
>> >> It work with every s:field I tried...
>> >
>> >
>> >
>> > Why don't you open a JIRA issue, attaching a sample application
>> > code that
>> > demonstrates the problem?
>> > If it's an XWork problem, then it will be verified and a new issue
>> > will be
>> > opened for XWork team by a Struts developer.
>> >
>> > Antonio
>>
>> --
>> Ing. Andrea Vettori
>> Consulente per l'Information Technology
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

--
Ing. Andrea Vettori
Consulente per l'Information Technology



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Found Denial Of Service (was [S2] App produces lot garbage IMPORTANT NEWS (I HOPE))

Posted by Alexis Pigeon <pi...@gmail.com>.
I confirm the issue.

Just try this on an existing S2 application :

- add the field <s:password name="password"/>
- add the proper getter and setter in the Action class
- launch the app
- in the added field, write %{password}

-> in my case, the tomcat process is eating 100% of the cpu. no
problem with memory consumption, though.

Comments :
- password can be replaced by any other string.
- works with <s:textfield> tag too

My config:
Struts 2.0.8
Xwork 2.0.3
Tomcat 5.5.17
Java 1.5

I'm not familiar enough with JIRA to file an issue right now, but I'll
do so later today if I find some time...

On 05/07/07, Ing. Andrea Vettori <ma...@andreavettori.com> wrote:
> Done.
>
> https://issues.apache.org/struts/browse/WW-2030
>
> I tried on two different struts application. Maybe others can try on
> their app ???
>
> If it's not already addressed it's a very serious bug!
>
>
> Il giorno 05/lug/07, alle ore 12:28, Antonio Petrelli ha scritto:
>
> > 2007/7/5, Ing. Andrea Vettori <ma...@andreavettori.com>:
> >>
> >> If the password field is named "password" and the password entered
> >> value is %{password} than this loop is eating all memory...
> >>
> >> Don't think it's this to cause my problem BUT it's a potentially BIG
> >> DOS problem !!!
> >>
> >> It work with every s:field I tried...
> >
> >
> >
> > Why don't you open a JIRA issue, attaching a sample application
> > code that
> > demonstrates the problem?
> > If it's an XWork problem, then it will be verified and a new issue
> > will be
> > opened for XWork team by a Struts developer.
> >
> > Antonio
>
> --
> Ing. Andrea Vettori
> Consulente per l'Information Technology
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Found Denial Of Service (was [S2] App produces lot garbage IMPORTANT NEWS (I HOPE))

Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/5, Ing. Andrea Vettori <ma...@andreavettori.com>:
>
> If it's not already addressed it's a very serious bug!



I agree. I started a thread in Struts Developers mailing list. If you're
willing to participate... :-)

http://www.nabble.com/-S2--Heads-Up%3A-possible-DOS-problem-tf4028994.html

Antonio

Re: Found Denial Of Service (was [S2] App produces lot garbage IMPORTANT NEWS (I HOPE))

Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
Done.

https://issues.apache.org/struts/browse/WW-2030

I tried on two different struts application. Maybe others can try on  
their app ???

If it's not already addressed it's a very serious bug!


Il giorno 05/lug/07, alle ore 12:28, Antonio Petrelli ha scritto:

> 2007/7/5, Ing. Andrea Vettori <ma...@andreavettori.com>:
>>
>> If the password field is named "password" and the password entered
>> value is %{password} than this loop is eating all memory...
>>
>> Don't think it's this to cause my problem BUT it's a potentially BIG
>> DOS problem !!!
>>
>> It work with every s:field I tried...
>
>
>
> Why don't you open a JIRA issue, attaching a sample application  
> code that
> demonstrates the problem?
> If it's an XWork problem, then it will be verified and a new issue  
> will be
> opened for XWork team by a Struts developer.
>
> Antonio

--
Ing. Andrea Vettori
Consulente per l'Information Technology



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Found Denial Of Service (was [S2] App produces lot garbage IMPORTANT NEWS (I HOPE))

Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/5, Ing. Andrea Vettori <ma...@andreavettori.com>:
>
> If the password field is named "password" and the password entered
> value is %{password} than this loop is eating all memory...
>
> Don't think it's this to cause my problem BUT it's a potentially BIG
> DOS problem !!!
>
> It work with every s:field I tried...



Why don't you open a JIRA issue, attaching a sample application code that
demonstrates the problem?
If it's an XWork problem, then it will be verified and a new issue will be
opened for XWork team by a Struts developer.

Antonio

Found Denial Of Service (was [S2] App produces lot garbage IMPORTANT NEWS (I HOPE))

Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
If the password field is named "password" and the password entered  
value is %{password} than this loop is eating all memory...

Don't think it's this to cause my problem BUT it's a potentially BIG  
DOS problem !!!

It work with every s:field I tried...



Il giorno 05/lug/07, alle ore 01:53, Ing. Andrea Vettori ha scritto:

> All the traces points me to this function on the xwork library
> Since it contains an infinte loop it's promising ;)
> Need to sleep now, I hope tomorrow to find someone else solution in  
> my inbox :)
>
> Thank you
>
>
>
>
>     public static Object translateVariables(char open, String  
> expression, ValueStack stack, Class asType, ParsedValueEvaluator  
> evaluator) {
>         // deal with the "pure" expressions first!
>         //expression = expression.trim();
>         Object result = expression;
>
>         while (true) {
>             int start = expression.indexOf(open + "{");
>             int length = expression.length();
>             int x = start + 2;
>             int end;
>             char c;
>             int count = 1;
>             while (start != -1 && x < length && count != 0) {
>                 c = expression.charAt(x++);
>                 if (c == '{') {
>                     count++;
>                 } else if (c == '}') {
>                     count--;
>                 }
>             }
>             end = x - 1;
>
>             if ((start != -1) && (end != -1) && (count == 0)) {
>                 String var = expression.substring(start + 2, end);
>
>                 Object o = stack.findValue(var, asType);
>                 if (evaluator != null) {
>                 	o = evaluator.evaluate(o);
>                 }
>
>
>                 String left = expression.substring(0, start);
>                 String right = expression.substring(end + 1);
>                 if (o != null) {
>                     if (TextUtils.stringSet(left)) {
>                         result = left + o;
>                     } else {
>                         result = o;
>                     }
>
>                     if (TextUtils.stringSet(right)) {
>                         result = result + right;
>                     }
>
>                     expression = left + o + right;
>                 } else {
>                     // the variable doesn't exist, so don't display  
> anything
>                     result = left + right;
>                     expression = left + right;
>                 }
>             } else {
>                 break;
>             }
>         }
>
>         return XWorkConverter.getInstance().convertValue 
> (stack.getContext(), result, asType);
>     }
>
>
>
> --
> Ing. Andrea Vettori
> Consulente per l'Information Technology
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

--
Ing. Andrea Vettori
Consulente per l'Information Technology



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] App produces lot garbage IMPORTANT NEWS (I HOPE)

Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
All the traces points me to this function on the xwork library
Since it contains an infinte loop it's promising ;)
Need to sleep now, I hope tomorrow to find someone else solution in  
my inbox :)

Thank you




     public static Object translateVariables(char open, String  
expression, ValueStack stack, Class asType, ParsedValueEvaluator  
evaluator) {
         // deal with the "pure" expressions first!
         //expression = expression.trim();
         Object result = expression;

         while (true) {
             int start = expression.indexOf(open + "{");
             int length = expression.length();
             int x = start + 2;
             int end;
             char c;
             int count = 1;
             while (start != -1 && x < length && count != 0) {
                 c = expression.charAt(x++);
                 if (c == '{') {
                     count++;
                 } else if (c == '}') {
                     count--;
                 }
             }
             end = x - 1;

             if ((start != -1) && (end != -1) && (count == 0)) {
                 String var = expression.substring(start + 2, end);

                 Object o = stack.findValue(var, asType);
                 if (evaluator != null) {
                 	o = evaluator.evaluate(o);
                 }


                 String left = expression.substring(0, start);
                 String right = expression.substring(end + 1);
                 if (o != null) {
                     if (TextUtils.stringSet(left)) {
                         result = left + o;
                     } else {
                         result = o;
                     }

                     if (TextUtils.stringSet(right)) {
                         result = result + right;
                     }

                     expression = left + o + right;
                 } else {
                     // the variable doesn't exist, so don't display  
anything
                     result = left + right;
                     expression = left + right;
                 }
             } else {
                 break;
             }
         }

         return XWorkConverter.getInstance().convertValue 
(stack.getContext(), result, asType);
     }



--
Ing. Andrea Vettori
Consulente per l'Information Technology



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org