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.

Debugger crashes when entering separate file in debug mode

See original GitHub issue
  • [* ] I’ve asked for help in the Truffle Gitter before filing this issue.

Issue

truffle debug <txn> enters the debugger however it crashes when entering a new file.

Steps to Reproduce

Try debugging a transaction in which the debugger has to step through multiple files.

Expected Behavior

Debugger should continue normally.

Actual Results

AFXCrowdsale.sol: is the entry point, AFXToken.sol is a separate file.

AFXCrowdsale.sol:

79:   function () external payable {
80:     uint256 tokensThatWillBeMintedAfterPurchase = msg.value.mul(rate);
81:     if ((stage == CrowdsaleStage.PreICO) && (token.totalSupply() + tokensThatWillBeMintedAfterPurchase > totalTokensForSaleDuringPreICO)) {
                                                 ^^^^^^^^^^^^^^^^^^^                                                                           

debug(development:0xc6ead1d6...)> 

AFXToken.sol:

TypeError: Cannot read property 'line' of undefined

Environment

  • Operating System: Ubuntu 16.04
  • Ethereum client: geth 1.8.1-stable
  • Truffle version:
Truffle v4.1.0 (core: 4.1.0)
Solidity v0.4.19 (solc-js)

  • node version:v8.9.1
  • npm version: 5.5.1

Workaround

Use a flattener, compile and debug from a single large file:

truffle-flattener contracts/crowdsale/AFXCrowdsale.sol | pbcopy etc.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gnidancommented, Mar 29, 2018

I think this should be fixed when trufflesuite/truffle-debugger#39 goes out in the next release!

Closing for cleanup reasons. Thanks!

1reaction
cgeweckecommented, Feb 28, 2018

@boorac Thanks yes, clearly. Thanks for the work-around too, nice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does my program crash when run fine in the debugger ...
I sounds very much like you have an uninitialized variable that you're using and that influences the number of times that loop is...
Read more >
Debugger crashes in attempts to debug multiprocessing script
Run PyCharm and create new python project with python 3.7 interpreter; Create py file with the outlined below code: import os from multiprocessing...
Read more >
Debugger crashes if running under CPython debug build ...
This crashes when debugging a file with only one line like "print('here')". here is a better crash report that shows the crash in ......
Read more >
Basic Debugging of an Application Crash
So where do we begin? The first command we run is !analyze -v . This tells the debugger to run an analysis in...
Read more >
My program crashed. How do I find out why?
Run the program and examine the values of the variables via the debugger interface. Single step toward the crash, watching for changes 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