-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
badly formed tree input causes out of memory crash #3
Comments
Seems to occur in file tree_reader.cpp, line 65: else if (nextChar == ';') { This is the only exit I can see. Should have a condition: if (nextChar == null) { Better yet, as we discussed, perhaps deal with the length of the tree string. int counter = 0; while (counter < (treeLength - 1)) { // iterate through the characters in the tree string |
Noticed the exact same code is in treemachine, despite being in java. Java doesn't do the infinite loop thing when a semicolon is missing, but crashes with informative error. |
For what it is worth, I patched this in treemachine: // pb is the newick tree string
if (pb.charAt(pb.length() - 1) != ';') {
System.out.println("Tree is invalid: missing concluding semicolon. Exiting.");
System.exit(1);
} |
look good. I will get this in treepl this weekend On Wed, Mar 13, 2013 at 4:11 PM, Joseph W. Brown
|
I've fixed this in a pull request I just sent. |
Okay, in pull request #9 |
thanks On Tue, Apr 15, 2014 at 8:07 AM, Joseph W. Brown
|
If the last tree in the input treefile is not followed by a semicolon, the program will apparently keep reading until it completely fills the memory of the computer. I have crashed my 48GB RAM desktop several times doing this.
The text was updated successfully, but these errors were encountered: