Skip to content

Dangling symlinks cause spread to panic #288

Description

@mr-cal

Dangling symlinks in a spread test suite directory cause spread to panic with no useful error output. I can only reproduce this on self-hosted runners with the spread-installed tag.

Error:

Run spread google:ubuntu-24.04-64
  spread google:ubuntu-24.04-64
  shell: /usr/bin/bash -e {0}
  env:
    SPREAD_GOOGLE_KEY:
    UA_TOKEN: ***
    RUN_UA_TESTS: true
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x74bb25]
Error: Process completed with exit code 2.

I accidentally had a dangling symlink when removing a shared test like this:

tests/spread/
├── _common/
│   └── test-1/  ← deleted
├── core22/
│   └── test-1 -> ../_common/test-1  ← deleted
├── core24/
│   └── test-1 -> ../_common/test-1  ← deleted
└── core26/
    └── test-1 -> ../_common/test-1  ← dangling (forgotten, causes the panic)

See canonical/snapcraft#6198 and https://github.com/canonical/snapcraft/actions/runs/24582803735/job/71885536820?pr=6198 for a reproducer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions