Skip to content

Types::Numbers fails to load with Not a SCALAR reference #1231

Description

@fglock

Summary

The DBIx::BatchChunker v1.0.2 CPAN compatibility run fails while loading the distribution. The failure reduces to importing Types::Numbers v1.0.1, which raises Not a SCALAR reference under both PerlOnJava execution backends.

Minimal reproducer

#!/usr/bin/env perl
use strict;
use warnings;

use Types::Numbers;

print "Types::Numbers loaded successfully\n";

Expected output:

Types::Numbers loaded successfully

Results

  • System Perl: passes and prints the expected output.
  • PerlOnJava JVM backend: exits 255 with Not a SCALAR reference at (eval 222) line 98.
  • PerlOnJava interpreter backend: exits 255 with the same error.

The reproducer is also retained in the repository as dev/sandbox/reproducers/dbix_batchchunker_types_numbers.pl.

Original CPAN failure

  • Distribution: DBIx::BatchChunker v1.0.2
  • CPAN run: 20260902-193404-39801
  • Result: 2/3 subtests failed; 8/12 test programs failed
  • Both DBIx::BatchChunker and DBIx::BatchChunker::LoopState failed their compile/load checks with Not a SCALAR reference.
  • The failure occurs during module loading, before the database behavior tests can execute.

The target distribution is pure Perl. Its dependency chain includes Types::Numbers, Type::Tiny, Moo, and database-related modules. System Perl successfully loads the target modules after the missing prerequisites are installed in an isolated environment. Some DB integration tests require a file-backed SQLite DSN because the upstream tests create a second connection to an in-memory database; that setup issue is separate from this deterministic module-load failure.

Suspected ownership

The first failing dependency is Types::Numbers, not DBIx::BatchChunker itself. The error likely involves compiler/runtime handling of a scalar reference or generated Type::Tiny/Moo code. The failure is present on both backends, so it should be investigated in shared parsing/compiler/runtime behavior rather than only one backend.

This does not currently appear to be a regex-engine defect: the reducer fails during module initialization, and no regex matching operation is required to trigger it.

Requested fix and coverage

  1. Inspect the generated/evaluated code path used while Types::Numbers initializes its Type::Tiny definitions.
  2. Reduce Not a SCALAR reference to the smallest Perl construct, identifying whether the cause is scalar-reference dereferencing, closure/code generation, type-library initialization, or runtime value representation.
  3. Add a focused project-owned regression test for the reduced construct.
  4. Verify system Perl, JVM PerlOnJava, and interpreter PerlOnJava behavior.
  5. Re-run DBIx::BatchChunker v1.0.2 as post-fix CPAN coverage.

Activity

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 providersarea:runtimeCore Perl runtime semanticsbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions