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
If you cannot download it by clicking downloadlao...
Table of contents 1. Differences between the two ...
aforementioned This article is very short~ The ma...
Docker Compose Docker Compose is a tool for defin...
Database backup #grammar: # mysqldump -h server-u...
As the most commonly used layout element, DIV play...
Project requirements require some preprocessing o...
Use indexes to speed up queries 1. Introduction I...
The installation tutorial of MySQL 5.7.27 is reco...
Table of contents Preface 1. Conventional Vue com...
<br />Conditional comments are a feature uni...
The commonly used escape characters in HTML are s...
This article shares the specific code of JavaScri...
1. Download centos7 Download address: https://mir...
This article example shares the specific code of ...