“7/28 XX 版本容器 at 大面积失败问题”分析报告

遗留问题:把 struct mm 放到 file->private_date 中,是否有可能导致泄漏? 情况简述 XXX(xxxxxxxx)2021-07-29 14:32 @XX 有修改引入引起这边容器AT大面积失败 问题引入补丁:bfb819ea20ce (“proc: Check /proc/$pid/attr/ writes against file opener”) 修补补丁: 591a22c14d3f (“proc: Track /proc/$pid/attr/ opener mm_struct”) ,在修复原问题的基础上引入了新问题。 问题现场:Launchpad …

Search Paths for Dynamic Linking & Loading

Before we start When talking about “dynamic linking”, people could refer to any of the following two processes: one is a step of program’s construction, where (relocatable) object files are dynamically linked by the linker – a toolchain’s component; the other is a pre-processing stage of …

【C++ 小问答】5:对结构体成员字符数组的访问

问 1struct Book { 2 char name[10]; 3 char type[10]; 4 int price; 5}; 6 7struct Book *getBook() 8{ 9 struct Book b = { 10 .name = "C Primer", 11 .type = "Programme", 12 .price = 100, 13 }; 14 return &b; 15}; 16 17int main() 18{ 19 struct Book *b = getBook(); 20 char *name = b->name; 21 char *type = …

Linux 内核问题调试手段

源代码定位方法 我们经常需要根据内核错误日志,在源代码中比较精确地定位到发生错误的那一行。一般而言,我们通过错误发生的地址来定位对应的源代码:(链接 ) 1# 注意:这里的 vmlinux 需要带有调试信息 2addr2line -f -e vmlinux <asm_addr> 然而在内核错误日志中,调用栈常以形如 bdi_register+0xec/0x150 的形式1展示函数调用地址,而 addr2line 无法解读这样的格式。此时我们可以使用 GDB 来解析该地址: 1# In `gdb vmlinux`, compiled with CONFIG_DEBUG_INFO=y 2 3list …

Linux 内核问题调试手段——QEMU 专题

VM 启动后没有输出?莫慌~ 一般而言,在运行 qemu-system-xxx 启动虚拟机后,我们希望在主机的当前终端上看到内核的启动日志,并在虚拟机启动后用该终端直接操作虚拟机。然而有时,当前终端在运行了 qemu-system-xxx 后却毫无动静。此时,在确认内核可以正常启动的前提下,要去确认几件事情: 当前终端对 QEMU 虚拟机而言是什么设备; 当前内核使用的 /dev/console 指向了哪个设备。 先找到一个可用的虚拟机终端(比如通过 VNC 连接的方式),然后向 /dev/{console,tty{,S}{0,1,...}} 等物理终端设备文件逐个尝试输入一些内容,看看哪个文件能让主机的当前终端有输出1。确定了是哪 …