Skip to content

YACReaderLibraryServer SIGSEGV when starting before network is up (race at boot, Qt 6.11.0) #538

@simonbcn

Description

@simonbcn

Summary

YACReaderLibraryServer 10.0.0 crashes with SIGSEGV instead of returning a clean error when started before its configured listen IP is bound to any interface. This happens reliably when the server is launched as a systemd user unit at boot, before NetworkManager has finished applying the static IP.

A clean error would let Restart=always recover within seconds; the SIGSEGV trips systemd's StartLimitBurst and the service stays dead until manual intervention.

Environment

  • YACReader 10.0.0 (AUR package created by me)
  • Qt 6.11.0
  • systemd user unit (/usr/lib/systemd/user/yacreaderlibraryserver.service) with loginctl enable-linger for autostart at boot
  • Static IPv4 (192.168.1.3) on Ethernet, NetworkManager-managed, NetworkManager-wait-online.service enabled

Timeline at boot (from journalctl)

t+9.3 s  YACReaderLibraryServer starts → reaches "YACReaderLibrary starting" → SIGSEGV
t+9.9 s  restart 2 → SIGSEGV
t+10.5 s restart 3 → SIGSEGV
t+11.0 s restart 4 → SIGSEGV
t+11.6 s restart 5 → SIGSEGV
t+12.2 s restart 6 → SIGSEGV
         systemd: start-limit-hit, gives up
t+12.9 s NetworkManager: enp68s0 activated, IP 192.168.1.3 bound
t+12.9 s system reaches network-online.target

The crash happens consistently between log lines YACReaderLibrary starting and Running on "192.168.1.3:8080", i.e. during the listen socket setup.

When started manually 9 hours later (network already up), the same binary boots fine and the equivalent init step (Libraries → STATUS: OK) takes ~700 ms vs ~100 ms in the crashing runs — consistent with the network not being ready in the fast path.

Expected behaviour

bind() on an IP not assigned to any interface should return EADDRNOTAVAIL. The server should log the error, exit non-zero (or retry internally), and let the supervisor recover. It should not SIGSEGV.

Reproduction

  1. Configure the server to listen on a specific IP (not 0.0.0.0).
  2. Launch the server while that IP is not yet present on any interface (e.g. before NetworkManager assigns it, or in a netns where it doesn't exist).

Notes on coredump

Coredumps are disabled on my system (Storage: none in coredump.conf), so no backtrace attached. Happy to enable and reproduce if a stack trace would help — please let me know.

Related

systemd-side, user units silently can't wait on network-online.target (systemd/systemd#3312, open since 2016). But the practical fix here is to make the server fail gracefully on bind() errors — that alone would make Restart=always enough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions