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

Race-time condition from core layouts.cfm #1194

Open
timsayshey opened this issue Sep 24, 2022 · 8 comments
Open

Race-time condition from core layouts.cfm #1194

timsayshey opened this issue Sep 24, 2022 · 8 comments

Comments

@timsayshey
Copy link

Describe the bug
Unfortunately, this is a race-time condition coming from CFWheels, and I am unable to reproduce it. It happens in production on rare occasion.

It is triggered when I called usesLayout from my controller:
usesLayout("/layouts/blank");

Any idea how this error would be possible by looking at the framework code?
wheels/controller/layouts.cfm:46

Environment

  • Ubuntu Server
  • Lucee 5.3.9
  • CFWheels 2.4.0

Error:

Error: 
Array index [4] out of range, array size is [3]

Location: 
wheels/controller/layouts.cfm:46
controllers/MyController.cfc:10
wheels/global/cfml.cfm:160
wheels/controller/processing.cfm:164
wheels/global/cfml.cfm:160
wheels/global/cfml.cfm:13
wheels/controller/processing.cfm:86
wheels/dispatch/functions.cfm:199
wheels/index.cfm:6
index.cfm:2
wheels/events/onrequest.cfm:4
@timsayshey
Copy link
Author

timsayshey commented Sep 26, 2022

layouts.cfm hadn't been changed in years until the syntax updates ticket that @chapmandu worked on.

I reverted back the syntax updates, I can't imagine how that would cause this bug but so far I haven't seen the error again so that's promising. I just have no idea how these changes would cause this issue.

Here's the commit I reverted back from:
7dabfd4

@timsayshey
Copy link
Author

Nevermind, it's back 🤦🏻‍♂️

@timsayshey
Copy link
Author

@neokoenig Any ideas? Is it possible the array could be modified somewhere else concurrently which would account for why CF counts 4 items in the array on one line then on the next only counts 3?

@neokoenig
Copy link
Contributor

@neokoenig Any ideas? Is it possible the array could be modified somewhere else concurrently which would account for why CF counts 4 items in the array on one line then on the next only counts 3?

Not off the top of my head, but just wondering if it is actually a "blank" layout, then you could use usesLayout(false)? (might not be of course)

@timsayshey
Copy link
Author

Thanks Tom! Fortunately, the layout file is actually blank. It just has <cfoutput>#includeContent()#</cfoutput>.

Just updated the code in prod, praying that fixes it 🙏

@timsayshey
Copy link
Author

@neokoenig Ugh - Similar to the last error, except now it's saying Array index [5] out of range, array size is [4]

If you look at the code, this error should not be possible. Any other ideas?

@timsayshey
Copy link
Author

I'm going to try changing the way we loop over the layouts array. Maybe that'll help:

image

@zainforbjs
Copy link
Contributor

@timsayshey Is this issue fixed?

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