Skip to content
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

flow coverage infinite loop with --color flag #2366

Closed
aackerman opened this issue Aug 30, 2016 · 2 comments
Closed

flow coverage infinite loop with --color flag #2366

aackerman opened this issue Aug 30, 2016 · 2 comments
Assignees

Comments

@aackerman
Copy link
Contributor

aackerman commented Aug 30, 2016

In the course of working on #2365, being a novice with OCaml I spent far too much time trying to debug this issue that I believe is an infinite loop.

To test my changes I was running make and then ./bin/flow coverage --color lib/node.js and the process would hang completely instead of outputting anything to the terminal. Running the same command on lib/dom.js did not produce this behavior.

I see the same behavior when running the same command with the v0.30 build so it doesn't seem to be a problem with the changes I was making at the time.

It appears to be an issue with the split_overlapping_ranges method.

@aackerman
Copy link
Contributor Author

@avikchaudhuri I looked into this a little bit further and it looks like the problem is that split_overlapping_ranges doesn't account for loc1 range ending in the middle of loc2.

- else if loc1._end.offset = loc2._end.offset then
+ else if loc1._end.offset <= loc2._end.offset then

@avikchaudhuri
Copy link
Contributor

@aackerman Yes! I'm in the process of fixing it in master, I'll try to get it into the next deploy.

@ghost ghost closed this as completed in aa8e8b2 Aug 31, 2016
ghost pushed a commit that referenced this issue Sep 2, 2016
Summary:
Some bug in our handling of locations in type tables violates an implicit
condition on emitted ranges: pairwise, they should either be nested or disjoint.

This causes the coverage implementation, which relies on that assumption to
split ranges, not terminate on certain inputs.

This diff doesn't fix the actual bug, but instead makes the coverage
implementation more rubust. It also adds a case to the type normalizer to make
declare modules not appear uncovered.

Fixes #2366
Fixes #1962

Reviewed By: gabelevi

Differential Revision: D3796024

fbshipit-source-id: 7e87b10bb4c57ecfa20255ff2e2509406c5db1be
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants