Skip to content

🐛 Fix mql compiler on 32-bit architectures#6319

Merged
chris-rock merged 1 commit intomainfrom
jdm/raspi
Dec 18, 2025
Merged

🐛 Fix mql compiler on 32-bit architectures#6319
chris-rock merged 1 commit intomainfrom
jdm/raspi

Conversation

@jaym
Copy link
Copy Markdown
Contributor

@jaym jaym commented Dec 18, 2025

We were losing the top 32 bits of a reference

panic: panic compiling "asset.family.contains('linux')\npackages.where(name == /xorg|xserver|wayland/i).any(installed)\n": cannot compute checksum for chunk, it doesn't seem to reference a function on the stack -- map[assetMrn://assets.api.mondoo.app/spaces/*/assets/30Ky6WLkHDJMhi2repLO6yNUija assetName:adsbexchange assetPlatform:raspbian assetPlatformVersion:11 platformIDs://platformid.api.mondoo.app/hostname/adsbexchange spaceMrn://captain.api.mondoo.app/spaces/*]

goroutine 151 [running]:
runtime/debug.Stack()
	/home/runner/_work/_tool/go/1.25.1/x64/src/runtime/debug/stack.go:26 +0x78
go.mondoo.com/cnquery/v12/providers-sdk/v1/upstream/health.ReportPanic({0x2968410, 0x6}, {0x2e20958, 0x7}, {0x2e20960, 0x7}, {0x66854d4, 0x1, 0x1})
	/[email]/providers-sdk/v1/upstream/health/errors.go:32 +0xc8
panic({0x2575198, 0x66af9c8})
	/home/runner/_work/_tool/go/1.25.1/x64/src/runtime/panic.go:783 +0xfc
go.mondoo.com/cnquery/v12/mqlc.Compile.func1()
	/[email]/mqlc/mqlc.go:2239 +0xd4
panic({0x24c7778, 0x2e1d830})
	/home/runner/_work/_tool/go/1.25.1/x64/src/runtime/panic.go:783 +0xfc
go.mondoo.com/cnquery/v12/llx.(*Function).checksumV2(0x6984f30, 0x6984240)
	/[email]/llx/chunk.go:118 +0x264
go.mondoo.com/cnquery/v12/llx.(*Chunk).ChecksumV2(0x6984f00, 0x1, 0x6984240)
	/[email]/llx/chunk.go:105 +0x1d0
go.mondoo.com/cnquery/v12/llx.(*Block).AddChunk(0x60992c0, 0x6984240, 0x1, 0x6984f00)
	/[email]/llx/code.go:57 +0x44
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks.func2(0x698b980, {0x6876500, 0x1, 0x10}, 0x1, 0x60992c0, 0x6984a20)
	/[email]/mqlc/mqlc.go:1813 +0x438
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks.func6(0x698b970, 0x680ca80, {0x6876500, 0x1, 0x10})
	/[email]/mqlc/mqlc.go:1875 +0x68
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks.func3(0x698b970, 0x680ca68, {0x6876500, 0x0, 0x10}, 0x680cae0)
	/[email]/mqlc/mqlc.go:1831 +0x2a4
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks(0x686d650, 0x10000000b)
	/[email]/mqlc/mqlc.go:1873 +0xa18
go.mondoo.com/cnquery/v12/mqlc.(*compiler).postCompile(0x686d650)

We were losing the top 32 bits of a reference

```
panic: panic compiling "asset.family.contains('linux')\npackages.where(name == /xorg|xserver|wayland/i).any(installed)\n": cannot compute checksum for chunk, it doesn't seem to reference a function on the stack -- map[assetMrn://assets.api.mondoo.app/spaces/*/assets/30Ky6WLkHDJMhi2repLO6yNUija assetName:adsbexchange assetPlatform:raspbian assetPlatformVersion:11 platformIDs://platformid.api.mondoo.app/hostname/adsbexchange spaceMrn://captain.api.mondoo.app/spaces/*]

goroutine 151 [running]:
runtime/debug.Stack()
	/home/runner/_work/_tool/go/1.25.1/x64/src/runtime/debug/stack.go:26 +0x78
go.mondoo.com/cnquery/v12/providers-sdk/v1/upstream/health.ReportPanic({0x2968410, 0x6}, {0x2e20958, 0x7}, {0x2e20960, 0x7}, {0x66854d4, 0x1, 0x1})
	/[email]/providers-sdk/v1/upstream/health/errors.go:32 +0xc8
panic({0x2575198, 0x66af9c8})
	/home/runner/_work/_tool/go/1.25.1/x64/src/runtime/panic.go:783 +0xfc
go.mondoo.com/cnquery/v12/mqlc.Compile.func1()
	/[email]/mqlc/mqlc.go:2239 +0xd4
panic({0x24c7778, 0x2e1d830})
	/home/runner/_work/_tool/go/1.25.1/x64/src/runtime/panic.go:783 +0xfc
go.mondoo.com/cnquery/v12/llx.(*Function).checksumV2(0x6984f30, 0x6984240)
	/[email]/llx/chunk.go:118 +0x264
go.mondoo.com/cnquery/v12/llx.(*Chunk).ChecksumV2(0x6984f00, 0x1, 0x6984240)
	/[email]/llx/chunk.go:105 +0x1d0
go.mondoo.com/cnquery/v12/llx.(*Block).AddChunk(0x60992c0, 0x6984240, 0x1, 0x6984f00)
	/[email]/llx/code.go:57 +0x44
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks.func2(0x698b980, {0x6876500, 0x1, 0x10}, 0x1, 0x60992c0, 0x6984a20)
	/[email]/mqlc/mqlc.go:1813 +0x438
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks.func6(0x698b970, 0x680ca80, {0x6876500, 0x1, 0x10})
	/[email]/mqlc/mqlc.go:1875 +0x68
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks.func3(0x698b970, 0x680ca68, {0x6876500, 0x0, 0x10}, 0x680cae0)
	/[email]/mqlc/mqlc.go:1831 +0x2a4
go.mondoo.com/cnquery/v12/mqlc.(*compiler).addValueFieldChunks(0x686d650, 0x10000000b)
	/[email]/mqlc/mqlc.go:1873 +0xa18
go.mondoo.com/cnquery/v12/mqlc.(*compiler).postCompile(0x686d650)
```
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 18, 2025

Test Results

4 703 tests  +2 966   4 699 ✅ +2 964   2m 23s ⏱️ + 1m 10s
  415 suites +  308       4 💤 +    3 
   31 files   +   30       0 ❌  -     1 

Results for commit 898f05e. ± Comparison against base commit d276853.

♻️ This comment has been updated with latest results.

@chris-rock chris-rock merged commit 51d3eca into main Dec 18, 2025
34 of 36 checks passed
@chris-rock chris-rock deleted the jdm/raspi branch December 18, 2025 17:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants