Skip to content

sops-install-secrets built with Go 1.25.10 crashes before main with runtime bad TinySizeClass #958

Description

@bogorad

Summary

After updating sops-nix to commit 9ed65852b6257fbeae4355bc24ecfea307ca759a, my NixOS system build fails because the generated sops-install-secrets binary crashes before entering main.

The binary was built with Go 1.25.10.

Pinning sops-nix back to c591bf665727040c6cc5cb409079acb22dcce33c fixes the build.

Failure

The failing derivation is a generated manifest.json derivation whose checkPhase runs:

sops-install-secrets -check-mode=sopsfile "$out"

That check crashes with:

fatal error: bad TinySizeClass
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw({0x1b4027c?, 0x2cfa7a0?})
        runtime/panic.go:1094 +0x48
runtime.mallocinit()
        runtime/malloc.go:377 +0x39d
runtime.schedinit()
        runtime/proc.go:875 +0xfd
runtime.rt0_go()
        runtime/asm_amd64.s:349 +0x11c

Running the built binary directly also reproduces the crash, without needing any secrets or manifest input:

/nix/store/3m6yipp6zkjip9vhvdv7wg3mqf1s15a4-sops-install-secrets-0.0.1/bin/sops-install-secrets --help

Binary Metadata

go version -m reports:

/nix/store/3m6yipp6zkjip9vhvdv7wg3mqf1s15a4-sops-install-secrets-0.0.1/bin/sops-install-secrets: go1.25.10
path    github.com/Mic92/sops-nix/pkgs/sops-install-secrets
build   -buildmode=exe
build   -compiler=gc
build   -trimpath=true
build   CGO_ENABLED=1
build   GOARCH=amd64
build   GOOS=linux
build   GOAMD64=v1

The executable is dynamically linked:

ELF 64-bit LSB executable, x86-64, dynamically linked
interpreter: glibc-2.42-61/lib/ld-linux-x86-64.so.2

Version Range

Broken:

sops-nix rev 9ed65852b6257fbeae4355bc24ecfea307ca759a
Go compiler/runtime: go1.25.10

Working after rollback:

sops-nix rev c591bf665727040c6cc5cb409079acb22dcce33c

Impact

This prevents nixos-rebuild from completing on a system using the NixOS sops-nix module, because manifest.json.drv fails, then activate.drv, dry-activate.drv, and the final nixos-system-* derivation fail as downstream dependencies.

Notes

The crash happens before program code runs, so this does not appear to be caused by a malformed secret or manifest. The same binary crashes on --help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions