[1287] 移除颜色选择器中的颜色预览,修复渐变选择器改前景色崩溃 (issue #4325) - #4528
Merged
Conversation
pattern-selector 对话框改前景色时 set-color 同步 refresh-now 两个 refreshable,QTMRefreshableWidget::doRefresh 中 delete qwid 会在信号 发射途中析构 enum 所在子树(devel/1200.md,deleteLater 未根治)。 本改动移除 pattern-sample 预览画布及对应 refresh-now,作为最小改动 试验:若崩溃消失则损坏源与预览刷新/渲染路径相关;若仍在则确认 options 子树同步重建问题,按 issue 计划推进 QML 重构。 pattern / gradient / picture 三个选择器共用该界面,预览一并移除; pattern-tools.scm 在 main 上为死代码,不动。
Xvfb+xdotool 对照实验(同一二进制,仅切换 scheme 树): - 基线 main:改前景色为红色立即 SIGABRT(malloc(): unaligned tcache chunk detected),复现成立; - 修复树:同一操作路径不崩溃,前景色成功改红,连续 5 次换色与确认 按钮均正常,stderr 无 glibc 报错; - 结论:第一现场在 pattern-sample 预览画布的同步重建路径,options 面板的同步 delete 并非第一现场(亦解释 deleteLater 未生效)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
issue #4325:插入高亮环境 → 焦点工具栏「文本背景色」→ 下拉选「渐变」→ 渐变选择器中把前景色从黑改红 → 进程 SIGABRT(glibc 报
malloc(): unaligned tcache chunk detected,堆损坏后按钮重绘分配内存时踩雷)。已有分析见
da/1200/crash分支devel/1200.md:refresh-now同步重建控件子树 +doRefresh中delete qwid的 UAF 方向;deleteLater试验未生效。本 PR 的修复方式
移除颜色选择器对话框中的颜色预览(
pattern-sample画布,TeXmacs/progs/generic/pattern-selector.scm):(tm-widget ((pattern-selector u) cmd))中(refreshable "pattern-sample" ...)预览画布及其分隔;set-color中对应的(refresh-now "pattern-sample")(该名字已无对应 refreshable,本是无害 no-op,一并清理)。Pattern / Gradient / Picture 三个选择器共用该界面,预览一并移除。纯 scheme 改动,无需重编 C++。
自动化对照验证(Xvfb + xdotool 驱动真实 GUI)
同一
moganstem二进制,仅切换TEXMACS_PATH(基线 =main@69af5c889,修复 = 本分支),scheme 延迟打开渐变选择器对话框,xdotool 点击「前景色」下拉并选择「红色」:SIGABRT(malloc(): unaligned tcache chunk detected),崩溃栈与 issue 一致,复现成立Pattern 选择器(共用界面)打开、布局正常,交互冒烟存活。全程截图确认控件位置与状态,验证细节与结论已回填本分支
devel/1287.md。结论与影响
pattern-sample预览画布的同步重建/渲染路径;移除预览后 issue 复现路径不再崩溃;doRefresh("pattern-options")并非第一现场,也解释了deleteLater未生效的原因;Closes #4325