Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qute: StackOverflowError due to nested #include and #insert directives #41451

Closed
gbourant opened this issue Jun 26, 2024 · 2 comments · Fixed by #41517
Closed

Qute: StackOverflowError due to nested #include and #insert directives #41451

gbourant opened this issue Jun 26, 2024 · 2 comments · Fixed by #41517
Assignees
Labels
area/qute The template engine kind/bug Something isn't working
Milestone

Comments

@gbourant
Copy link

Describe the bug

I have the following templates and i get a StackOverflowError. This happens because the login.html include the auth.html template
and the auth.html template includes the root.html which both have a default {#insert/}.

In order to fix this i can use a named insert, but i'm just wondering if this is a bug worth mentioning or it is intended to be used in that way.

root.html

<html>
<body>{#insert /}</body>
</html>

auth.html

{#include root.html}
    <div>
        {#insert/}
    </div>
{/include}

login.html

{#include auth.html}
    <form>Login Form</form>
{/include}

So in order to fix this change the {#insert/} of auth.html to {#insert main /} and in templates login.html use it {#main}

auth.html

{#include root.html}
    <div>
        {#insert main/}
    </div>
{/include}

login.html

{#include auth.html}
    {#main}<form>Login Form</form>{/}
{/include}
ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /hello failed, error id: 11b07391-60d2-46dd-8c66-d320e7678346-3: java.lang.StackOverflowError
	at io.quarkus.runtime.logging.LogCleanupFilter.isLoggable(LogCleanupFilter.java:32)
	at java.logging/java.util.logging.Handler.isLoggable(Handler.java:443)
	at org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:87)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:438)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:480)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:480)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:480)
	at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:480)
	at org.jboss.logmanager.Logger.logRaw(Logger.java:1089)
	at org.jboss.logmanager.Logger.log(Logger.java:1052)
	at org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:56)
	at org.jboss.logging.Logger.tracef(Logger.java:303)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:47)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58)
	at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:228)
	at io.quarkus.qute.InsertSectionHelper.resolve(InsertSectionHelper.java:20)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:48)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58)
	at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:228)
	at io.quarkus.qute.InsertSectionHelper.resolve(InsertSectionHelper.java:20)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:48)
	at io.quarkus.qute.SectionNode.resolve(SectionNode.java:58)
	at io.quarkus.qute.SectionNode$SectionResolutionContextImpl.execute(SectionNode.java:228)
	at io.quarkus.qute.InsertSectionHelper.resolve(InsertSectionHelper.java:20)

reproducer

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@gbourant gbourant added the kind/bug Something isn't working label Jun 26, 2024
@geoand geoand added area/qute The template engine and removed triage/needs-triage labels Jun 26, 2024
Copy link

quarkus-bot bot commented Jun 26, 2024

/cc @mkouba (qute)

@mkouba mkouba changed the title StackOverflowError due to nested #include and #insert directives Qute: StackOverflowError due to nested #include and #insert directives Jun 26, 2024
@mkouba mkouba self-assigned this Jun 26, 2024
@ia3andy
Copy link
Contributor

ia3andy commented Jun 26, 2024

qute-inheritance-issue.zip

Funny I found the same issue today :) reproducer 👆

mkouba added a commit to mkouba/quarkus that referenced this issue Jun 27, 2024
mkouba added a commit to mkouba/quarkus that referenced this issue Jun 27, 2024
mkouba added a commit to mkouba/quarkus that referenced this issue Jun 28, 2024
@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jun 28, 2024
@gsmet gsmet modified the milestones: 3.13 - main, 3.12.1 Jul 1, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 1, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
@gsmet gsmet modified the milestones: 3.12.1, 3.8.6 Aug 14, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Aug 14, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants