An ordinary student from China.
Coding for world peace.
License: Mulan Permissive Software License, Version 2
Decode结构体的大小会影响difftest成功与否(开启itrace后difftest不报错了..),当Decode大于40bytes时difftest不报错..这简直匪夷所思。
测试发现应该是只和Decode的大小有关,和具体用来占位置的数据成员无关。并且difftest的运行是正常的,受到影响的是ref的状态,且ref的状态并不是直接和dut保持同步(比如在map中把页表项的a位置为false,nemu没有检查出这个错误,spike仍然可以)
进一步测试之后发现,在difftest_step中随便打印点东西(pc,npc,或者是其他随便什么变量,但是纯字符串不行)也能跑出HIT GOOD TRAP
按照常理分析,ref的状态同步应该都是通过diff_set_reg进行的,尝试在每次diff_set_reg时将ref的状态dump下来进行对比,发现两种情况下的状态是相同的,也就是说两次运行时的状态差异不是因为将dut状态同步到ref导致的
从上面的现象来看,直觉上是程序的一个内存bug..于是我打开了ASAN,发现了更奇妙的现象:在打开ASAN后,即使我不对代码做修改,也能跑出HIT GOOD TRAP
为了排除编译器bug,从clang17切换到gcc12,依然出现相同问题。但是gcc+ASAN,即使对代码做修改也稳定输出ABORT
gcc不对代码做修改是HIT GOOD TRAP..Decode在[48, 6)Bytes之间时是ABORT
测试记录:HIT GOOD TRAP
clang+decode3
clang+stepLogvar
clang+ASAN
gcc+decode20
gcc+stepLogvar
gcc+decode20+step
gcc+stepLogStr
ABORT:
clang+stepLogStr
gcc+ASAN
gcc+decode3+steplogvar
gcc+decode3+steplogstr
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.