question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Do Parsing Errors cause ASTRAL to quit with a non-zero exit code?

See original GitHub issue

Similar or related to https://github.com/smirarab/ASTRAL/issues/19 or https://github.com/smirarab/ASTRAL/issues/16

When I run ASTRAL-MP and there is a parsing error, e.g.

================== ASTRAL ===================== 

This is ASTRAL version 5.15.1
Using native AVX batch computing.
Gene trees are treated as unrooted
There are 8 threads used to run.
Exception in thread "main" java.lang.RuntimeException: Failed to Parse Tree number: 1
	at phylonet.coalescent.CommandLine.readInputTrees(CommandLine.java:750)
	at phylonet.coalescent.CommandLine.readOptions(CommandLine.java:369)
	at phylonet.coalescent.CommandLine.main(CommandLine.java:517)
Caused by: phylonet.tree.io.ParseException: ')' expected
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:405)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399)
	at phylonet.tree.io.NewickReader.readTree(NewickReader.java:374)
	at phylonet.tree.io.NewickReader.readTree(NewickReader.java:95)
	at phylonet.coalescent.CommandLine.readInputTrees(CommandLine.java:717)
	... 2 more

the process does not seem to fail/exit automatically. This is true for me from the BASH shell (terminal program on Mac OS X), running it via the shell via the ! symbol in an IPython cell in a Jupyter notebook, or calling it via Python’s os.system function – the process just hangs indefinitely and does not exit by itself.

This is admittedly not a big deal, especially when ASTRAL is being used interactively. It is more inconvenient when ASTRAL is being run multiple times inside of a script (as I am currently doing), because when ASTRAL fails with a parse error the script keeps running indefinitely, and the only tipoff (if I don’t actively monitor the contents of all of the log files piped from STDERR) that something is amiss is that the fans on my laptop don’t start running.

Please let me know whether I should clarify anything because I feel like I did not succeed in describing the situation as clearly as I would have liked

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
smirarabcommented, Dec 28, 2020

ef5518cI was able to reproduce with ASTRAL-MP (5.15.1) but not using normal ASTRAL (5.7.4). I fixed the ASTRAL-MP in version 15.5.2 (ef5518c). Please update to 15.5.2 and it should be fixed. Thanks for the report.

On Thu, Dec 10, 2020 at 3:38 PM krinsman notifications@github.com wrote:

It appears to be an issue with regular ASTRAL as well, with both I get the error:

================== ASTRAL =====================

This is ASTRAL version 5.15.1 Warning: Fail to load native library libAstral.dylib; use Java default computing method without AVX2, which is 4X slower. Make sure you are using the correct Djava.library.path (to the lib directory under ASTRAL where libAstral.dylib can be found). Trying running make.sh. For mode debugging, run: java -Djava.library.path=lib/ -jar native_library_tester.jar Gene trees are treated as unrooted There are 8 threads used to run. Exception in thread “main” java.lang.RuntimeException: Failed to Parse Tree number: 1 at phylonet.coalescent.CommandLine.readInputTrees(CommandLine.java:750) at phylonet.coalescent.CommandLine.readOptions(CommandLine.java:369) at phylonet.coalescent.CommandLine.main(CommandLine.java:517) Caused by: phylonet.tree.io.ParseException: ‘)’ expected at phylonet.tree.io.NewickReader.readNode(NewickReader.java:405) at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399) at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399) at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399) at phylonet.tree.io.NewickReader.readNode(NewickReader.java:399) at phylonet.tree.io.NewickReader.readTree(NewickReader.java:374) at phylonet.tree.io.NewickReader.readTree(NewickReader.java:95) at phylonet.coalescent.CommandLine.readInputTrees(CommandLine.java:717) … 2 more

I made a test Newick string by inserting some /'s and ='s into the primates.tre test file that comes with ASTRAL

test.txt https://github.com/smirarab/ASTRAL/files/5676243/test.txt

(Had to change file suffix from .tre to .txt so GitHub would let me upload it)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/smirarab/ASTRAL/issues/69#issuecomment-742869695, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGJXOEVGXI4JBKDHCJJ3R3SUFLYDANCNFSM4UUCCYSQ .

– Siavash Mirarab

0reactions
smirarabcommented, Aug 14, 2021

The third tree in your input file seems to have some error. My guess is that it has non-standard characters. See: https://github.com/smirarab/ASTRAL/#input

Read more comments on GitHub >

github_iconTop Results From Across the Web

Porting Code to Python 3 with 2to3 - Springer Link
In Python 3, the way to do this is to pass end=' ' as a keyword argument to the print() function. The end...
Read more >
Biopython Tutorial and Cookbook
Also like a Python string, you can do slices with a start, stop and stride ... If this is non zero (indicating an...
Read more >
Changelog — Python 3.7.15 documentation
gh-96848: Fix command line parsing: reject -X int_max_str_digits option with no value (invalid) when the PYTHONINTMAXSTRDIGITS environment variable is set to a ...
Read more >
Showcase of Languages - Code Golf Stack Exchange
In fact, this is the only error message in ><>, whether the cause be ... But now we're on a " so we...
Read more >
Astral Projection: Is It Real? | The Sleep Matters Club - Dreams
It's also sometimes referred to as an 'out-of-body experience (OBE)', although Healthline states there are distinct differences between the two:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found