Welcome to My Daily Blog.
- Record Daily Thoughts.
Welcome to My Daily Blog.
标题:REPT: Reverse Debugging of Failures in Deployed Software 作者:Weidong Cui, Xinyang Ge, Baris Kasikci, Ben Niu, Upamanyu Sharma, Ruoyu Wang, Insu Yun 发表会议:USENIX OSDI 2018 原文链接:REPT Reverse Debugging of Failures in Deployed Software Intro 众所周知,执行日志有助于调试,但当大多数日志或跟踪在正常运行时都会被丢弃时,没有人愿意为始终在线的日志记录/跟踪支付高性能开销。 因此,在部署的软件出现故障时,仅靠memory dump,以实现事后诊断。而开发人员调试memory dump具有挑战性,有很大一部分错误未得到修复 论文针对已部署软件中难以复现的故障诊断难题,提出了REPT系统,这是一种用于对已部署系统中的软件故障进行反向调试的实用解决方案。 REPT背后有两个关键思想 利用硬件跟踪以较低的性能开销记录程序的控制流。(Intel Processor Trace) 使用一种新颖的二进制分析技术,根据记录的控制流信息和存储在内存转储中的数据值来恢复数据流信息。(Offline Binary Analysis Component Loadable Library in WinDbg) 因此,REPT通过结合记录的控制流和恢复的数据流来实现反向调试。 Intel PT 由CPU内部集成的专用硬件实现。当程序运行时,PT硬件以压缩的格式生成一系列Packet,记录关键的控制流变化(分支跳转、函数调用等) instructions PT Decoded (timestamp, instruction) mov NT 00.000000, mov jnz TIME 2ns + T 00.000000, jnz add 0x407e1d8 00.000002, add cmp TIME 100ns + NT 00.000002, cmp je .label 00.000002, je .label mov 00.000102, call (edx) .label: 00.000102, … call (edx) 00.000102, test test 00.000102, jb jb Linux Perf可以方便地收集和解码Intel PT跟踪数据 ...
PyObject Everything is object, except keywords 所有的都是对象,除了关键字 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 /* FILE: cpython/Include/object.h */ /* PyObject_HEAD 是所有 OBJECT 的初始化段 */ #define PyObject_HEAD PyObject ob_base; typedef struct _object PyObject; struct _object { Py_ssize_t ob_refcnt; PyTypeObject *ob_type; }; /* Py_GIL_DISABLED (无 GIL 锁的版本),添加了额外的 mutex */ struct _object { uintptr_t ob_tid; uint16_t _padding; struct _PyMutex ob_mutex; // per-object lock uint8_t ob_gc_bits; // gc-related state uint32_t ob_ref_local; // local reference count Py_ssize_t ob_ref_shared; // shared (atomic) reference count PyTypeObject *ob_type; }; ob_refcnt即引用计数器,ob_type是类型对象的指针,这里的ob_type指向了一个描述了该如何操作此类型的类型对象 ...