Issues

Select view

Select search mode

 

Regression in struct implementation causing stack overflow

Fixed

Description

In Lucee version 5.3.3.54 and following, the struct implementation was changed resulting in the following code causing a stack overflow:

This code causes a stack overflow at:

While it is understandable why this causes the overflow at the `hashCode()` method, it did not in prior versions of Lucee and does not in ACF 2018.

For reference this code more closely approximates how I encountered it:

Environment

None

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 28 November 2019 at 19:29
Updated 8 May 2020 at 18:52
Resolved 9 December 2019 at 14:55

Activity

Show:

John Berquist5 December 2019 at 16:20

: actually pointed LDEV-2479 out to me on Slack, I am really sorry I missed that earlier ticket - it did in fact solve my issue. I didn’t realize it because it hasn’t made it into a stable release yet. I created the test case above trying to figure out exactly what was causing my issue and apparently bumped into something else. I do appreciate the quick fix.

Michael Offner5 December 2019 at 14:07

see

Michael Offner5 December 2019 at 14:04
Edited

does this fix solves your problem? i was able to reproduce and solve the issue with equals and the issue with hashcode was already solved in an earlier version.

John Berquist3 December 2019 at 18:35

I have a component that computes function names and ranges for CFML source files: (So that for exceptions that report a tag context array I can get the names of the CFML functions being executed from the source files and line numbers given). In order to do that I build a tree of parent and child structs tracking ranges in the source file - where the child structs have a reference their parent structs and the parents have arrays of child structs. At a particular point I needed the index of a child struct in its parent struct's array of child ranges. So I used var idx = func.parent.children.find( func ); That stopped working after the recent struct implementation updates.

Michael Offner2 December 2019 at 21:36

Flag notifications