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

SystemStackError when using partial in the layout haml #2273

Open
synek317 opened this issue Apr 24, 2023 · 5 comments
Open

SystemStackError when using partial in the layout haml #2273

synek317 opened this issue Apr 24, 2023 · 5 comments

Comments

@synek317
Copy link

Do you want to request a feature or report a bug?

It might be a bug or my wrong configuration that I'm not aware of

What is the current behavior?

I have a very simple layout file 'application.haml':

!!! 5
%html
%head
%body
= partial 'partials/foo'
= yield

the partials/_foo.haml is an empty file.
I get an infinite recursion error that eventually ends with SystemStackError.

I have tried all kind of weird things, like passing layout: false or :layout => false to the = partial line. I also tried to switch to = haml :'partials/_foo', layout: false and a lot of other things I don't remember now. None worked.

If the current behavior is a bug, please provide the steps to reproduce it and if possible a minimal demo of the problem via https://github.com/ or https://gist.github.com/

What is the expected behavior?

I would expect it to just work.

Which versions of Ruby, Padrino, Sinatra, Rack, OS are you using? Did this work in previous versions?

Ruby 2.7 (via official docker image, which uses Debian 11), Padrino 0.15.3, Sinatra 3.0.6, Rack 2.2.6.4

@nesquena
Copy link
Member

nesquena commented May 1, 2023

Thanks for the report - @jkowens Any idea what might be happening here?

@jkowens
Copy link
Collaborator

jkowens commented May 1, 2023

Hey @nesquena, no I'm not sure why this would be creating an infinite loop. @synek317 can you push up a basic sample app that demonstrates this issue?

@synek317
Copy link
Author

synek317 commented May 2, 2023

@jkowens honestly speaking, it might be pretty hard. I've been experiencing this issue in a pretty huge, closed-source application. In another one, where the versions of mentioned crates were the same, all worked well.

I spend 2 days on investigations, then a friend of mine invented a workaround that didn't use this part of the application.

@jkowens
Copy link
Collaborator

jkowens commented May 2, 2023

@synek317 just to confirm, if you removed the partial from the application.haml layout file, the SystemStackError went away?

@synek317
Copy link
Author

synek317 commented May 2, 2023

@jkowens yes, exactly. I double- and triple-checked it, it was 100% reproducible, I'm also 100% sure there were no other changes. The partial file content was irrelevant, I experimented with an empty file.

Maybe it could be an issue with some specific versions of some nested dependencies? I worked with other Padrino applications too with the same Padrino and Sinatra versions and didn't experience similar issues.

Since I managed to workaround it and I cannot provide you a good example, feel free to just close this issue as impossible to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants