コアダンプ後にすべてのスレッドのバックトレースをダンプする gdb のこの気の利いた 1 つのライナーを見ました。だから私は簡単に試しました:
int main() {int* x = new int[5]; for(int i = 0; true; ++i) x[i] = i; }
コアダンプを取得してから、これを実行しました:
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" a.out core.box-name.a.out.27459.8515.11
そして、私は出力を取得します:
[New LWP 27459]
warning: Can't read pathname for load map: Input/output error.
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff9e503000
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
#0 0x00000000004005ca in main () at <stdin>:6
6 <stdin>: No such file or directory.
Thread 1 (LWP 27459):
#0 0x00000000004005ca in main () at <stdin>:6
i = 33788
x = 0x1a460010
素晴らしいバックトレースが表示されますが、表示される 2 つの警告は何なのか疑問に思っています。