<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:43 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETCONF-713] Stackoverflow in sal-rest-docgen</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-713</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;When schema contains yang model that defines particular regexp, apidoc explorer is not able to list resource definition and throw java.lang.StackOverflowError&lt;/p&gt;

&lt;p&gt;It was tracked down that this happen when we have list of containers with string leaf restricted by following regexp:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
typedef module-name {
   reference &lt;span class=&quot;code-quote&quot;&gt;&quot;RFC 6020: YANG - A Data Modelling Language Section 5.2. File Layout&quot;&lt;/span&gt;;
   type string {
     pattern &lt;span class=&quot;code-quote&quot;&gt;&apos;[a-zA-Z_][a-zA-Z0-9\-_.]*(@\d{4}-\d{2}-\d{2})?&apos;&lt;/span&gt;;
   }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Here is excerpt from stacktrace (shortened to relevant part)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Caused by: java.lang.StackOverflowError
 at java.util.HashMap$HashIterator.&amp;lt;init&amp;gt;(HashMap.java:1475) ~[?:?]
 at java.util.HashMap$KeyIterator.&amp;lt;init&amp;gt;(HashMap.java:1514) ~[?:?]
 at java.util.HashMap$KeySet.iterator(HashMap.java:912) ~[?:?]
 at java.util.HashSet.iterator(HashSet.java:173) ~[?:?]
 at java.util.AbstractCollection.toArray(AbstractCollection.java:184) ~[?:?]
 at dk.brics.automaton.State.getSortedTransitionArray(State.java:136) ~[?:?]
 at dk.brics.automaton.State.getSortedTransitions(State.java:147) ~[?:?]
 at com.mifmif.common.regex.Generex.prepareRandom(Generex.java:340) ~[?:?]
 at com.mifmif.common.regex.Generex.prepareRandom(Generex.java:366) ~[?:?]
 at com.mifmif.common.regex.Generex.prepareRandom(Generex.java:366) ~[?:?]
 at com.mifmif.common.regex.Generex.prepareRandom(Generex.java:366) ~[?:?]
 at com.mifmif.common.regex.Generex.prepareRandom(Generex.java:366) ~[?:?]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="33077">NETCONF-713</key>
            <summary>Stackoverflow in sal-rest-docgen</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="SamoSchneider">Samuel Schneider</assignee>
                                    <reporter username="rkosegi">Richard Kosegi</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Tue, 21 Jul 2020 16:14:50 +0000</created>
                <updated>Mon, 28 Mar 2022 21:11:17 +0000</updated>
                            <resolved>Fri, 25 Mar 2022 07:32:14 +0000</resolved>
                                    <version>Magnesium SR1</version>
                    <version>Aluminium</version>
                                    <fixVersion>3.0.0</fixVersion>
                    <fixVersion>2.0.15</fixVersion>
                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="68460" author="rkosegi" created="Tue, 21 Jul 2020 16:19:11 +0000"  >&lt;p&gt;Maybe related &lt;a href=&quot;https://github.com/mifmif/Generex/issues/21&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex/issues/21&lt;/a&gt; &lt;a href=&quot;https://github.com/mifmif/Generex/issues/26&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex/issues/26&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="70193" author="rovarga" created="Wed, 24 Nov 2021 09:19:04 +0000"  >&lt;p&gt;Based on steps to reproduce and the Generex issues, some more exploration is needed.&lt;/p&gt;

&lt;p&gt;Specifically we need to see if we can leverage &lt;a href=&quot;https://github.com/mifmif/Generex/issues/22&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex/issues/22&lt;/a&gt; to solve this.&lt;/p&gt;</comment>
                            <comment id="70617" author="ivanhrasko" created="Thu, 3 Mar 2022 12:16:22 +0000"  >&lt;p&gt;[generex|&lt;a href=&quot;https://github.com/mifmif/Generex&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex&lt;/a&gt;] looks to be not supported for over 5 years. We know that in the background it uses [link automaton| &lt;a href=&quot;https://github.com/cs-au-dk/dk.brics.automaton&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/cs-au-dk/dk.brics.automaton&lt;/a&gt;]. Automaton looks to require @ to be escaped...&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mifmif/Generex/issues/22&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex/issues/22&#160;&lt;/a&gt;implementation looks to be not complete: &lt;a href=&quot;https://github.com/mifmif/Generex/pull/48&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex/pull/48&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can we remove generex, escape @ and similar characters and use automaton directly?&lt;/p&gt;</comment>
                            <comment id="70619" author="rovarga" created="Thu, 3 Mar 2022 12:31:00 +0000"  >&lt;p&gt;Sure, whatever as long as the functionality works &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="70644" author="ivanhrasko" created="Thu, 17 Mar 2022 08:19:19 +0000"  >&lt;p&gt;OK, I have changed my mind. Update/change of library is&#160; probably work for another task - lets stay wit what we have for now.&lt;/p&gt;</comment>
                            <comment id="70645" author="ivanhrasko" created="Thu, 17 Mar 2022 08:20:31 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=SamoSchneider&quot; class=&quot;user-hover&quot; rel=&quot;SamoSchneider&quot;&gt;SamoSchneider&lt;/a&gt; can you please explain why we cannot use: &lt;a href=&quot;https://github.com/mifmif/Generex/issues/22&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex/issues/22&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="70646" author="JIRAUSER14508" created="Thu, 17 Mar 2022 09:43:49 +0000"  >&lt;p&gt;We can, but it does not make solution simpler.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mifmif/Generex/issues/22&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex/issues/22&lt;/a&gt; just provide possibility to escape some parts of regex from generation without need to escape each special character one by one.&lt;/p&gt;

&lt;p&gt;It escapes &lt;b&gt;all&lt;/b&gt; special characters which is not desired. We&#160; would still need to denote only characters which are problematic with \Q\E quotation.&lt;/p&gt;

&lt;p&gt;I think escaping them directly is simpler.&lt;/p&gt;</comment>
                            <comment id="70652" author="JIRAUSER14508" created="Mon, 21 Mar 2022 10:33:51 +0000"  >&lt;p&gt;This particular issue is caused by &apos;@&apos; being spacial character of [link automaton| &lt;a href=&quot;https://github.com/cs-au-dk/dk.brics.automaton&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/cs-au-dk/dk.brics.automaton&lt;/a&gt;] used by [generex|&lt;a href=&quot;https://github.com/mifmif/Generex&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mifmif/Generex&lt;/a&gt;]. My patch solve this by escaping this character with other character considered special by Automaton.&lt;/p&gt;

&lt;p&gt;Another part of this issue is that Generex ends with StackOverflowError when generating string for some regexes (contains .* or some &lt;span class=&quot;error&quot;&gt;&amp;#91;negative set&amp;#93;&lt;/span&gt;* and maybe more). &lt;br/&gt;
 For Automaton &apos;@&apos; is any string, so string (incorrect one) should be generated even if &apos;@&apos; is not escaped. &lt;br/&gt;
 This issue can be also reproduced by replacing &apos;@&apos; with &apos;.*&apos;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;pattern &apos;[a-zA-Z_][a-zA-Z0-9\-_.]*(.*\d\{4}-\d\{2}-\d\{2})?&apos;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; I think this is caused by bug in Generex and my patch does not solve this.&lt;font color=&quot;&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;font color=&quot;#172b4d&quot;&gt;&lt;/font&gt;Also when working on this issue I found cases of incorrect string being generated because Generex or I think used Automaton not recognizing some rules of regular expression.&lt;br/&gt;
 Main problem being: non-capturing group &apos;(?:ABC)&apos; added by RegexUtils.getJavaRegexFromXSD. I found &apos;\n&apos;,&apos;\t&apos; and more also not working.&lt;br/&gt;
 This is also conected to &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-887&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.opendaylight.org/browse/YANGTOOLS-887&lt;/a&gt; because to generate correct string we would need something like XSD -&amp;gt; Java -&amp;gt; automaton regex translator.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="17022" name="[NETCONF-713] Steps to reproduce.rtf" size="4174003" author="ivanm1996" created="Wed, 24 Nov 2021 09:01:17 +0000"/>
                            <attachment id="17023" name="[NETCONF-713]karaf.log.txt" size="1154710" author="ivanm1996" created="Wed, 24 Nov 2021 09:01:03 +0000"/>
                            <attachment id="17025" name="regexp-module.yang" size="531" author="ivanm1996" created="Wed, 24 Nov 2021 09:00:58 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03twf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>