摘要: 1.简介 近期遇到在userspace的进程随机关闭fd 0的问题,最后导致其他进程使用fd 0时出现coredump。 如果能够在close系统调用中检查所有的进程调用close时,通过传入参数是否为0来找出问题,会比较方便。 2.做法 a.out是我们需要monitor的进程,因为它可能是线程, 阅读全文
posted @ 2020-11-05 19:42 smilingsusu 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1.strace除了可以追踪调用系统调用的程序之外,还可以打印出当前的调用栈。只需要在执行strace时加上-k参数就可以了,不过有些strace都不支持-k参数,所以需要自己来build带-k参数strace。 2.build unwind(strace需要使用的lib)。 libunwind:h 阅读全文
posted @ 2020-11-04 13:29 smilingsusu 阅读(936) 评论(0) 推荐(0) 编辑
摘要: https://lwn.net/Articles/335942/ 阅读全文
posted @ 2020-10-22 09:51 smilingsusu 阅读(573) 评论(0) 推荐(0) 编辑
摘要: build ARM版本的GDB,可以在线debug user 程序。 mkdir build_gdbcd build_gdbexport PATH=$PATH:/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/../configure 阅读全文
posted @ 2020-10-15 20:34 smilingsusu 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 移植Python到ARM开发板。 1. 先build pc上运行的Python。 mkdir build.pc; cd build.pc../configure --prefix=/proj/mtk19184/ws/Python-3.8.0/build.pc/Python3.8.0make -j32 阅读全文
posted @ 2020-10-15 20:23 smilingsusu 阅读(923) 评论(0) 推荐(0) 编辑
摘要: 1. kasan 非常有用的debug工具,主要用于debug 访问越界,访问已经释放的内存,栈溢出等,能解决大多数memory问题(90%),但是依然有缺陷,比如不能debug HW操作memory造成的问题,还有一些SW造成的问题,比如process A allocate内存之后再释放,proc 阅读全文
posted @ 2020-09-22 19:44 smilingsusu 阅读(1051) 评论(0) 推荐(0) 编辑
摘要: 1.下载源代码: 我们使用国内的tsinghua节点下载代码。https://mirror.tuna.tsinghua.edu.cn/help/qemu.git/ 2.下载支持包: 使用qemu源码中的git-submodel.sh自动下载所有支持包。 执行:scripts/git-submodul 阅读全文
posted @ 2020-06-01 09:13 smilingsusu 阅读(2497) 评论(0) 推荐(0) 编辑
摘要: /******************** COPYRIGHT AND LICENCE NOTICE ******************** This source code is part of the BIGDIGITS multiple-precision arithmetic librar 阅读全文
posted @ 2020-05-22 10:22 smilingsusu 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 最近遇到debug需要,在proc文件系统中新增一个文件进行控制debug的开关,主要是控制trace_printk什么时候开打打印,什么时候结束打印。debug函数从入口到出口所用的时间。 /* * * * Add a directory named hello under proc, * and 阅读全文
posted @ 2020-05-21 20:39 smilingsusu 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 1.在Linux上当执行文件出现异常时,通常直接结束,或者生成coredump文件,debug时步骤繁琐,今天看到一种方法,在不改变原程序的情况下打印callstrace。主要做法是在程序执行时,为它注册异常信号处理函数。 2.代码 signal_lib.c #include <stdlib.h> 阅读全文
posted @ 2020-05-07 20:42 smilingsusu 阅读(294) 评论(0) 推荐(0) 编辑