You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Inaiat Henrique de Moraes (JIRA)" <ji...@apache.org> on 2012/04/24 05:00:35 UTC

[jira] [Created] (WICKET-4511) Stack overflow when render malformed html.

Inaiat Henrique de Moraes created WICKET-4511:
-------------------------------------------------

             Summary: Stack overflow when render malformed html.
                 Key: WICKET-4511
                 URL: https://issues.apache.org/jira/browse/WICKET-4511
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.5
         Environment: windows, ubuntu. java 7, jetty 6.1.26
            Reporter: Inaiat Henrique de Moraes


Stack overflow when render malformed html.

Please, note that </HEAD> element is inserted after </body>.

HTML:
<html>
<head>
<body>
Malformed HTML
</body>
</head>
</html>

Java:
package com.mycompany;

import org.apache.wicket.markup.html.WebPage;
public class Test1 extends WebPage {
	private static final long serialVersionUID = -4267477971499123852L;

}


Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4511.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0-RC1
                   1.5.6

Thanks again, Andrea!
                
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0-RC1
>
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262679#comment-13262679 ] 

Andrea Del Bene commented on WICKET-4511:
-----------------------------------------

Yes, of course! I think should be ready by tomorrow.
PS: Soon or later I will use IRC to speed up communication :)
                
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263172#comment-13263172 ] 

Andrea Del Bene commented on WICKET-4511:
-----------------------------------------

Here it is. Now HtmlHeaderSectionHandler throws a MarkupException if it finds a <body> inside <head>. I've also added a test case for this issue.
                
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-4511:
---------------------------------------

    Assignee: Martin Grigorov
    
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>            Assignee: Martin Grigorov
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Inaiat Henrique de Moraes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Inaiat Henrique de Moraes updated WICKET-4511:
----------------------------------------------

    Attachment: console-output.txt

Console output.
                
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Del Bene updated WICKET-4511:
------------------------------------

    Attachment:     (was: WICKET-4511.patch)
    
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262645#comment-13262645 ] 

Martin Grigorov commented on WICKET-4511:
-----------------------------------------

Thanks for the investigation and the patch, Andrea!

I think we should extend HtmlHeaderSectionHandler to throw an exception if it sees <head> and <body> without </head> in between.
Now the attached quickstart fails with StackOverflowError - not good at all but the developer goes to find what is wrong and fixes his code. 
With your fix Wicket behaves better and the developer is not notified about this problem.
Wicket is not HTML validator but since <head> and <wicket:head> are more special I think we can add some more 'if's in this code to prevent such problem.

Do you want to implement it and add a test ? :-)   
                
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Del Bene updated WICKET-4511:
------------------------------------

    Attachment: WICKET-4511.patch
    
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262630#comment-13262630 ] 

Andrea Del Bene commented on WICKET-4511:
-----------------------------------------

The problem is due to HtmlHeaderSectionHandler which does not identify <head> tag properly. If you look at method onComponentTag you see that variable foundHead is set to true only when closing tag </head> is encountered and not when we find the opening one.
I've attached a patch which slightly changes the behavior of  HtmlHeaderSectionHandler and solve the issue. I've tested it with all test cases without any problem. 
                
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4511) Stack overflow when render malformed html.

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Del Bene updated WICKET-4511:
------------------------------------

    Attachment: WICKET-4511.patch
    
> Stack overflow when render malformed html.
> ------------------------------------------
>
>                 Key: WICKET-4511
>                 URL: https://issues.apache.org/jira/browse/WICKET-4511
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: windows, ubuntu. java 7, jetty 6.1.26
>            Reporter: Inaiat Henrique de Moraes
>         Attachments: WICKET-4511.patch, console-output.txt
>
>
> Stack overflow when render malformed html.
> Please, note that </HEAD> element is inserted after </body>.
> HTML:
> <html>
> <head>
> <body>
> Malformed HTML
> </body>
> </head>
> </html>
> Java:
> package com.mycompany;
> import org.apache.wicket.markup.html.WebPage;
> public class Test1 extends WebPage {
> 	private static final long serialVersionUID = -4267477971499123852L;
> }
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira