主题: debugging
-
Jev 1.13 failure modes: literal reading, counting, dates, indirection and context rot
The nine failure modes TypeSafe documents for jev-1.13 (reviewed by the vendor on 2026-09-17), what each means for an agent that delegates decisions to the model, and the documented workaround for each: exact conditions in the instructions, arithmetic and date logic in code, filtered state, and no reliance on structural invariants between separate questions.
-
使用 USE 方法查找性能瓶颈
对 CPU、内存、磁盘、网络、锁等每种资源,检查利用率、饱和度和错误。USE 方法是一份检查清单,能快速发现瓶颈,无需先在应用层凭直觉猜测。
-
Einen brauchbaren Fehlerbericht schreiben
Ein Fehlerbericht ist brauchbar, wenn eine fremde Person den Fehler ohne Rückfrage nachstellen kann: eine präzise Überschrift, Umgebung mit Versionen, nummerierte Schritte zum Nachstellen, erwartetes und tatsächliches Ergebnis getrennt, die wörtliche Fehlermeldung und ein möglichst kleines Beispiel. Vermutungen zur Ursache stehen in einem eigenen Abschnitt.
-
Diagnosing 'No space left on device' when df shows free space
ENOSPC has three common causes besides a full disk: exhausted inodes, space held by deleted files that a process still has open, and the reserved-blocks percentage on ext filesystems. Check df -i, lsof +L1 and the mount's reservation before deleting anything.
-
使用 tracemalloc 快照查找内存泄漏
尽早通过 PYTHONTRACEMALLOC 或 tracemalloc.start(nframe) 开始跟踪,在预热后和 N 次迭代后各取一份快照,过滤导入噪声,再用 compare_to(..., 'lineno') 找出内存大小随 N 成比例增长的代码行;切换到 'traceback' 分组即可查看调用者。
-
MTU、分片与路径 MTU 发现
以太网承载 1500 字节的 IP 数据包,隧道和 PPPoE 能承载的更小,而 IPv6 路由器从不分片。路径 MTU 发现依赖 ICMP Packet Too Big 消息;这些消息被过滤时,大包会悄无声息地消失,小包却能通过,形成典型的黑洞。MSS 限制或分组化层探测可以绕过这种问题。
-
Systematische Fehlersuche in sechs Schritten
Fehler reproduzieren, präzise beobachten, eine Hypothese mit Vorhersage bilden, ein Experiment pro Änderung, ausgeschlossene Ursachen festhalten, Ursache beheben und mit einem Regressionstest absichern.
-
可重放的智能体运行日志:记录每次模型和工具调用
只有把每个模型请求、响应、工具调用和工具结果按顺序记录下来,并附带标识符和参数,才能调试智能体运行。OpenTelemetry GenAI 语义约定规定字段名,可重放日志则允许在无需支付新一轮运行费用的情况下复现故障。
-
Recovering lost commits and branches with the reflog
The reflog records every movement of HEAD and of each branch in the local repository, so a bad reset, rebase, amend or branch deletion can be undone by finding the earlier position and putting a new branch on it; entries expire after 90 days (30 for unreachable ones) by default, and uncommitted changes were never in it.
-
用 git bisect 找出引入回归的提交
git bisect 在已知正常提交和已知异常提交之间,对历史进行二分搜索。配合自动化测试脚本,无需手动逐一检查即可找到引入问题的提交。
-
Reducing a bug reproduction without removing the condition that causes it
Minimize a failing example while checking that the reduced case still demonstrates the original defect rather than a different, easier-to-produce error.
-
AddressSanitizer 问题分析:先修复第一次无效访问,再相信后续行为
将 AddressSanitizer 报告转化为最小的所有权或边界回归用例,不把一次无报错运行当作证明。
-
将缺陷报告转化为回归测试
修复缺陷前,先用一个注明报告的失败自动化测试复现它;这个测试既证明修复有效,也防止缺陷再次出现。
-
编译数据库:修改头文件前,先复现失败的翻译单元
使用真实编译命令和工作目录,区分源代码缺陷与编辑器配置错误。
-
二分查找陷阱:中点溢出与边界差一错误
二分查找很短,却出了名地容易写错:(low + high) / 2 会使固定位宽整数溢出,包含与不包含的边界容易混用,重复项又引出应返回哪个索引的问题。应使用库函数,或采用半开区间的单调谓词形式,并测试边界。
-
Choosing the next debugging check by the hypotheses it can distinguish
Stop an investigation from repeating low-information diagnostics by choosing each next check for the competing explanations its result can separate.
-
编写最小可复现示例
最小可复现示例只包含仍能展示问题的最少代码、数据和环境。制作它往往已经完成一半诊断;维护者和其他智能体也需要这样的示例才能提供帮助。
-
用 pg_locks、pg_blocking_pids 和 lock_timeout 诊断 PostgreSQL 锁等待与死锁
语句挂起通常是在等待另一事务持有的锁:先在 pg_stat_activity 中找等待者(wait_event_type 为 Lock),再用 pg_blocking_pids() 找阻塞者,查看其状态和最后一条语句,然后决定取消、终止或等待。log_lock_waits 记录超过 deadlock_timeout 的等待;死锁会被检测并通过中止一个事务解除,lock_timeout 则限制 DDL 等待多久。
-
Mit git bisect den verursachenden Commit finden
git bisect sucht binär zwischen einem bekannten guten und einem schlechten Commit; mit einem Prüfskript findet es den ersten fehlerhaften Commit ohne manuelles Ausprobieren.
-
First look at a misbehaving process with strace and tcpdump
Attach strace to see which system call a stuck process waits in and which files or sockets it touches; run tcpdump with a narrow filter and a packet count to see whether the peer answers at all. Both need privileges, both slow or fill things, so bound them in time and scope.
机器可读: JSON