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.

Infinite loop during GAST builder.

See original GitHub issue

By making this change and returning a number, I was able to make chevrotain fall into an infinite loop:

If you need more code to debug this, please clone this branch. These should be the only important lines here, as Block is the starting rule.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bd82commented, Mar 15, 2017

Well, I must say you have a real talent for finding edge cases @kdex 👍

Looks like the regExp I was using to match string literals included a redundant “+” modifier Which caused exponential performance degradation when matching unclosed literals.

/'([^\\']+|\\([bfnrtv'\\/]|u[0-9a-fA-F]{4}))*'/

See JSPerf: https://jsperf.com/regexp-v8-perf

1reaction
bd82commented, Mar 14, 2017

I normally try to avoid “ifs” in hot spots in the code. But this could possibly be checked optionally using a JavaScript noop pattern when DevMode is enabled.

  • noop pattern means calling a function that has an empty implementation in certain flows. So in those flows it gets in-lined and effectively has no negative impact on runtime.

I still need to investigate if this can occur in less “strange” circumstance first though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to have an infinite loop using PageView in Flutter?
By default, PageView.builder is infinite in flutter. Unless you provide an itemCount . The following will print page from 0 to 4 infinitely...
Read more >
Infinite loop with ArcGIS Enterprise 10.9.1 - Esri Community
Solved: Friday I upgraded to 10.9.1. The Portal is on IWA and When i try to access webmap from Web App Builder. it...
Read more >
Infinite gas estimation from solc for simple function
This operation involves a loop, that's why the estimator reports infinite gas estimation. array.push() includes setting the new length of the ...
Read more >
Infinite loop building workspace (validating Spring beans)
1. Since then it has been trying to rebuild the workspace. Half way through it begins validating Spring beans, displaying messages like:
Read more >
Breakout! How to stop an infinite loop in a Unity C# script
This post is about a little trick for breaking infinite loops in scripts in Unity. It works with Windows / 64 bit in...
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