[Building Sakai] Has anyone seen this Stack Overflow in Lessons?

Niebel, William D. (Bill) (wdn5e) wdn5e at eservices.virginia.edu
Fri Sep 5 07:22:23 PDT 2014


The condition for stack overflow here is that a contained item is a reference to the container itself or a parent container -- nested directly or recursively.
(There's a cycle in the data that drives this error.)
There's probably not a use case for that data cycle in Lessons, and the data self-reference wasn't intended.
It looks like it would work correctly whenever there's not such a circular reference, which would be usual.

There could be other places in the code vulnerable to stack overflow for this.
So, it would be better to not allow the circular data structure to ever be created,
instead of fixing only this code narrowly.

________________________________
From: sakai-dev-bounces at collab.sakaiproject.org [sakai-dev-bounces at collab.sakaiproject.org] on behalf of Bryan Holladay [holladay at longsight.com]
Sent: Friday, September 05, 2014 9:16 AM
To: Sakai Development (sakai-dev at collab.sakaiproject.org)
Subject: [Building Sakai] Has anyone seen this Stack Overflow in Lessons?

I just filed a jira https://jira.sakaiproject.org/browse/LSNBLDR-421 and was wondering if anyone has seen this Stack Overflow and if there's a fix out there.

I compared 10.x to trunk and there were no differences for tool/src/java/org/sakaiproject/lessonbuildertool/service/LessonsAccess.java

Looking at the code, I don't see how it can ever not be a StackOverflow:

...

Set<Path> getPagePaths(long pageId, Set<Long>seen) {

...

items = dao.findPageItemsBySakaiId(Long.toString(pageId));

...

for (SimplePageItem item: items) {

...

Set<Path> paths = getPagePaths(item.getPageId(), seen);

...

}


Thanks,

Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140905/7624d765/attachment.html 


More information about the sakai-dev mailing list