C ++:如何使用lldb调试“总线错误”?

时间:2018-07-09 11:27:04

标签: c++11 lldb

我是lldb调试的新手。最近,我编译了代码并尝试对其进行测试。编译后,运行它时,出现“ 总线错误”。因此,我想使用lldb调试器来找出问题所在。终端给我这样的输出:

$ lldb ./testLSTMForwardPass
(lldb) target create "./testLSTMForwardPass"
Current executable set to './testLSTMForwardPass' (x86_64).
(lldb) run
Process 96512 launched: './testLSTMForwardPass' (x86_64)
Testing LSTM Forward pass:
Process 96512 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x102742ba8)
    frame #0: 0x0000000102742ba8
->  0x102742ba8: addb   %al, (%rax)
    0x102742baa: addb   %al, (%rax)
    0x102742bac: addb   %al, (%rax)
    0x102742bae: addb   %al, (%rax)
Target 0: (testLSTMForwardPass) stopped.
(lldb) bt all
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x102742ba8)
  * frame #0: 0x0000000102742ba8
    frame #1: 0x00000001015a1768 libMatrix.so`TMatrixT<double>::operator=(this=0x00007ffeefbfdd60, source=0x0000000102742b60) at TMatrixT.cxx:1739 [opt]
    frame #2: 0x00000001015a16e8 libMatrix.so`TMatrixT<double>::TMatrixT(this=0x00007ffeefbfdd60, another=0x0000000102742b60) at TMatrixT.cxx:87 [opt]
    frame #3: 0x0000000100006cf0 testLSTMForwardPass`double testForwardPass<TMVA::DNN::TReference<double> >(timeSteps=<unavailable>, batchSize=<unavailable>, stateSize=<unavailable>, inputSize=<unavailable>) at TestLSTMForwardPass.h:98 [opt]
    frame #4: 0x000000010000695a testLSTMForwardPass`main at TestLSTMForwardPass.cxx:28 [opt]
    frame #5: 0x00007fff65722145 libdyld.dylib`start + 1
    frame #6: 0x00007fff65722145 libdyld.dylib`start + 1

我无法理解此输出的含义。如果有人能帮助我正确地理解它,那就太好了。 :)

0 个答案:

没有答案