Object::ID object_id is not stable across threads
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with Object::ID's t/threads.t and reproduce the failures on both the JVM and interpreter backends. Trace how Hash::FieldHash stores the parent thread's object ID across child-thread access, then verify that the test passes on both backends and that existing Hash::FieldHash and thread tests remain passing.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 38m
- Merged PRs (30d)
- 170
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1511 ·
-
area:backend area:cpan-port bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1508 · 1 comment ·
-
area:cpan-port area:platform enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
fglock/PerlOnJava#1507 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1506 ·
All issues in fglock/PerlOnJava
Similar issues
-
documentation Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
trizen/youtube-viewer#456 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
connectivity Open
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Common US ingredient names are not recognized, so about 12.4k US products miss an allergen warning Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openfoodfacts/openfoodfacts-server#14657 · 4 comments ·