Unresponsive with 100% CPU
See original GitHub issueI was trying out solidity-coverage today but running into issues testing it out. I have ~17 contracts, and after “Instrumenting…” the process pegs one CPU core at 100% and never seems to finish(waited a bit over 1 hour).
How can I go about debugging this? I’ve tried the traditional node DEBUG
env var with no useful output.
DEBUG="*" ./node_modules/.bin/solidity-coverage
Here’s my .solcover.js
file. I have tried without specifying port
, testCommand
, and norpc
as well(also, ganache appears to not receive any transactions during this process).
module.exports = {
port: 8545,
testCommand: './node_modules/.bin/truffle test --network dev',
norpc: true,
copyNodeModules: true,
skipFiles: ['Test.sol']
};
The process can not be terminated through a keyboard interrupt(ctrl+c) either. I’m running this on an Arch Linux system, if that helps. Let me know if I can provide any more information.
Issue Analytics
- State:
- Created 5 years ago
- Comments:34 (19 by maintainers)
Top Results From Across the Web
How To Fix an Issue When CPU at 100% All the Time on ...
One quick way to get rid of this issue is to end the processes that take up high CPU usage simply. You can...
Read more >8 Useful Solutions to Fix Your CPU 100% in Windows 10/11
Sometimes your CPU is running at 100% and the speed of your computer becomes slow. This post will provide 8 solutions for you...
Read more >100% CPU Usage in Windows? Here's How to Fix it
It's a common problem that's, luckily, not usually too hard to solve. Here are several fixes for the 100% CPU usage problem in...
Read more >How to Fix High CPU Usage in Windows - MakeUseOf
Restart the WMI Provider Host to Fix High CPU Usage · Press Windows key + S, input Services, and press Enter. · In...
Read more >Windows explorer not responding very high cpu usage with no ...
1. Press Windows Key + R and type SYSDM.CPL in Run. Click OK or press Enter key. 2. In System Properties window, switch...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @vs77bb the project type is
Traditional
so its 1 worker at a time i cannot participate if there is a way that i don’t currently know please inform me 😄. Also i wanted to clarify that i already have the diagnosis due to a project im working on and using oraclize service withsolidity-coverage
and i wasn’t targeting on the bounty in the first place (it came out as a bonus) also i want to apologize to @mttmartin for the highjack.The exclusion issue arrise when the line https://github.com/sc-forks/solidity-coverage/blob/a40ba7b1b4c4fe03352eb4899aa27931a6734f6b/lib/app.js#L390 in
postProcessPure
does not properly check for excluded files. #259 is addressing this issue by adding an exclusion file/folder check. As for the bug itself the process “hangs” (in the matter of fact is working) because of the unbracketed singleton statement parser at https://github.com/sc-forks/solidity-coverage/blob/a40ba7b1b4c4fe03352eb4899aa27931a6734f6b/lib/preprocessor.js#L40 is too slow when it comes to parsing large contracts the main issue is the loop using: https://github.com/sc-forks/solidity-coverage/blob/a40ba7b1b4c4fe03352eb4899aa27931a6734f6b/lib/preprocessor.js#L45 witch takes a lot of time to parse all the contract in every pass. The aforementioned claim can be verified by applying the following patch:and getting this output:
and after approx.
40 * 40 / 60 = 26,66
minutes laterthis indicates that every iteration take approximately 40 seconds (in my machine), multiply that with the number of required passes and the result is really time consuming.
The conditions are triggered when using
usingOraclize.sol
(SHA256: 79283d8e5f4f30fe33c6b0ab2296531bdd159f19438ec18fe9ebae2a5bc7edae) file at: https://github.com/sc-forks/solidity-coverage/blob/a40ba7b1b4c4fe03352eb4899aa27931a6734f6b/lib/app.js#L393