[email protected]: empty pseudo class from format_timespan() causes heap over-read in St find_class_name() and crashes Cinnamon
维护者通常 8 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- desktop
调研方向
Start with files/usr/share/cinnamon/applets/[email protected]/eventView.js and trace how format_timespan()'s pseudo class reaches update_variations(). Then inspect src/st/st-widget.c, especially find_class_name(), and the attached reproduction details. Confirm the fix prevents the crash for events starting 60 minutes or more later today while preserving their countdown text.
由索引模型根据 Issue 内容生成。
描述
Distribution
NixOS 26.05
Package version
6.6.8
Graphics hardware in use
not relevant
Frequency
Only occasionally
Bug description
Cinnamon sometimes segfaults right after login, or when the calendar server updates events. Then the "fallback mode / restart Cinnamon?" dialog appears. It only happens when there are calendar events, and it happens at random.
Steps to reproduce
In Cinnamon (random, depends on heap layout):
- Have a calendar with an event today that starts 60 minutes or more from now, so it shows in the calendar applet.
- Log in, or wait for the calendar server to send an event update.
- Sometimes Cinnamon segfaults with the stack trace above.
Expected behavior
Cinnamon does not crash. An event that starts later today shows its countdown text ("In 2 hours", "Starting later today", …) without adding a pseudo class.
Additional information
Cause
format_timespan()infiles/usr/share/cinnamon/applets/[email protected]/eventView.jsreturns""as the pseudo class for events that start today 60 minutes or more from now (return ["", ...]).update_variations()passes it on unconditionally:countdown_labelis the last child oflabel_box.st_widget_last_child_notify()has already given it the pseudo classlast-child, soclass_listis not empty.- In
src/st/st-widget.c,find_class_name()loops withstrstr (match + 1, class_name). Withclass_name == "",strstrnever returns NULL. Forclass_list = "last-child"no position meets the conditions, so the loop steps past the terminating NUL and keeps reading heap memory. It stops either when some bytes happen to match (no crash, but a bogus "found" result) or when it reaches an unmapped page (segfault). This is why the crash is random.
- 主要语言
- JavaScript
- 星标
- 5.7k
- 派生
- 941
- 平均合并
- 6 天 18 小时
- 30 天内合并 PR
- 12
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linuxmint/cinnamon 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 8 天内回复
-
BUG
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 8 天内回复
-
BUG
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 8 天内回复
-
Menu applet omits descriptions from search-provider results可能已有人在做 @ah682 于 9 天前认领。 未关闭BUG
难度 2/5 1-3 小时 新手友好度 66/100
linuxmint/cinnamon#14104 · 2 条评论 ·
维护者通常 8 天内回复
-
xapp-status applet: status icon labels are ellipsized to "..." when the panel zone is a fraction of a pixel short可能重新可做 @Priyeshshrivastav 于 15 天前认领,目前没有进行中的 PR。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
linuxmint/cinnamon#14096 · 1 条评论 ·
维护者通常 8 天内回复
查看 linuxmint/cinnamon 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
mailcow/mailcow-dockerized#7677 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
gcivil-nyu-org/team5-mon-fall26#145 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
needs discussion
难度 2/5 1-3 小时 新手友好度 78/100
openfga/openfga.dev#1436 · 1 条评论 ·
维护者通常 2 天内回复