有人在移植 RT-Thread 到 RISC-V 芯片时发现:两个线程一切换,浮点寄存器 fs1 的值就"变了心"。这个藏得很深的上下文切换缺陷,从报告到修复合入,只用了五天十小时。
📌 全文 7 章 · 6 张图 · 一句话主线:切换帧里少存了 fs0~fs11 和 fcsr,浮点线程一交换就互相污染------这类 bug 编译器不报、测试难测,只能靠较真的人盯出来
🐛 一、一个不对劲的浮点数
事情的起点很朴素:移植者 boa-z 在把 RT-Thread 移植到 ArtInChip D213(C906 核、M 模式)时,发现线程切换之后,fs1 寄存器的值和预期差了一个尾数。期望值 0x3ff0000100000000,实际拿到 0x3ff0000000000000------最后一位悄悄变了。
对普通业务,这可能只是精度抖动;但对控制算法、数字滤波这类真用浮点的场景,一个尾数的漂移就能让 PID 输出发飘,而且极其难查:代码逻辑全对,单测全过,只有"线程跑久了"才会现形。
"FPU 寄存器堆" "浮点线程 B" "RT-Thread 调度器" "浮点线程 A" "FPU 寄存器堆" "浮点线程 B" "RT-Thread 调度器" "浮点线程 A" #mermaid-svg-xh7XcepNMz98ntUU{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-xh7XcepNMz98ntUU .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-xh7XcepNMz98ntUU .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-xh7XcepNMz98ntUU .error-icon{fill:#552222;}#mermaid-svg-xh7XcepNMz98ntUU .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-xh7XcepNMz98ntUU .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-xh7XcepNMz98ntUU .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-xh7XcepNMz98ntUU .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-xh7XcepNMz98ntUU .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-xh7XcepNMz98ntUU .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-xh7XcepNMz98ntUU .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-xh7XcepNMz98ntUU .marker{fill:#333333;stroke:#333333;}#mermaid-svg-xh7XcepNMz98ntUU .marker.cross{stroke:#333333;}#mermaid-svg-xh7XcepNMz98ntUU svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-xh7XcepNMz98ntUU p{margin:0;}#mermaid-svg-xh7XcepNMz98ntUU .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-xh7XcepNMz98ntUU text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-xh7XcepNMz98ntUU .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-xh7XcepNMz98ntUU .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-xh7XcepNMz98ntUU .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-xh7XcepNMz98ntUU .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-xh7XcepNMz98ntUU #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-xh7XcepNMz98ntUU .sequenceNumber{fill:white;}#mermaid-svg-xh7XcepNMz98ntUU #sequencenumber{fill:#333;}#mermaid-svg-xh7XcepNMz98ntUU #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-xh7XcepNMz98ntUU .messageText{fill:#333;stroke:none;}#mermaid-svg-xh7XcepNMz98ntUU .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-xh7XcepNMz98ntUU .labelText,#mermaid-svg-xh7XcepNMz98ntUU .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-xh7XcepNMz98ntUU .loopText,#mermaid-svg-xh7XcepNMz98ntUU .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-xh7XcepNMz98ntUU .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-xh7XcepNMz98ntUU .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-xh7XcepNMz98ntUU .noteText,#mermaid-svg-xh7XcepNMz98ntUU .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-xh7XcepNMz98ntUU .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-xh7XcepNMz98ntUU .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-xh7XcepNMz98ntUU .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-xh7XcepNMz98ntUU .actorPopupMenu{position:absolute;}#mermaid-svg-xh7XcepNMz98ntUU .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-xh7XcepNMz98ntUU .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-xh7XcepNMz98ntUU .actor-man circle,#mermaid-svg-xh7XcepNMz98ntUU line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-xh7XcepNMz98ntUU :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 切换帧只存了整数寄存器浮点 callee-saved 全没存 写入 fs1 = 期望值主动让出 CPU调度线程 B 上核B 覆写 fs0~fs11切回线程 A读 fs1值被 B 污染(尾数漂移)
🔬 二、复现:把问题钉在官方 QEMU 上
移植板的怀疑价值有限------板子、工具链、外设都可能是变量。boa-z 做对了关键一步:回到官方的 qemu-virt64-riscv 平台复现,QEMU 10.0.13 + OpenSBI 1.6,RV64D、单 hart,把所有硬件变量清零。
问题在这个最小环境里稳定复现,两个疑点随之浮出水面:
疑点一:自愿切换不保存浮点。 线程主动让出 CPU 时,上下文切换只保存整数 callee-saved 寄存器,fs0 到 fs11 这十二个浮点 callee-saved 寄存器全在裸奔。两个用浮点的线程一交替,后上的线程把前面的浮点现场整个覆盖掉。
疑点二:抢占切换漏了 fcsr。 定时器抢占路径倒是存了 f0 到 f31,但没存 fcsr(浮点控制状态寄存器)------舍入模式和异常标志会被静默改掉。这类污染更阴险:不改变数值本身,改变的是"以后算出来的数"。
🧩 三、根因:切换帧里少了十三个字段
把两条路径并在一起看,根因是同一个:切换帧(context frame)的布局不完整。修复 #12006 做了三件事:把 fs0~fs11 和 fcsr 补进切换帧;trap 帧补上 fcsr 的存取;切换帧大小向上取整,保证 16 字节对齐。
#mermaid-svg-2uRCBZyukDJJKMl3{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-2uRCBZyukDJJKMl3 .error-icon{fill:#552222;}#mermaid-svg-2uRCBZyukDJJKMl3 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-2uRCBZyukDJJKMl3 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-2uRCBZyukDJJKMl3 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-2uRCBZyukDJJKMl3 .marker.cross{stroke:#333333;}#mermaid-svg-2uRCBZyukDJJKMl3 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-2uRCBZyukDJJKMl3 p{margin:0;}#mermaid-svg-2uRCBZyukDJJKMl3 g.classGroup text{fill:#9370DB;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-2uRCBZyukDJJKMl3 g.classGroup text .title{font-weight:bolder;}#mermaid-svg-2uRCBZyukDJJKMl3 .cluster-label text{fill:#333;}#mermaid-svg-2uRCBZyukDJJKMl3 .cluster-label span{color:#333;}#mermaid-svg-2uRCBZyukDJJKMl3 .cluster-label span p{background-color:transparent;}#mermaid-svg-2uRCBZyukDJJKMl3 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-2uRCBZyukDJJKMl3 .cluster text{fill:#333;}#mermaid-svg-2uRCBZyukDJJKMl3 .cluster span{color:#333;}#mermaid-svg-2uRCBZyukDJJKMl3 .nodeLabel,#mermaid-svg-2uRCBZyukDJJKMl3 .edgeLabel{color:#131300;}#mermaid-svg-2uRCBZyukDJJKMl3 .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-2uRCBZyukDJJKMl3 .label text{fill:#131300;}#mermaid-svg-2uRCBZyukDJJKMl3 .labelBkg{background:#ECECFF;}#mermaid-svg-2uRCBZyukDJJKMl3 .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-2uRCBZyukDJJKMl3 .classTitle{font-weight:bolder;}#mermaid-svg-2uRCBZyukDJJKMl3 .node rect,#mermaid-svg-2uRCBZyukDJJKMl3 .node circle,#mermaid-svg-2uRCBZyukDJJKMl3 .node ellipse,#mermaid-svg-2uRCBZyukDJJKMl3 .node polygon,#mermaid-svg-2uRCBZyukDJJKMl3 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-2uRCBZyukDJJKMl3 .divider{stroke:#9370DB;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 g.clickable{cursor:pointer;}#mermaid-svg-2uRCBZyukDJJKMl3 g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-2uRCBZyukDJJKMl3 g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-2uRCBZyukDJJKMl3 .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-2uRCBZyukDJJKMl3 .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-2uRCBZyukDJJKMl3 .dashed-line{stroke-dasharray:3;}#mermaid-svg-2uRCBZyukDJJKMl3 .dotted-line{stroke-dasharray:1 2;}#mermaid-svg-2uRCBZyukDJJKMl3 #compositionStart,#mermaid-svg-2uRCBZyukDJJKMl3 .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #compositionEnd,#mermaid-svg-2uRCBZyukDJJKMl3 .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #dependencyStart,#mermaid-svg-2uRCBZyukDJJKMl3 .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #dependencyStart,#mermaid-svg-2uRCBZyukDJJKMl3 .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #extensionStart,#mermaid-svg-2uRCBZyukDJJKMl3 .extension{fill:transparent!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #extensionEnd,#mermaid-svg-2uRCBZyukDJJKMl3 .extension{fill:transparent!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #aggregationStart,#mermaid-svg-2uRCBZyukDJJKMl3 .aggregation{fill:transparent!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #aggregationEnd,#mermaid-svg-2uRCBZyukDJJKMl3 .aggregation{fill:transparent!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #lollipopStart,#mermaid-svg-2uRCBZyukDJJKMl3 .lollipop{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 #lollipopEnd,#mermaid-svg-2uRCBZyukDJJKMl3 .lollipop{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-2uRCBZyukDJJKMl3 .edgeTerminals{font-size:11px;line-height:initial;}#mermaid-svg-2uRCBZyukDJJKMl3 .classTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-2uRCBZyukDJJKMl3 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-2uRCBZyukDJJKMl3 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-2uRCBZyukDJJKMl3 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} #12006 重构
同步提供
路径补齐
切换帧_修复前
+整数 callee-saved 寄存器
-浮点 callee-saved:缺失
-fcsr:缺失
切换帧_修复后
+整数 callee-saved 寄存器
+fs0~fs11 浮点寄存器
+fcsr 控制状态
+16字节对齐保证
配套宏
+context_ext.h 偏移宏
+stack.h 布局宏
trap帧
+fcsr 存取补全
这里有个值得所有 RTOS 用户记住的点:浮点上下文保存是可配置的。不少实时内核为了切换速度,默认不保存 FPU 或者只在部分路径保存。你的固件如果混用了浮点运算和线程切换,最好去翻一下你所用内核的切换代码,确认两条路径都完整。
⚡ 四、四小时出补丁,五天十小时闭环
这单缺陷的修复节奏值得单独讲:11 月 7 日报告,维护者四小时后给出 #12006 补丁,之后进入评审队列,11 月 13 日 09:37 合入主线。从报告到合入,五天十小时。
#mermaid-svg-pPBrHQQx8IFWTGG4{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-pPBrHQQx8IFWTGG4 .error-icon{fill:#552222;}#mermaid-svg-pPBrHQQx8IFWTGG4 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-pPBrHQQx8IFWTGG4 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-pPBrHQQx8IFWTGG4 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-pPBrHQQx8IFWTGG4 .marker.cross{stroke:#333333;}#mermaid-svg-pPBrHQQx8IFWTGG4 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-pPBrHQQx8IFWTGG4 p{margin:0;}#mermaid-svg-pPBrHQQx8IFWTGG4 .mermaid-main-font{font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-pPBrHQQx8IFWTGG4 .exclude-range{fill:#eeeeee;}#mermaid-svg-pPBrHQQx8IFWTGG4 .section{stroke:none;opacity:0.2;}#mermaid-svg-pPBrHQQx8IFWTGG4 .section0{fill:rgba(102, 102, 255, 0.49);}#mermaid-svg-pPBrHQQx8IFWTGG4 .section2{fill:#fff400;}#mermaid-svg-pPBrHQQx8IFWTGG4 .section1,#mermaid-svg-pPBrHQQx8IFWTGG4 .section3{fill:white;opacity:0.2;}#mermaid-svg-pPBrHQQx8IFWTGG4 .sectionTitle0{fill:#333;}#mermaid-svg-pPBrHQQx8IFWTGG4 .sectionTitle1{fill:#333;}#mermaid-svg-pPBrHQQx8IFWTGG4 .sectionTitle2{fill:#333;}#mermaid-svg-pPBrHQQx8IFWTGG4 .sectionTitle3{fill:#333;}#mermaid-svg-pPBrHQQx8IFWTGG4 .sectionTitle{text-anchor:start;font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-pPBrHQQx8IFWTGG4 .grid .tick{stroke:lightgrey;opacity:0.8;shape-rendering:crispEdges;}#mermaid-svg-pPBrHQQx8IFWTGG4 .grid .tick text{font-family:"trebuchet ms",verdana,arial,sans-serif;fill:#333;}#mermaid-svg-pPBrHQQx8IFWTGG4 .grid path{stroke-width:0;}#mermaid-svg-pPBrHQQx8IFWTGG4 .today{fill:none;stroke:red;stroke-width:2px;}#mermaid-svg-pPBrHQQx8IFWTGG4 .task{stroke-width:2;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskText{text-anchor:middle;font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutsideRight{fill:black;text-anchor:start;font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutsideLeft{fill:black;text-anchor:end;}#mermaid-svg-pPBrHQQx8IFWTGG4 .task.clickable{cursor:pointer;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskText.clickable{cursor:pointer;fill:#003163!important;font-weight:bold;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163!important;font-weight:bold;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163!important;font-weight:bold;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskText0,#mermaid-svg-pPBrHQQx8IFWTGG4 .taskText1,#mermaid-svg-pPBrHQQx8IFWTGG4 .taskText2,#mermaid-svg-pPBrHQQx8IFWTGG4 .taskText3{fill:white;}#mermaid-svg-pPBrHQQx8IFWTGG4 .task0,#mermaid-svg-pPBrHQQx8IFWTGG4 .task1,#mermaid-svg-pPBrHQQx8IFWTGG4 .task2,#mermaid-svg-pPBrHQQx8IFWTGG4 .task3{fill:#8a90dd;stroke:#534fbc;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutside0,#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutside2{fill:black;}#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutside1,#mermaid-svg-pPBrHQQx8IFWTGG4 .taskTextOutside3{fill:black;}#mermaid-svg-pPBrHQQx8IFWTGG4 .active0,#mermaid-svg-pPBrHQQx8IFWTGG4 .active1,#mermaid-svg-pPBrHQQx8IFWTGG4 .active2,#mermaid-svg-pPBrHQQx8IFWTGG4 .active3{fill:#bfc7ff;stroke:#534fbc;}#mermaid-svg-pPBrHQQx8IFWTGG4 .activeText0,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeText1,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeText2,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeText3{fill:black!important;}#mermaid-svg-pPBrHQQx8IFWTGG4 .done0,#mermaid-svg-pPBrHQQx8IFWTGG4 .done1,#mermaid-svg-pPBrHQQx8IFWTGG4 .done2,#mermaid-svg-pPBrHQQx8IFWTGG4 .done3{stroke:grey;fill:lightgrey;stroke-width:2;}#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText0,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText1,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText2,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText3{fill:black!important;}#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText0.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText0.taskTextOutsideRight,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText1.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText1.taskTextOutsideRight,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText2.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText2.taskTextOutsideRight,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText3.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneText3.taskTextOutsideRight{fill:black!important;}#mermaid-svg-pPBrHQQx8IFWTGG4 .crit0,#mermaid-svg-pPBrHQQx8IFWTGG4 .crit1,#mermaid-svg-pPBrHQQx8IFWTGG4 .crit2,#mermaid-svg-pPBrHQQx8IFWTGG4 .crit3{stroke:#ff8888;fill:red;stroke-width:2;}#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCrit0,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCrit1,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCrit2,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCrit3{stroke:#ff8888;fill:#bfc7ff;stroke-width:2;}#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCrit0,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCrit1,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCrit2,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCrit3{stroke:#ff8888;fill:lightgrey;stroke-width:2;cursor:pointer;shape-rendering:crispEdges;}#mermaid-svg-pPBrHQQx8IFWTGG4 .milestone{transform:rotate(45deg) scale(0.8,0.8);}#mermaid-svg-pPBrHQQx8IFWTGG4 .milestoneText{font-style:italic;}#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText0,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText1,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText2,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText3{fill:black!important;}#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText0.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText0.taskTextOutsideRight,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText1.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText1.taskTextOutsideRight,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText2.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText2.taskTextOutsideRight,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText3.taskTextOutsideLeft,#mermaid-svg-pPBrHQQx8IFWTGG4 .doneCritText3.taskTextOutsideRight{fill:black!important;}#mermaid-svg-pPBrHQQx8IFWTGG4 .vert{stroke:navy;}#mermaid-svg-pPBrHQQx8IFWTGG4 .vertText{font-size:15px;text-anchor:middle;fill:navy!important;}#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCritText0,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCritText1,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCritText2,#mermaid-svg-pPBrHQQx8IFWTGG4 .activeCritText3{fill:black!important;}#mermaid-svg-pPBrHQQx8IFWTGG4 .titleText{text-anchor:middle;font-size:18px;fill:#333;font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-pPBrHQQx8IFWTGG4 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 2026-11-07 2026-11-07 2026-11-08 2026-11-08 2026-11-09 2026-11-09 2026-11-10 2026-11-10 2026-11-11 2026-11-11 2026-11-12 2026-11-12 2026-11-13 2026-11-13 2026-11-14 移植中发现 fs1 异常 官方 QEMU 复现坐实两处 提交 #12006 补丁(报告后4小时) 待审排队 11-13 批量合入 22 笔 社区侧维护者侧 FPU 缺陷闭环时间线(11-07 ~ 11-13)
注意最后一步:补丁不是单独发的,而是搭了 11 月 13 日那个 22 笔合入的"周五批次"的车。这周的合入节奏高度后置------前四天评审备料,周五一天收口。
#mermaid-svg-j5zyuyRsN5JeeBYO{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-j5zyuyRsN5JeeBYO .error-icon{fill:#552222;}#mermaid-svg-j5zyuyRsN5JeeBYO .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-j5zyuyRsN5JeeBYO .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-j5zyuyRsN5JeeBYO .marker{fill:#333333;stroke:#333333;}#mermaid-svg-j5zyuyRsN5JeeBYO .marker.cross{stroke:#333333;}#mermaid-svg-j5zyuyRsN5JeeBYO svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-j5zyuyRsN5JeeBYO p{margin:0;}#mermaid-svg-j5zyuyRsN5JeeBYO .pieCircle{stroke:#000000;stroke-width:2px;opacity:0.7;}#mermaid-svg-j5zyuyRsN5JeeBYO .pieOuterCircle{stroke:#000000;stroke-width:1px;fill:none;}#mermaid-svg-j5zyuyRsN5JeeBYO .pieTitleText{text-anchor:middle;font-size:25px;fill:#000000;font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-j5zyuyRsN5JeeBYO .slice{font-family:"trebuchet ms",verdana,arial,sans-serif;fill:#000000;font-size:17px;}#mermaid-svg-j5zyuyRsN5JeeBYO .legend text{fill:#000000;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:17px;}#mermaid-svg-j5zyuyRsN5JeeBYO :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 61%17%14%6%3%RT-Thread 主仓库本周合入分布(36 笔) 周一 5 笔 周二 2 笔 周三 1 笔 周四 6 笔 周五 22 笔
🔗 五、同一周的两笔中断修复:同一个病根
这周 RISC-V 线上还有两笔修复值得一提:APLIC 的 EOI 时机(#11966,11-10 合入)和 PLIC 的完成次序(#12011,11-11 合入)。两位不同作者、独立提交,病根却是同一句话------完成动作和中断源的实际状态脱节。
APLIC 的问题是"不该写完成标记的时候写了",导致 QEMU 开 AIA 后测试程序输出一行就停住;PLIC 的问题是"该先处理的时候先完成了",修完还要在完成前后临时置位使能寄存器,参照了 Linux 的 SiFive PLIC 驱动。加上 FPU 修复,RISC-V 这条线一周闭环三笔,社区对这个架构的投入明显在加码。
#mermaid-svg-JbxW10pctQUbadCE{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-JbxW10pctQUbadCE .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-JbxW10pctQUbadCE .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-JbxW10pctQUbadCE .error-icon{fill:#552222;}#mermaid-svg-JbxW10pctQUbadCE .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-JbxW10pctQUbadCE .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-JbxW10pctQUbadCE .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-JbxW10pctQUbadCE .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-JbxW10pctQUbadCE .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-JbxW10pctQUbadCE .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-JbxW10pctQUbadCE .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-JbxW10pctQUbadCE .marker{fill:#333333;stroke:#333333;}#mermaid-svg-JbxW10pctQUbadCE .marker.cross{stroke:#333333;}#mermaid-svg-JbxW10pctQUbadCE svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-JbxW10pctQUbadCE p{margin:0;}#mermaid-svg-JbxW10pctQUbadCE .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-JbxW10pctQUbadCE .cluster-label text{fill:#333;}#mermaid-svg-JbxW10pctQUbadCE .cluster-label span{color:#333;}#mermaid-svg-JbxW10pctQUbadCE .cluster-label span p{background-color:transparent;}#mermaid-svg-JbxW10pctQUbadCE .label text,#mermaid-svg-JbxW10pctQUbadCE span{fill:#333;color:#333;}#mermaid-svg-JbxW10pctQUbadCE .node rect,#mermaid-svg-JbxW10pctQUbadCE .node circle,#mermaid-svg-JbxW10pctQUbadCE .node ellipse,#mermaid-svg-JbxW10pctQUbadCE .node polygon,#mermaid-svg-JbxW10pctQUbadCE .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-JbxW10pctQUbadCE .rough-node .label text,#mermaid-svg-JbxW10pctQUbadCE .node .label text,#mermaid-svg-JbxW10pctQUbadCE .image-shape .label,#mermaid-svg-JbxW10pctQUbadCE .icon-shape .label{text-anchor:middle;}#mermaid-svg-JbxW10pctQUbadCE .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-JbxW10pctQUbadCE .rough-node .label,#mermaid-svg-JbxW10pctQUbadCE .node .label,#mermaid-svg-JbxW10pctQUbadCE .image-shape .label,#mermaid-svg-JbxW10pctQUbadCE .icon-shape .label{text-align:center;}#mermaid-svg-JbxW10pctQUbadCE .node.clickable{cursor:pointer;}#mermaid-svg-JbxW10pctQUbadCE .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-JbxW10pctQUbadCE .arrowheadPath{fill:#333333;}#mermaid-svg-JbxW10pctQUbadCE .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-JbxW10pctQUbadCE .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-JbxW10pctQUbadCE .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-JbxW10pctQUbadCE .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-JbxW10pctQUbadCE .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-JbxW10pctQUbadCE .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-JbxW10pctQUbadCE .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-JbxW10pctQUbadCE .cluster text{fill:#333;}#mermaid-svg-JbxW10pctQUbadCE .cluster span{color:#333;}#mermaid-svg-JbxW10pctQUbadCE div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-JbxW10pctQUbadCE .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-JbxW10pctQUbadCE rect.text{fill:none;stroke-width:0;}#mermaid-svg-JbxW10pctQUbadCE .icon-shape,#mermaid-svg-JbxW10pctQUbadCE .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-JbxW10pctQUbadCE .icon-shape p,#mermaid-svg-JbxW10pctQUbadCE .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-JbxW10pctQUbadCE .icon-shape .label rect,#mermaid-svg-JbxW10pctQUbadCE .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-JbxW10pctQUbadCE .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-JbxW10pctQUbadCE .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-JbxW10pctQUbadCE :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 中断与上下文的一类病根
FPU:切换动作与寄存器现场脱节
APLIC:EOI 与中断源状态脱节
PLIC:完成次序与处理次序脱节
修法:把现场完整存进帧里
修法:先判断设备是否仍拉中断
修法:先派发处理再写完成
共同点:动作之前
先对齐真实状态
🧭 六、给移植者的三个提醒
第一,别信"代码全对就是没问题"。 上下文切换这类 bug 的特点是逻辑上看不见------C 代码层面一切都对,问题藏在汇编级的寄存器保存清单里。怀疑上下文问题时,直接写寄存器哨兵测试:线程 A 填特征值,切出去再切回来,逐个寄存器比对。
第二,复现环境越素越好。 这次能在官方 QEMU 最小环境复现,是快速定位的关键。板级问题的第一步永远是"回到官方参考平台",把变量清到最少。
第三,盯一下你内核的版本状态。 RT-Thread 主干自报 5.4.0 开发态,正式版还停在 9 月 10 日的 v5.3.0------这批修复(包括 FPU、中断、以及同周合入的六笔 CVE 补丁)要等下一个发行版才进正式tag。急着用的,可以直接从主线 cherry-pick。
#mermaid-svg-grN6fUXYIoH7FVCd{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-grN6fUXYIoH7FVCd .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-grN6fUXYIoH7FVCd .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-grN6fUXYIoH7FVCd .error-icon{fill:#552222;}#mermaid-svg-grN6fUXYIoH7FVCd .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-grN6fUXYIoH7FVCd .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-grN6fUXYIoH7FVCd .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-grN6fUXYIoH7FVCd .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-grN6fUXYIoH7FVCd .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-grN6fUXYIoH7FVCd .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-grN6fUXYIoH7FVCd .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-grN6fUXYIoH7FVCd .marker{fill:#333333;stroke:#333333;}#mermaid-svg-grN6fUXYIoH7FVCd .marker.cross{stroke:#333333;}#mermaid-svg-grN6fUXYIoH7FVCd svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-grN6fUXYIoH7FVCd p{margin:0;}#mermaid-svg-grN6fUXYIoH7FVCd defs #statediagram-barbEnd{fill:#333333;stroke:#333333;}#mermaid-svg-grN6fUXYIoH7FVCd g.stateGroup text{fill:#9370DB;stroke:none;font-size:10px;}#mermaid-svg-grN6fUXYIoH7FVCd g.stateGroup text{fill:#333;stroke:none;font-size:10px;}#mermaid-svg-grN6fUXYIoH7FVCd g.stateGroup .state-title{font-weight:bolder;fill:#131300;}#mermaid-svg-grN6fUXYIoH7FVCd g.stateGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-grN6fUXYIoH7FVCd g.stateGroup line{stroke:#333333;stroke-width:1;}#mermaid-svg-grN6fUXYIoH7FVCd .transition{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-grN6fUXYIoH7FVCd .stateGroup .composit{fill:white;border-bottom:1px;}#mermaid-svg-grN6fUXYIoH7FVCd .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px;}#mermaid-svg-grN6fUXYIoH7FVCd .state-note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-grN6fUXYIoH7FVCd .state-note text{fill:black;stroke:none;font-size:10px;}#mermaid-svg-grN6fUXYIoH7FVCd .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-grN6fUXYIoH7FVCd .edgeLabel .label rect{fill:#ECECFF;opacity:0.5;}#mermaid-svg-grN6fUXYIoH7FVCd .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-grN6fUXYIoH7FVCd .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-grN6fUXYIoH7FVCd .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-grN6fUXYIoH7FVCd .edgeLabel .label text{fill:#333;}#mermaid-svg-grN6fUXYIoH7FVCd .label div .edgeLabel{color:#333;}#mermaid-svg-grN6fUXYIoH7FVCd .stateLabel text{fill:#131300;font-size:10px;font-weight:bold;}#mermaid-svg-grN6fUXYIoH7FVCd .node circle.state-start{fill:#333333;stroke:#333333;}#mermaid-svg-grN6fUXYIoH7FVCd .node .fork-join{fill:#333333;stroke:#333333;}#mermaid-svg-grN6fUXYIoH7FVCd .node circle.state-end{fill:#9370DB;stroke:white;stroke-width:1.5;}#mermaid-svg-grN6fUXYIoH7FVCd .end-state-inner{fill:white;stroke-width:1.5;}#mermaid-svg-grN6fUXYIoH7FVCd .node rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-grN6fUXYIoH7FVCd .node polygon{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-grN6fUXYIoH7FVCd #statediagram-barbEnd{fill:#333333;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-cluster rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-grN6fUXYIoH7FVCd .cluster-label,#mermaid-svg-grN6fUXYIoH7FVCd .nodeLabel{color:#131300;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-cluster rect.outer{rx:5px;ry:5px;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-state .divider{stroke:#9370DB;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-state .title-state{rx:5px;ry:5px;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-cluster.statediagram-cluster .inner{fill:white;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-cluster.statediagram-cluster-alt .inner{fill:#f0f0f0;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-cluster .inner{rx:0;ry:0;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-state rect.basic{rx:5px;ry:5px;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#f0f0f0;}#mermaid-svg-grN6fUXYIoH7FVCd .note-edge{stroke-dasharray:5;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-note text{fill:black;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram-note .nodeLabel{color:black;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagram .edgeLabel{color:red;}#mermaid-svg-grN6fUXYIoH7FVCd #dependencyStart,#mermaid-svg-grN6fUXYIoH7FVCd #dependencyEnd{fill:#333333;stroke:#333333;stroke-width:1;}#mermaid-svg-grN6fUXYIoH7FVCd .statediagramTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-grN6fUXYIoH7FVCd :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 移植中发现异常
回归官方平台复现
定位切换帧缺陷
补丁评审
已合入主线
等待下个发行版
📎 七、小结
这是一次教科书级的社区闭环:较真的移植者、四小时出补丁的维护者、五天十小时的完整周期。但对使用者来说,更该记住的是那个警钟------浮点上下文不完整,不会让程序崩,只会让结果悄悄错。在你的领域,这种错比崩溃贵得多。
v5.3.0 之后的所有这些修复,都值得在你下一次升级 RTOS 时认真读一遍 changelog。