Skip to content

Storable portable serialization loses MLDBM values and references #1468

Closed

Description

@fglock

Summary

MLDBM-2.05 fails under PerlOnJava because the bundled Storable implementation loses values when MLDBM switches to portable serialization.

Reproduction

The upstream test t/storable.t uses:

use MLDBM qw(SDBM_File Storable);
...
$obj->DumpMeth('portable');
...
my $d = [17];
$o{g} = $d;
$d = '';
is($o{g}->[0], 17);

PerlOnJava returns undef instead of 17 for the final assertion. The same test also fails the circular/reference comparison assertions at lines 28 and 54.

Evidence

  • Distribution: MLDBM-2.05
  • CPAN random tester run: 20260921-102914-97159
  • Failing test: t/storable.t
  • Standard Perl: PASS, 5 test programs and 19 tests
  • PerlOnJava JVM backend: FAIL, 3 of 9 tests in t/storable.t
  • PerlOnJava interpreter backend: FAIL, identically, 3 of 9 tests
  • The target distribution is pure Perl; this is not an XS/native dependency failure.

Expected behavior

PerlOnJava's Storable::freeze/thaw implementation should preserve circular references, shared references, and scalar values when used as MLDBM's portable serializer.

Acceptance criteria

  • MLDBM-2.05 passes the complete upstream suite on both PerlOnJava backends.
  • t/storable.t passes the circular/shared-reference comparisons and the final scalar retrieval assertion.
  • Add focused project-owned regression coverage for portable Storable serialization through MLDBM, including a value whose source reference is subsequently changed.
  • Preserve standard Perl behavior for Storable::freeze/thaw and nfreeze/thaw.

Activity

  1. added
    bugSomething isn't working
    area:cpan-portCPAN compatibility ports and providers
    area:backendJVM interpreter or execution-backend behavior
    on Sep 21, 2026
  2. fglock commented on Sep 21, 2026

    @fglock
    OwnerAuthor

    Cache 2.11 follow-up verification

    CPAN random-tester run 20260921-124328-13959 adds Cache 2.11 as another Storable compatibility case.

    Standard Perl baseline

    With the exact upstream sources and isolated pure-Perl prerequisites, system Perl passes the complete Cache suite:

    Files=14, Tests=592
    Result: PASS
    

    PerlOnJava results

    The pure-Perl Cache::Memory path reproduces on both PerlOnJava backends in t/memory.t. The test reaches complex-value storage and then fails during Storable::thaw with:

    Storable binary image v33.97 more recent than I am (v2.12)
    

    The archived run also reported a Cache::Memory::Entry missing-field failure while loading the same distribution. This is independent of the file-cache prerequisite and provides another downstream verification case for the Storable serialization issue tracked here.

    Cache::File additionally requires XS DB_File, which PerlOnJava cannot load. A reverse-dependency lookup for DB_File was attempted twice, including a cache refresh, but MetaCPAN returned HTTP 599 both times; its dependant count is therefore blocked rather than zero.

    Please include Cache 2.11 / t/memory.t in the post-fix verification for portable Storable serialization on both backends.

  3. fglock commented on Oct 19, 2026

    @fglock
    OwnerAuthor

    Follow-up after PR #1849: the MLDBM-oriented scalar-reference envelope fix is merged, with focused shared/circular graph coverage passing. This issue remains open pending the explicitly requested Cache 2.11 post-fix verification (including t/memory.t on both backends). Please keep this report open until that additional Storable compatibility case is checked.

  4. fglock commented on Oct 23, 2026

    @fglock
    OwnerAuthor

    Resolved by merged PR #1872. MLDBM 2.05 passes all 5 upstream files and 19 tests on JVM and interpreter. As requested in the follow-up, Cache 2.11 t/memory.t also passes all 81 tests on system Perl and both backends. Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendJVM interpreter or execution-backend behaviorarea:cpan-portCPAN compatibility ports and providersbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions