ckpool 1.2.0

Open Beginner friendly
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker

Research direction

Start in the Dockerfile and inspect the build steps around configure.ac, ./autogen.sh, and ./configure. Reproduce the v1.2.0 build on the available node hardware, then verify the resulting container starts without an Illegal instruction crash loop and that miners connect successfully.

Written by the indexing model from the issue text.

Description

Hi @lukechilds ,

I've been testing the update to ckpool v1.2.0 for my Umbrel app Bassin first on the community app store.

As you know, Bassin on the official Umbrel App Store uses ghcr.io/getumbrel/docker-ckpool-solo for security and verified build provenance. When testing the v1.2.0 build, I ran into an Illegal instruction (SIGILL) crash loop on node hardware (e.g. Raspberry Pi / non-server CPUs). I wanted to share the root cause and tested fix with you so the official Umbrel image doesn't hit it when you update.

──────
│ Caution

│ ### The Bug

│ Building v1.2.0 on GitHub Actions caused the container to crash immediately on node startup with:

│ ckpool_1 | Illegal instruction

│ Note

│ ### Root Cause

│ In upstream ckpool v1.2.0, commit 6f343f3 https://bitbucket.org/ckolivas/ckpool/commits/6f343f3ba424a267a529e01e11b8c70d0bcc7239 ("Add -g to default CFLAGS and mirror
│ them in CXX") moved the default flags check to line 1 of configure.ac:

│ if test -z "$CFLAGS"; then
│ CFLAGS="-g -O2 -Wall -march=native"

│ In v1.1.1, this check was placed after AC_PROG_CC (where Autoconf had already initialized CFLAGS), so -march=native was never applied. In v1.2.0, it is evaluated first,
│ causing GCC to compile with instructions specific to the GitHub Actions cloud runner CPU. When executed on an end-user device (like a Raspberry Pi 4 or older x86 mini-
│ PC), it crashes on unsupported instructions.

│ Tip

│ ### The Fix

│ In the Dockerfile, strip -march=native and explicitly pass portable baseline flags to ./configure:

│ # Hack to disable cpu based optimisations for more portable builds
│ # We just make sure the cpu arch checks fail so no optimisations are enabled
│ RUN sed -i "s/host_cpu = 'x86_64'/host_cpu = 'x86_64-disabled'/" configure.ac
│ RUN sed -i "s/host_cpu = 'aarch64'/host_cpu = 'aarch64-disabled'/" configure.ac
│ + RUN sed -i "s/-march=native//g" configure.ac

│ # Build
│ RUN ./autogen.sh
│ - RUN ./configure
│ + RUN ./configure CFLAGS="-O2 -Wall" CXXFLAGS="-O2 -Wall"
│ RUN make -j$(nproc)
──────
I've verified this build on my node with my community app store version of bassin and miners connect smoothly and everything is rock solid.

Happy to open a PR on getumbrel/docker-ckpool-solo whenever you're ready!

Dominant language
Dockerfile
Stars
3
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getumbrel/docker-ckpool-solo

All issues in getumbrel/docker-ckpool-solo

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.