Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build for arm 32 bit #619

Closed
mikeS7 opened this issue Feb 21, 2024 · 5 comments · Fixed by #620
Closed

Can't build for arm 32 bit #619

mikeS7 opened this issue Feb 21, 2024 · 5 comments · Fixed by #620
Labels
bug Something isn't working
Milestone

Comments

@mikeS7
Copy link

mikeS7 commented Feb 21, 2024

I've got the error when build for arm platform.

22.36 # github.com/dmachard/go-dnscollector/dnsutils
22.36 dnsutils/message.go:814:32: math.MaxUint32 (untyped int constant 4294967295) overflows int
22.36 dnsutils/message.go:824:32: math.MaxUint32 (untyped int constant 4294967295) overflows int

Run the following in docker:
RUN GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=0.41.0" -o /go/bin/go-dnscollector

@dmachard
Copy link
Owner

Did it work well before version 0.41.0?

@mikeS7
Copy link
Author

mikeS7 commented Feb 21, 2024

I've got such errors started from 0.40.1. Last version without error is 0.40.0

@dmachard
Copy link
Owner

Thank,

I think it related to the change introduced in v0.40.2 to fix the following code scanning alert:

Incorrect conversion of an integer with architecture-dependent bit size from to a lower bit size type uint16 without an upper bound check.

image

@dmachard dmachard added the bug Something isn't working label Feb 21, 2024
@dmachard
Copy link
Owner

I don't have access to an arm 32b platform, but I can reproduce with linux/386

52.44 # github.com/dmachard/go-dnscollector/dnsutils
52.44 dnsutils/message.go:814:32: math.MaxUint32 (untyped int constant 4294967295) overflows int
52.44 dnsutils/message.go:824:32: math.MaxUint32 (untyped int constant 4294967295) overflows int

@dmachard
Copy link
Owner

Fixed in main branch but tested only with linux/386 platform.
Any feedback will be appreciated.

@dmachard dmachard added this to the v0.42.0 milestone Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants