This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 209992 - Stack overflow in CES of XML data object if defined CES redirector
Summary: Stack overflow in CES of XML data object if defined CES redirector
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.2
Hardware: All All
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks: 209745
  Show dependency tree
 
Reported: 2012-03-23 11:45 UTC by Alexander Simon
Modified: 2012-04-04 07:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test (4.39 KB, patch)
2012-03-23 11:48 UTC, Alexander Simon
Details | Diff
proposed fix (1.31 KB, patch)
2012-03-23 11:52 UTC, Alexander Simon
Details | Diff
Can't we just fix it in XML? (5.61 KB, patch)
2012-03-24 13:18 UTC, Jaroslav Tulach
Details | Diff
Added faster initialization (9.92 KB, patch)
2012-03-26 12:39 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2012-03-23 11:45:05 UTC
Root of stack overflow is calling virtual method in constructor of
org.netbeans.modules.xml.text.TextEditorSupport().
Comment 1 Alexander Simon 2012-03-23 11:48:04 UTC
Created attachment 117155 [details]
test
Comment 2 Alexander Simon 2012-03-23 11:52:24 UTC
Created attachment 117156 [details]
proposed fix
Comment 3 Jaroslav Tulach 2012-03-24 13:18:22 UTC
Created attachment 117190 [details]
Can't we just fix it in XML?
Comment 4 Svata Dedic 2012-03-26 11:53:47 UTC
Are you sure the patch works OK in all situations ? E.g. one can call lookup(EditorCookie.class).prepareDocument() on XMLDO, and we may end up with a CES that has never been set a MimeType; similarly for other API methods -- all of them would have to propagate setMimeType so the observed state of CES is not (that much) changed.
Comment 5 Svata Dedic 2012-03-26 12:39:33 UTC
Created attachment 117245 [details]
Added faster initialization

Note that hypothetical clients, which SUBCLASS TextEditorSupport will still suffer from MimeType not being set 'on time', unless the syncMimeType() is called from many API methods.
Comment 6 Svata Dedic 2012-03-28 06:33:37 UTC
Fixed in http://hg.netbeans.org/jet-main/rev/48d6314465ff
Comment 7 Vladimir Voskresensky 2012-03-29 10:35:27 UTC
Committed test is just failing with StackOverflowError as before, does it really work in your environment?
Comment 8 Svata Dedic 2012-03-29 10:59:04 UTC
Changeset: e96313ac0e70
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2012-03-29 12:59
Message:   Issue #209992 - Stack overflow in CES of XML data object if defined CES redirector: fixed
Wrong (old) patch applied; correcting.
Comment 9 Vladimir Voskresensky 2012-03-29 11:32:22 UTC
Thanks. Btw, do you understand why 100% failed test was not run in any hudson jobs? May be module is excluded from testing?
Comment 10 Alexander Simon 2012-04-02 08:13:02 UTC
Reproduced on html data objects.
Stack:
	at org.netbeans.modules.cnd.cesredirector.CESRedirectorImpl.redirect(CESRedirectorImpl.java:119)
	at org.openide.text.CloneableEditorSupportRedirector.findRedirect(CloneableEditorSupportRedirector.java:61)
	at org.openide.text.CloneableEditorSupport.setMIMEType(CloneableEditorSupport.java:1560)
	at org.netbeans.modules.html.HtmlEditorSupport.<init>(HtmlEditorSupport.java:120)
	at org.netbeans.modules.html.HtmlDataObject.getHtmlEditorSupport(HtmlDataObject.java:195)
	at org.netbeans.modules.html.HtmlDataObject.createCookie(HtmlDataObject.java:185)
	at org.openide.nodes.CookieSet$CookieEntry.getCookie(CookieSet.java:601)
	at org.openide.nodes.CookieSet$C.convert(CookieSet.java:784)
	at org.openide.nodes.CookieSet$C.convert(CookieSet.java:779)
	at org.openide.nodes.CookieSetLkp$ConvertingItem.getInstance(CookieSetLkp.java:277)
	at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:421)
	at org.netbeans.modules.cnd.cesredirector.CESRedirectorImpl.redirect(CESRedirectorImpl.java:119)
	at org.openide.text.CloneableEditorSupportRedirector.findRedirect(CloneableEditorSupportRedirector.java:61)
Comment 11 Vladimir Voskresensky 2012-04-02 09:09:45 UTC
Sasha, shouldn't it be the new P1?
Comment 12 Alexander Simon 2012-04-02 13:09:13 UTC
(In reply to comment #11)
> Sasha, shouldn't it be the new P1?
Created separate bug #210541.
Comment 13 Quality Engineering 2012-04-02 15:55:00 UTC
Integrated into 'main-golden', will be available in build *201204021038* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e96313ac0e70
User: Svata Dedic <sdedic@netbeans.org>
Log: Issue #209992 - Stack overflow in CES of XML data object if defined CES redirector: fixed
Wrong (old) patch applied; correcting.
Comment 14 Jaroslav Tulach 2012-04-04 07:37:36 UTC
I will try to fix it in a general way as part of fix for bug 210541