[Django] #35120: Stack overflow in render method when many instances of included template

9 views
Skip to first unread message

Django

unread,
Jan 16, 2024, 9:35:24 PM1/16/24
to django-...@googlegroups.com
#35120: Stack overflow in render method when many instances of included template
-------------------------------------+-------------------------------------
Reporter: Morgan10E | Owner: nobody
Type: Bug | Status: new
Component: Template | Version: 4.1
system | Keywords: render template
Severity: Normal | include
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
To reproduce behavior:
1. Create a base template
2. Create a template to include. It does not matter what the contents are
3. Force included template to be included thousands of times
4. See "error_no_response" on client

On the server, we were able to observe through print statements that
everything up to the render call was executing as expected. However, there
was no error to indicate what might be going wrong. We narrowed down the
likely culprit to stack overflow via the following observations:
1. If you put the contents of the included template directly in the base
template, the issue does not occur and the page renders as expected
2. If you reduce the number of instances of the include, the issue does
not occur and the page renders as expected

The desired behavior would be to at least surface some type of actionable
error message.

--
Ticket URL: <https://code.djangoproject.com/ticket/35120>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 16, 2024, 11:27:34 PM1/16/24
to django-...@googlegroups.com
#35120: Stack overflow in render method when many instances of included template
-------------------------------------+-------------------------------------
Reporter: Morgan10E | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 4.1
Severity: Normal | Resolution: needsinfo
Keywords: render template | Triage Stage:
include | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => needsinfo


Comment:

Hi, I don't think you've explained the issue in enough detail to confirm a
bug in Django. Please reopen the ticket if you can debug your issue and
provide details about why and where Django is at fault. A sample project
that reproduces the issue may also be helpful.

> 3. Force included template to be included thousands of times

Are you doing experiments? or this is a real-life scenario.

--
Ticket URL: <https://code.djangoproject.com/ticket/35120#comment:1>

Reply all
Reply to author
Forward
0 new messages