Skip to content

fix typo; fix integer overflow for 32bit systems - #34

Open
MrEcco wants to merge 1 commit into
coveooss:masterfrom
MrEcco:master
Open

fix typo; fix integer overflow for 32bit systems#34
MrEcco wants to merge 1 commit into
coveooss:masterfrom
MrEcco:master

Conversation

@MrEcco

@MrEcco MrEcco commented May 2, 2026

Copy link
Copy Markdown

Got this error while building your gotemplate project for linux/arm/v6 and linux/arm/v7. This looks like an obvious miss of support of 32bit -based systems. I bet you skip such systems because of various places where it might not work, but if this PR doesn't hurt then it might be a small stop toward it.
I'm not familiar with where you use this library, so cannot guarantee it doesn't break something :)

@MrEcco

MrEcco commented May 2, 2026

Copy link
Copy Markdown
Author

Look here:

if levelNum == int(DisabledLevel) {
. You do int(math.MaxUint32) and for 32-bit size pointers it collapses.

@MrEcco

MrEcco commented May 2, 2026

Copy link
Copy Markdown
Author

Tried to build my Dockerfile like this:

ARG GOTEMPLATE_VERSION=3.12.0
RUN cd /tmp                                  && \
    apk add --no-cache                          \
        git                                     \
        go                                   && \
    git config --global advice.detachedHead false && \
    git clone --depth 1 --branch v${GOTEMPLATE_VERSION} https://github.com/coveooss/gotemplate && \
    cd gotemplate                            && \
    go build -ldflags "-s -w" .              && \
    strip -g -S -d --strip-debug ./gotemplate
# command
docker buildx build --progress plain --platform linux/arm/v7 .
docker buildx build --progress plain --platform linux/arm/v6 .

Got this error:

......
9.558 go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
9.564 go: downloading github.com/kevinburke/ssh_config v1.2.0
9.602 go: downloading github.com/skeema/knownhosts v1.3.0
9.610 go: downloading github.com/xanzy/ssh-agent v0.3.3
9.647 go: downloading github.com/cloudflare/circl v1.5.0
48.30 # github.com/coveooss/multilogger
48.30 /root/go/pkg/mod/github.com/coveooss/multilogger@v0.6.0/level.go:43:22: constant 4294967295 overflows int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant