Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

"truffle debug" hangs forever on start #2977

Closed
xlab opened this issue Apr 17, 2020 · 5 comments
Closed

"truffle debug" hangs forever on start #2977

xlab opened this issue Apr 17, 2020 · 5 comments
Labels

Comments

@xlab
Copy link

xlab commented Apr 17, 2020

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:

⠼ Gathering information about your project and the transaction...

It actually consumes 100% CPU for a while, and if I run

DEBUG=* truffle debug

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.

Screenshot 2020-04-18 at 00 43 56

This behaviour is the same on macOS (old macbook) and powerful Ubuntu machine.

Environment

  • Operating System: macOS 10.15.4 / Ubuntu LTS 18.04
  • Ethereum client: Ganache CLI v6.9.1 (ganache-core: 2.10.2)
  • Truffle version (truffle version): 5.1.22
  • node version (node --version): v10.19.0 / v10.20.1
  • npm version (npm --version): 6.14.4
@haltman-at
Copy link
Contributor

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!

@xlab
Copy link
Author

xlab commented Apr 18, 2020

@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

yarn
yarn truffle build
yarn truffle debug

are enough to reproduce issue with source === undefined here

source => source.id === primarySourceId

I tried to understand how it works but there are too many mappings and arrays :)

@xlab
Copy link
Author

xlab commented Apr 18, 2020

Also some tip:

Usually I see this

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

But in the case of that repo it builds contracts each time I try to migrate or run tests.

@haltman-at
Copy link
Contributor

OK, thanks a bunch! I'll take a look.

@haltman-at
Copy link
Contributor

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants