Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Component-SS7 Roadmap-Fix
New issue 337 by asimil...@gmail.com: RuleComparator bug - Infinite loop -
java.lang.StackOverflowError
https://code.google.com/p/jss7/issues/detail?id=337
What steps will reproduce the problem?
1. Add two SccpAddresses with similar patterns like "1/????" and "2/????".
2. Number of the "?" must be equal after separator "/"
What is the expected output? What do you see instead?
Expected: Rule added.
Instead: java.lang.StackOverflowError.
What version of the product are you using? On what operating system?
jSS7 2.1.0.FINAL, Windows 8.1 x64
Please provide any additional information below.
Stack trace:
Exception in thread "main" java.lang.StackOverflowError
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:135)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
at
org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator.compareQuestionMarksIndex(RuleComparator.java:144)
Found cause in method:
private int compareQuestionMarksIndex(String digits1, int fromIndex1,
String digits2, int fromIndex2){
...
// Keep comparing occurrence of "?" till difference is
reached
line 144: compareQuestionMarksIndex(digits1, index1, digits2,
index2);
Solution is to change it to:
// Keep comparing occurrence of "?" till difference is reached
compareQuestionMarksIndex(digits1, index1 + 1, digits2, index2
+ 1);
Because:
int index1 = digits1.indexOf(WILDCARD_SINGLE, fromIndex1);
int index2 = digits2.indexOf(WILDCARD_SINGLE, fromIndex2);
will produce the same indexes:
index1 = fromIndex1
and
index2 = fromIndex2
and call of the compareQuestionMarksIndex will enter in infinite loop -
compareQuestionMarksIndex will be called with the same index values.
After correction no exception is thrown and rule is successfully added.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
---
You received this message because you are subscribed to the Google Groups "mobicents-all-issues-changes" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to mobicents-all-issues-changes+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.