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

Linting segmentation violation #1552

Closed
hbh7 opened this issue Oct 10, 2024 · 2 comments · Fixed by #1696
Closed

Linting segmentation violation #1552

hbh7 opened this issue Oct 10, 2024 · 2 comments · Fixed by #1696
Labels
bug Something isn't working

Comments

@hbh7
Copy link
Member

hbh7 commented Oct 10, 2024

Encountered this while trying to build elasticsearch-7 in enterprise-packages. It may happen in other situations but I haven't run into any others yet. There was some internal speculation that it may have to do with this code section: https://github.com/chainguard-dev/melange/blob/20a8b52707cda4c05f47454d1d56ef2866c525e7/pkg/linter/linter.go#L66C7-L66C13

Error log:
Image

@hbh7
Copy link
Member Author

hbh7 commented Oct 16, 2024

Interestingly, this doesn't happen with MELANGE_EXTRA_OPTS=--runner=bubblewrap added after make. MELANGE_EXTRA_OPTS=--runner=docker runs into the segfault, and is the default on my setup.

@murraybd murraybd added the bug Something isn't working label Dec 11, 2024
@murraybd
Copy link
Contributor

I also ran into this crash when trying to build datadog-agent-nvml (after having added a build-dep on python).

2024/12/11 23:53:33 INFO pod 04f9b5d6ef40a6b00352ebc0c92c76a5239597487352c34e351b7371c07c1fa1 terminated
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x15f67ba]

goroutine 43 [running]:
chainguard.dev/melange/pkg/linter.init.allPaths.func4.1({0x203d8b8, 0x1}, {0x0, 0x0}, {0x162282d?, 0xc009ba7f80?})
        chainguard.dev/melange/pkg/linter/linter.go:66 +0x7a
io/fs.WalkDir({0x204a1e0, 0xc0078432b0}, {0x203d8b8, 0x1}, 0xc008afe490)
        io/fs/walk.go:120 +0xc3
chainguard.dev/melange/pkg/linter.init.allPaths.func4({0x2072d28?, 0xc0006ce2a0?}, {0x1d9c616?, 0x6?}, {0x204a1e0?, 0xc0078432b0?})
        chainguard.dev/melange/pkg/linter/linter.go:62 +0x72
chainguard.dev/melange/pkg/linter.lintPackageFS({0x2072d28, 0xc0006ce2a0}, {0xc0000586f0, 0x12}, {0x204a1e0, 0xc0078432b0}, {0xc0005b8480?, 0xa?, 0x89e36d?})
        chainguard.dev/melange/pkg/linter/linter.go:549 +0x1f7
chainguard.dev/melange/pkg/linter.LintBuild({0x2072d28, 0xc0006ce2a0}, {0xc0000586f0, 0x12}, {0xc009b9c1e0, 0x4a}, {0xc0005b8360, 0x4, 0x11}, {0xc0005b8480, ...})
        chainguard.dev/melange/pkg/linter/linter.go:576 +0x185
chainguard.dev/melange/pkg/build.(*Build).BuildPackage(0xc000682708, {0x2072d28, 0xc0007842a0})
        chainguard.dev/melange/pkg/build/build.go:946 +0x3157
chainguard.dev/melange/pkg/cli.BuildCmd.func1()
        chainguard.dev/melange/pkg/cli/build.go:371 +0x594
golang.org/x/sync/errgroup.(*Group).Go.func1()
        golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
        golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96
make[1]: *** [Makefile:98: packages/x86_64/datadog-agent-nvml-1.0.9-r2.apk] Error 2
make[1]: Leaving directory '/home/user/src/wolfi-os'
make: *** [Makefile:88: package/datadog-agent-nvml] Error 2

smoser pushed a commit to wolfi-dev/os that referenced this issue Dec 12, 2024
The package datadog-agent-nvml is failing to build with the following
error:

```
2024-12-11T07:05:44Z INFO [git checkout] execute: git checkout --quiet origin/tags/nvml-1.0.9 uses=git-checkout
2024-12-11T07:05:46Z INFO [git checkout] tag nvml-1.0.9 is d38c5cdb4ab4d07f4432afb25e0ccd70341efb51 uses=git-checkout
2024-12-11T07:05:46Z WARN /bin/sh: python: not found
```

This change fixes that but locally building the package causes a
segmentation violation which is detailed in
chainguard-dev/melange#1552. Maybe it'll pass
in production?
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