-
Notifications
You must be signed in to change notification settings - Fork 2.3k
"truffle debug" hangs forever on start #2977
Comments
Ooh, hadn't seen this one before. Do you have a reproduction example we could test this with, or do you know if this occurs with other projects as well? I'm wondering whether the debugger might be failing on something in your particular project. Thanks for reporting this! |
@haltman-at Hi thanks for the attention. I've prepared a minimal self-contained repo for debug purposes: https://github.com/InjectiveLabs/0x-exchange-omnibus The contract sources are basically 0x exchange from 0x-monorepo with Truffle config and migration file on top of it. Steps
are enough to reproduce issue with
I tried to understand how it works but there are too many mappings and arrays :) |
Also some tip: Usually I see this
But in the case of that repo it builds contracts each time I try to migrate or run tests. |
OK, thanks a bunch! I'll take a look. |
OK, I've put up #2991 to address this. Unfortunately I have some bad news. You may recall that Truffle Debugger used to have to do a full recompile every time it started up. A while ago I added code to detect when it didn't need to do that and skip the recompile if so. Well, seems it needs to do so more in more cases than I realized. In particular, on this project, it is always going to need to recompile on startup. The reason is that the project contains contracts with duplicate names, which we're still working on handling well (#1087); the artifacts format wasn't made with duplicate names in mind, and Truffle DB, the replacement, is still under development. The good news is that Truffle Debugger can handle duplicate names... but since the artifacts can't, it will need to do a recompile on every startup with your project, rather than just getting the info from the artifacts and skipping that. Sorry. But, with this PR, it does successfully start on your project, even if it takes a while! |
Issue
After fixing this issue locally
#1752 by ignoring undefined in the code, the "truffle debug" command now just continues to spin that spinner forever:
It actually consumes 100% CPU for a while, and if I run
I can see a lot of debug info, but at some point the info stops and CPU usage drops to 0% and that spinner then spins forever.
This behaviour is the same on macOS (old macbook) and powerful Ubuntu machine.
Environment
truffle version
): 5.1.22node --version
): v10.19.0 / v10.20.1npm --version
): 6.14.4The text was updated successfully, but these errors were encountered: