question Running gdb in docker, hitting a breakpoint, but unable to enter the breakpoint reason In order to ensure the security of the host, Docker has enabled many security settings, including ASLR (Address space layout randomization), that is, the memory address in Docker is different from the memory address of the host. ASLR will cause address-dependent programs such as GDB to not work properly. Workaround Use docker's super privileges, add --privileged (two dashes, markdown syntax like:
GDB will work normally Super permissions will disable many security settings, allowing you to make full use of Docker capabilities For example, you can open docker in docker, haha. Additional knowledge: docker ptrace: Operation not permitted. How to deal with it When gdb in docker is debugging a process, an error will be reported:
The reason is that ptrace is disabled by default in Docker. Considering the needs of application analysis, there are several solutions: 1. Turn off seccomp
2. Use super permission mode
3. Only open ptrace restrictions
Of course, from a security perspective, if you just want to use gdb for debugging, it is recommended to use the third method. Secure computing mode (seccomp) is a Linux kernel feature that can be used to restrict the operations available within a container. The default seccomp profile for Docker is a whitelist that specifies the calls that are allowed. The following table lists important (but not all) system calls that are effectively blocked because they are not on the whitelist. This table contains the reason why each system call was blocked.
The above article on solving the problem of not being able to enter breakpoints when using GDB in docker is all the content that the editor shares with you. I hope it can give you a reference, and I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Analysis of Sysbench's benchmarking process for MySQL
>>: The difference between HTML iframe and frameset_PowerNode Java Academy
need When querying a field, you need to give the ...
Table of contents 1. Define object methods 2. Def...
Table of contents Preface Background data splicin...
Preface Project release always requires packaging...
MySQL allows you to create multiple indexes on a ...
Problem: vue-cil3 runs with warnings potentially ...
Table of contents 1. Introduction Second practice...
Table of contents Prerequisites useEffect commitB...
The Docker Hub we used earlier is provided by Doc...
CSS is the realm of style, layout, and presentati...
To debug js code, you need to write debugger in t...
In daily development, front-end students often ar...
Preface Today, when I was using a self-written co...
React multiple ways to get the value of the input...
1. Install Oracle There are too many Oracle insta...