覆盖率引导的Python JIT编译器缺陷检测
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

国家自然科学基金(62132020, 62032004); 国家自然科学基金青年科学基金(62302077); 中央高校基本科研业务费专项资金(DUT24LAB126)


Coverage-guided Defect Detection for Python JIT Compilers
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    Python作为一种广泛应用的解释型语言, 在执行效率方面存在性能瓶颈. 即时(JIT)编译器被引入Python生态, 它通过将字节码动态编译为机器码, 显著提升了程序的运行速度. 然而, JIT编译器复杂的优化策略可能导致程序缺陷, 影响程序的稳定性和可靠性. 现有的Python解释器模糊测试方法难以有效检测JIT编译器的深层优化缺陷和非崩溃缺陷. 为此, 提出了一种基于覆盖率引导的Python JIT编译器缺陷检测方法PjitFuzz. 首先, 为了能够生成触发Python JIT编译器优化策略的程序变体, PjitFuzz提出了5种基于JIT优化策略的程序变异规则. 其次, 为了聚合不同变异规则的优势并生成多样化的程序变体, PjitFuzz设计了一种基于覆盖率引导的变异规则动态选择方法. 然后, 为了有效记录程序执行过程中变量值的变化情况, 从而检测输出不一致的缺陷, PjitFuzz提出了一种基于计算校验和的代码块插入策略. 最后, 结合不同的JIT编译选项进行差分测试, 从而有效检测Python JIT编译器缺陷. 将PjitFuzz与目前最先进的两种Python解释器模糊测试方法FcFuzzer和IFuzzer进行比较, 实验结果表明, PjitFuzz在缺陷检测能力上, 分别高出150%和66.7%; 在代码覆盖率方面, 分别比现有方法高出28.23%和15.68%; 在生成测试程序有效率方面, 分别高出42.42%和62.74%. 在为期8个月的实验中, PjitFuzz发现并报告了16个缺陷, 其中12个已得到开发人员的确认.

    Abstract:

    As a widely employed interpreted language, Python faces performance challenges in execution efficiency. Just-in-time (JIT) compilers have been introduced to the Python ecosystem to dynamically compile bytecode into machine code, significantly improving program operation speed. However, the complex optimization strategies of JIT compilers may introduce program defects, thereby affecting program stability and reliability. Existing fuzz testing methods for Python interpreters struggle to effectively detect deep optimization defects and non-crashing defects in JIT compilers. To this end, this study proposes PjitFuzz, a coverage-guided defect detection method for Python JIT compilers. First, PjitFuzz proposes five mutation rules based on JIT optimization strategies to generate program variants that trigger the optimization strategies of Python JIT compilers. Second, a coverage-guided dynamic mutation rule selection method is designed to integrate the advantages of different mutation rules and generate diverse program variants. Third, a checksum-based code block insertion strategy is developed to effectively record changes in variable values during program execution and detect inconsistency in the output. Finally, differential testing is performed by combining different JIT compilation options to effectively detect defects in Python JIT compilers. This study compares PjitFuzz with two state-of-the-art Python interpreter fuzzing methods, FcFuzzer and IFuzzer. The experimental results show that PjitFuzz improves defect detection capability by 150% and 66.7% respectively, and outperforms existing methods in terms of code coverage by 28.23% and 15.68% respectively. For the validity rate of generated test programs, PjitFuzz outperforms the comparative methods by 42.42% and 62.74% respectively. In an eight-month experiment, PjitFuzz has discovered and reported 16 defects, 12 of which have been confirmed by developers.

    参考文献
    相似文献
    引证文献
引用本文

任志磊,张子龙,周志德,李微微,江贺.覆盖率引导的Python JIT编译器缺陷检测.软件学报,,():1-20

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2025-05-13
  • 最后修改日期:2025-09-23
  • 录用日期:
  • 在线发布日期: 2026-02-04
  • 出版日期:
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号