DEV/C&C++

gdb, gcore를 통한 강제 core dump 방법

pu928 2018. 6. 1. 14:53
반응형

- [ulimit -a] 명령으로 core size 확인

- [ulimit -c unlimited] 명령으로 size 제한 해제


- gdb를 통해 core 파일 생성

[root@localhost src]# gdb --pid=18843 --batch -ex gcore     

[New LWP 18847]

[New LWP 18846]

[New LWP 18845]

[New LWP 18844]

[Thread debugging using libthread_db enabled]

runtime.epollwait () at /usr/local/go/src/runtime/sys_linux_amd64.s:563

563             MOVL    AX, ret+24(FP)

warning: File "/usr/local/go/src/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py".

To enable execution of this file add

        add-auto-load-safe-path /usr/local/go/src/runtime/runtime-gdb.py

line to your configuration file "/root/.gdbinit".

To completely disable this security protection add

        set auto-load safe-path /

line to your configuration file "/root/.gdbinit".

For more information about this security protection see the

"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:

        info "(gdb)Auto-loading safe path"

Saved corefile core.18843 



- gcore를 통해 core 파일 생성

[root@localhost src]# gcore 18943

warning: File "/usr/local/go/src/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py".

To enable execution of this file add

        add-auto-load-safe-path /usr/local/go/src/runtime/runtime-gdb.py

line to your configuration file "/root/.gdbinit".

To completely disable this security protection add

        set auto-load safe-path /

line to your configuration file "/root/.gdbinit".

For more information about this security protection see the

"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:

        info "(gdb)Auto-loading safe path"

[New LWP 18947]

[New LWP 18946]

[New LWP 18945]

[New LWP 18944]

[Thread debugging using libthread_db enabled]

runtime.epollwait () at /usr/local/go/src/runtime/sys_linux_amd64.s:563

563             MOVL    AX, ret+24(FP)

Saved corefile core.18943 



반응형