Object::ID object_id is not stable across threads
还没有人认领这个 Issue。
评估
调研方向
从 Object::ID 的 t/threads.t 开始,在 JVM 和 interpreter 两个后端上重现这些失败。跟踪 Hash::FieldHash 如何在子线程访问期间存储父线程的 object ID,然后验证测试在两个后端上都能通过,并且现有的 Hash::FieldHash 和线程测试仍然通过。
由索引模型根据 Issue 内容生成。
描述
Object::ID threaded object identity differs from system Perl
Summary
The CPAN compatibility run for Object::ID v0.1.2 reports 5 failing assertions in t/threads.t. The failure is reproducible on both the JVM backend and the interpreter backend and appears to be a PerlOnJava ithreads/object-identity bug involving the field storage used by Hash::FieldHash.
Evidence
- CPAN run:
20260916-111623-23683 - Distribution:
Object-IDv0.1.2 - Test:
t/threads.t - System Perl: the focused upstream test passes, including all 11 object identity assertions.
- PerlOnJava JVM backend: 5 of 11 assertions fail.
- PerlOnJava interpreter backend: 5 of 11 assertions fail.
The failing assertions all have the same shape:
object_id in a thread: got c, expected b
The test creates one object, records its object_id, then checks that the same object has the same ID from five child threads. PerlOnJava assigns a different ID in the child-thread view, while system Perl preserves the identity.
Suspected cause
Object::ID stores IDs in a Hash::FieldHash fieldhash. The parent thread assigns the object ID before starting the threads. When the object is accessed by a child thread, the fieldhash mapping does not appear to be preserved or shared with the cloned object state, so object_id allocates a new ID instead of returning the parent-thread ID.
Because both execution backends reproduce the same result, this is likely in shared thread/object cloning or fieldhash integration rather than in only one compiler backend.
Reverse-dependency impact
MetaCPAN reports 7 released distributions with a runtime dependency on Object::ID; one has a release within the last three years (StorageDisplay). The dependants include StorageDisplay, MooX-Struct, perl5i, Fey-ORM, Role-Commons, Test-Proto, and Module-Install-RDF.
The underlying Hash::FieldHash dependency has 17 released runtime dependants, but none has released within the last three years. This broader count is contextual; the observed defect is specifically threaded use of Object::ID, so the practical affected surface is narrower than the total dependant count.
Suggested acceptance criteria
Object::IDt/threads.tpasses on the JVM backend.- The same test passes on the interpreter backend.
- The object ID remains stable when the object is accessed from all child threads.
- Existing
Hash::FieldHashand thread tests continue to pass.
- 主要语言
- Perl
- 星标
- 64
- 派生
- 6
- 平均合并
- 5 小时 38 分钟
- 30 天内合并 PR
- 170
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fglock/PerlOnJava 的其他 Issue
-
area:cpan-port area:unicode bug
难度 2/5 1-3 小时 新手友好度 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1511 ·
-
area:backend area:cpan-port bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1508 · 1 条评论 ·
-
area:cpan-port area:platform enhancement
难度 5/5 一周以上 新手友好度 30/100
fglock/PerlOnJava#1507 ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1506 ·
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
documentation Needs Triage
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
trizen/youtube-viewer#456 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
connectivity 未关闭
难度 1/5 1 小时以内 新手友好度 80/100
-
Common US ingredient names are not recognized, so about 12.4k US products miss an allergen warning 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
openfoodfacts/openfoodfacts-server#14657 · 4 条评论 ·