Skip to content

ci: ESP32 builds SIGKILLed (exit -9) compiling unity TUs — not OOM; correlates with fbuild 2.5.30 #4675

Closed

Description

@zackees

Summary

ESP32-family board builds in CI are being SIGKILLed (exit code -9, nothing on stderr) while compiling FastLED's unity translation units. This happens on master, not only on PRs. Every failing job reports:

build error: build failed: local library 'FastLED' failed to compile: build failed: build failed:
failed to compile .../.build/fbuild/<board>/lib/FastLED/fl/build/fl.fx+.cpp in library FastLED (exit code -9):
(the compiler wrote nothing to stderr)

Exit code -9 with no compiler output means the compiler was killed: the runner ran out of memory, or something else sent SIGKILL. It is not a C++ error.

Evidence

On master (dbe9874bc1): the workflow_dispatch of build.yml (run 37067979086) failed on:

  • build_esp32dev / build: fl.fx+.cpp, exit -9.
  • build_esp32_c3_devkitm_1 / build: fl.fx+.cpp, exit -9.

On PR #4673 (dither refactor), the same kill appeared on these jobs:

Job Unity file
esp32c3 fl.fx+.cpp
esp32c5 fl.fx+.cpp
esp32dev_idf5_component fl.fx+.cpp
esp32dev_idf6 fl.fx+.cpp
esp32c3 QEMU (BlinkParallel) fl.fx+.cpp
rgbw (esp32s3) platforms+.cpp

It is non-deterministic. On the PR, rerunning esp32dev_idf5_component with no code change turned it green.

Unity files seen so far: fl.fx+.cpp (most), platforms+.cpp.

Suspects to investigate

  1. Peak compile memory of the fl.fx unity TU on Xtensa/RISC-V GCC. It concatenates every src/fl/fx/** source. Measure peak RSS per unity TU locally, for example under /usr/bin/time -v or with fbuild's own reporting, for esp32dev and esp32c3.
  2. Parallelism × per-TU memory. If fbuild compiles several heavy unity TUs at once on a 2-core / 7 GB hosted runner, the sum can exceed RAM. Check the -j/worker count fbuild uses in CI.
  3. Header weight. Any header that pulls <Arduino.h> (and through it the whole ESP-IDF set) into every unity TU multiplies memory. led_sysdefs.h → fl/system/arduino.h → <Arduino.h> is one such path. PR refactor(dither): extract binary dithering into a tested, zero-cost, disableable module (#4672) #4673 had briefly added it to pixel_controller.h's include graph and is removing it again.

Fix direction

  • Split the fl.fx unity TU into smaller chunks, or exclude its heaviest members.
  • And/or cap concurrent heavy compiles in the CI build.

Whichever is chosen, measure peak RSS before and after and post the numbers on the PR. The fbuild side, if needed, is filed at FastLED/fbuild.

Activity

  1. changed the title [-]ci: ESP32 builds SIGKILLed (exit -9) compiling unity TUs fl.fx+.cpp / platforms+.cpp (OOM)[/-] [+]ci: ESP32 builds SIGKILLed (exit -9) compiling unity TUs — not OOM; correlates with fbuild 2.5.30[/+] on Oct 2, 2026
  2. zackees commented on Oct 2, 2026

    @zackees
    MemberAuthor

    Update: measurements say this is not OOM. I retitled the issue. Root cause is filed upstream as FastLED/fbuild#1628.

    Peak RSS per unity TU on esp32dev. Each captured fbuild compile was rerun alone and peak RSS read via wait4. The largest are platforms+ at 479 MiB, fl.gfx+ at 453 MiB and fl.fx+ at 426 MiB. fl.fx+ is the longest TU at 51 s. Every other TU is at or under 400 MiB.

    Parallelism. CI runs fbuild build with no -j, so fbuild uses cores*2. That is 8 jobs on the public ubuntu-latest runner, which has 4 vCPU and 16 GB, not 2 vCPU / 7 GB. A cold esp32c3 build at -j 8 peaked at 2.2 GB total cc1plus RSS.

    Local reproduction.

    • exit -9 happened twice on esp32c3 (fl.stl+, fl.channels+) with 82 GB free.
    • journalctl -k shows no OOM-killer event, so a userland process sent the SIGKILL.
    • Both runs used the shared fbuild daemon. With a private daemon, 5/5 cold builds passed.

    Version correlation.

    Other fbuild behaviour. A failed build's output is replayed verbatim to every later fbuild build in the same job. A retry in CI therefore cannot recover.

    What changes where.

    • Splitting fl.fx or capping -j would not fix this. The kill would just move to a different TU.
    • PR ci(build): print kill diagnostics when a board build fails (#4675) #4679 adds kill diagnostics to the CI failure step: free, kernel OOM records and the fbuild daemon log. The next occurrence will be diagnosable from CI alone.
    • Rolling back the fbuild pin is left to the maintainer.
  3. zackees commented on Oct 2, 2026

    @zackees
    MemberAuthor

    Root cause found upstream: fbuild's Linux owner-death signal (PR_SET_PDEATHSIG(SIGKILL)) is tied to the thread that forked the compiler, and fbuild 2.5.30+ forks library compiles from Tokio threads that can retire mid-compile. Fix with a regression test: FastLED/fbuild#1631 (details on FastLED/fbuild#1628).

    Plan: release fbuild 2.5.33 with the fix, move FastLED's pin, and confirm the ESP32 boards go green.

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions