Community
Participate
Working Groups
Created attachment 111400 [details] Testcase Build ID: I20080617-2000 Hi, Again found a regression with the Schema validation, causing a stack error. Probably related to bug 238550? Of the attached test case, open test.xml in the editor, and click somewhere in the table’s body. You will receive the following error: Unhandled event loop exception java.lang.StackOverflowError Also once I received the following error (but have not been able to find steps to reproduce it): Refreshing outline has encountered an error: Error ~Grauw
Created attachment 111632 [details] patch to prevent stack overflow This patch adds a stack to XSDVistor#visitParticle to prevent stack overflows caused by recursive schema definitions. An example of this from the provided XSDs is: <xs:group name="xhtml.table.content"> <xs:sequence> <xs:choice> <xs:group ref="xhtml.table.content"/> <xs:any namespace="##other" processContents="lax"/> </xs:choice> </xs:sequence> </xs:group>
After talking with Keith briefly, I'm assigning this to him for further investigation.
Is it really recursive? The example given is part of a redefinition, so the xs:group inside the group actually refers to another xs:group defined in xhtml11-modules-1.xsd...
Created attachment 111985 [details] Updated patch
Added updated patch. Plugins changed: org.eclipse.wst.xsd.core and org.eclipse.wst.xml.core. This patch should also fix content assist, (Ctrl-space in the Source view, or bring up context menu in the Design view), which also resulted in a stack overflow. Laurens, can you please apply the patch and verify it fixes your problem? It's a redefine of the group, however, the XSD model resolves the group to be the one associated with the redefine element, which results in the circular behaviour. (isCircular returns true). Note that the XSD model has many problems with XSD redefines. Generally, their use should be avoided. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=83055 and associated bugs that are dup'ed to this.
(In reply to comment #5) > Laurens, can you please apply the patch and verify it fixes your problem? I don’t have the source code or a compilation environment for the source code set up. If you can point me to a nightly build though I would be happy to try it out. > Note that the XSD model has many problems with XSD redefines. Generally, their > use should be avoided. I’m just using the XHTML Modularisation standard’s schemas in the way they are intended to be used (well, somewhat)... :) ~Grauw
I'm reading bugs closely now that there's only 2 days left, and couldn't see how this was a "cricital" problem: "crashes, loss of data, severe memory leak". It does sound like a major problem for sure, and I'd like to get the patches applied as soon as 3.0.2 is released (like, in one week). Let me know if I am mis-ready the bug somehow and it does result in crashes or data loss.
Created attachment 112573 [details] Updated patch Updated patch to push stack check up to the base classes CMVisitor and XSDVisitor.
Created attachment 112574 [details] Apply to org.eclipse.wst.xsd.core.tests Added some JUnit tests
fix looked good to me.
Fix released to 3.0.3. (M-3.0.3-20081002060554)
Verified fixed in the 3.0.3 release.
Closing.