1

Whenever I try to debug TensorFlow's C++ code with Eclipse + GDB, I get GDB crashing, or actually exiting with: error code = -1.

As long as I don't set a breakpoint in TensorFlow's C++ code, the program runs just fine. But when I do, and when the debugger gets to the breakpoint, it crashes after a few seconds with error code -1. There is nothing meaningful in the GDB traces which can explain this behavior.

The GDB version I am using is 7.7.1, running with Eclipse Neon under Ubuntu 14.04.

TensorFlow is compiled in debug mode. I don't think that Eclipse is missing the debug symbols for it, as it is not complaining that those are missing (and also, occasionally, the debugger is able to step through a few steps in the code before it crashes).

An easy way to reproduce is to try and debug the label_image example: https://www.tensorflow.org/versions/r0.11/tutorials/image_recognition/index.html

Compile it and then create a 'C/C++ Application' debug configuration in Eclipse, directing it to the compiled binary of the label_image app.

2
  • What happens when you run gdb from the command-line? Commented Nov 8, 2016 at 2:02
  • Just tried it. Seems much more stable. Maybe the issue is related to Eclipse? I have tried two versions, including the latest Neon one. Commented Nov 8, 2016 at 8:13

1 Answer 1

0

I've encountered the same problem with GDB on macOS. But, I finally succeeded to debug tf with lldb. And I also found that using VisualStudio Code + lldb makes it easy for debugging.

Here is my way of debugging. Maybe you can give it a try.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.