Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable strace for docker container #12

Open
huan opened this issue Jan 25, 2021 · 1 comment
Open

Enable strace for docker container #12

huan opened this issue Jan 25, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@huan
Copy link
Member

huan commented Jan 25, 2021

上帝说,要有光。于是就有了光。

KCN: 方便动态调试,docker启动需要允许strace

docker run --cap-add=SYS_PTRACE  ...

Links

huan added a commit to zixia/server that referenced this issue Jan 25, 2021
huan added a commit that referenced this issue Jan 25, 2021
@huan huan added the enhancement New feature or request label Jan 25, 2021
@huan
Copy link
Member Author

huan commented Jan 25, 2021

Online system updated, it seems to work now:

bbs@bbs:~$ gdb /kbs/bin/bbsd 
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /kbs/bin/bbsd...done.
(gdb) r
Starting program: /kbs/bin/bbsd 
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Inferior 1 (process 310) exited normally]
(gdb) b main
Breakpoint 1 at 0x412850: file bbsd_single.c, line 673.
(gdb) r
Starting program: /kbs/bin/bbsd 
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7ffd18f648e8) at bbsd_single.c:673
673	bbsd_single.c: No such file or directory.
(gdb) l
668	in bbsd_single.c
(gdb) n
676	in bbsd_single.c
(gdb) n
673	in bbsd_single.c
(gdb) n
676	in bbsd_single.c
(gdb) n
673	in bbsd_single.c
(gdb) 

huan added a commit that referenced this issue Jan 25, 2021
@huan huan added this to the 2021 Reload milestone Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant