-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ACL : AclImpl.hashCode leads to StackOverflowError #5401
Labels
in: acl
An issue in spring-security-acl
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
May 7, 2019
neeleshs
added a commit
to neeleshs/spring-security-acl-mongodb
that referenced
this issue
May 24, 2019
@spring-issuemaster @gpoissonnier @leon @michaelpigg @mengelbrecht Hi All, what is the plan for #5401 to be merged and available for use. |
rwinch
added
in: acl
An issue in spring-security-acl
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
May 21, 2020
rwinch
pushed a commit
that referenced
this issue
May 21, 2020
Getting StackOverflowError when invoke AclImpl.hashCode because of cross-references between AclImpl and AccessControlEntryImpl Remove from AccessControlEntryImpl.hashCode method invocation of acl.hashCode fixes gh-5401
spring-projects-issues
added
the
status: backported
An issue that has been backported to maintenance branches
label
May 21, 2020
rwinch
pushed a commit
that referenced
this issue
May 21, 2020
Getting StackOverflowError when invoke AclImpl.hashCode because of cross-references between AclImpl and AccessControlEntryImpl Remove from AccessControlEntryImpl.hashCode method invocation of acl.hashCode fixes gh-5401
rwinch
pushed a commit
that referenced
this issue
May 21, 2020
Getting StackOverflowError when invoke AclImpl.hashCode because of cross-references between AclImpl and AccessControlEntryImpl Remove from AccessControlEntryImpl.hashCode method invocation of acl.hashCode fixes gh-5401
rwinch
pushed a commit
that referenced
this issue
May 21, 2020
Getting StackOverflowError when invoke AclImpl.hashCode because of cross-references between AclImpl and AccessControlEntryImpl Remove from AccessControlEntryImpl.hashCode method invocation of acl.hashCode fixes gh-5401
Thanks for the ping @udayrajluhar This is now merged into master and backported through 5.0.x See the list of issues above for details |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: acl
An issue in spring-security-acl
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Summary
When calling method AclImpl.hashCode, a java.lang.StackOverflowError is throw
Actual Behavior
A cross-reference exists between AccessControlEntryImpl.hashCode and AclImpl.hasCode. This cross-reference leads to an infinite recursive loop and then to a stack overflow.
AclImpl.hasCode uses hash code of field "aces". "aces" field type is List. And AccessControlEntryImpl.hashCode uses hash code of field "acl". "acl" field type is Acl. The cross-reference is between this 2 fields : AclImpl.aces and AccessControlEntryImpl.acl. "acl" field reference always his Acl object (see AclImpl.insertAce).
Expected Behavior
No cross-reference on AclImpl.hashCode call.
Configuration
Version
spring-security-acl:5.0.1
Sample
java.lang.StackOverflowError: null
at java.util.AbstractList.hashCode(AbstractList.java:541) ~[na:1.8.0_111]
at org.springframework.security.acls.domain.AclImpl.hashCode(AclImpl.java:351) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.security.acls.domain.AccessControlEntryImpl.hashCode(AccessControlEntryImpl.java:134) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at java.util.AbstractList.hashCode(AbstractList.java:541) ~[na:1.8.0_111]
at org.springframework.security.acls.domain.AclImpl.hashCode(AclImpl.java:351) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.security.acls.domain.AccessControlEntryImpl.hashCode(AccessControlEntryImpl.java:134) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at java.util.AbstractList.hashCode(AbstractList.java:541) ~[na:1.8.0_111]
at org.springframework.security.acls.domain.AclImpl.hashCode(AclImpl.java:351) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.security.acls.domain.AccessControlEntryImpl.hashCode(AccessControlEntryImpl.java:134) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at java.util.AbstractList.hashCode(AbstractList.java:541) ~[na:1.8.0_111]
at org.springframework.security.acls.domain.AclImpl.hashCode(AclImpl.java:351) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.security.acls.domain.AccessControlEntryImpl.hashCode(AccessControlEntryImpl.java:134) ~[spring-security-acl-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at java.util.AbstractList.hashCode(AbstractList.java:541) ~[na:1.8.0_111]
...
The text was updated successfully, but these errors were encountered: