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

Tag a new release to benefit of static linking work brought on master #146

Closed
hightoxicity opened this issue Mar 30, 2023 · 4 comments
Closed

Comments

@hightoxicity
Copy link

Do you want to report a bug?

I got a panic with last produced binary version (linux one v0.24)
I have compiled a custom build using last merged changes in master branch and I have no more issues in same conditions.

Which mbt command are you having troubles with?

v0.24

What's the current behaviour?

mbt build commit 1a53b475db18887cf118f6bf547db610b2e55660 --content --in ./
About to call mbt for commit: 1a53b475db18887cf118f6bf547db610b2e55660
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x6290a6]

goroutine 1 [running]:
github.com/mbtproject/mbt/vendor/github.com/libgit2/git2go.(*Commit).Tree.func1(0xc000128478, 0x0, 0xc0ffffff01)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/vendor/github.com/libgit2/git2go/commit.go:72 +0x26
github.com/mbtproject/mbt/vendor/github.com/libgit2/git2go.(*Commit).Tree(0x0, 0x0, 0x0, 0x0)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/vendor/github.com/libgit2/git2go/commit.go:72 +0x89
github.com/mbtproject/mbt/lib.(*libgitRepo).Changes(0xc0001a70b0, 0x868540, 0xc0001269e0, 0xc0001279f0, 0x2, 0x2, 0x0, 0x0)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/lib/repo.go:186 +0x20d
github.com/mbtproject/mbt/lib.(*stdManifestBuilder).ByCommitContent.func1(0xc0001a70b0, 0x0, 0x0)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/lib/manifest_builder.go:96 +0xcb
github.com/mbtproject/mbt/lib.(*stdManifestBuilder).runManifestBuilder(0xc00012cec0, 0xc00012f6a0, 0x4, 0xc000152a50, 0x38)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/lib/manifest_builder.go:181 +0xb8
github.com/mbtproject/mbt/lib.(*stdManifestBuilder).ByCommitContent(0xc00012cec0, 0x868540, 0xc0001269e0, 0x868540, 0xc0001269e0, 0x0)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/lib/manifest_builder.go:90 +0x7b
github.com/mbtproject/mbt/lib.(*stdSystem).ManifestByCommitContent(0xc0001c2000, 0x7ffc681d3874, 0x28, 0x7dee60, 0x1, 0xc00012cf00)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/lib/manifest.go:55 +0xa5
github.com/mbtproject/mbt/lib.(*stdSystem).BuildCommitContent(0xc0001c2000, 0x7ffc681d3874, 0x28, 0xc00012cf00, 0x6, 0x5, 0xc0001a70e0)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/lib/build.go:90 +0x43
github.com/mbtproject/mbt/cmd.glob..func9(0xcca940, 0xc00012ce40, 0x1, 0x4, 0x86faa0, 0xc0001c2000)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/cmd/build.go:116 +0x10e
github.com/mbtproject/mbt/cmd.buildHandler.func1(0xcca940, 0xc00012ce40, 0x1, 0x4, 0x0, 0x0)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/cmd/build_handler.go:30 +0x57
github.com/mbtproject/mbt/vendor/github.com/spf13/cobra.(*Command).execute(0xcca940, 0xc00012cdc0, 0x4, 0x4, 0xcca940, 0xc00012cdc0)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/vendor/github.com/spf13/cobra/command.go:698 +0x431
github.com/mbtproject/mbt/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xccc2c0, 0x0, 0x0, 0x6b454d)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/vendor/github.com/spf13/cobra/command.go:783 +0x2ca
github.com/mbtproject/mbt/vendor/github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/work/mbt/src/github.com/mbtproject/mbt/vendor/github.com/spf13/cobra/command.go:736
main.main()
	/home/runner/work/mbt/src/main.go:25 +0x2e
##[error]Bash exited with code '2'.

What's the expected behaviour?

MBT should work properly

Environment

  • mbt version: v0.24
  • os: ubuntu 20.04
  • arch: amd64
@hightoxicity
Copy link
Author

I still encounter panic even building from master branch, I am attempting to bump some dependencies around libgit2 and git2go to fix this issue (hightoxicity@8e8ac20)

I will give this build a try and let you know if it allows me or not to fix previous issue.

Thx

@buddhike
Copy link
Member

Hey @hightoxicity, Thanks for investigating this issue.

@hightoxicity
Copy link
Author

Thank you @buddhike

@hightoxicity
Copy link
Author

Hi @buddhike, at end there was no issue with mbt, issue came from the azure pipelines default shallow fetching behavior with a default depth of 1 (https://dev.to/kkazala/azure-devops-pipelines-shallow-fetch-1-is-now-default-4656), I have switched this to 0 (fetch all).
mbt was saying the commit had 1 parent but it was unable to grab it and it was getting nil attempting to get parent at index 0.

In my attempt to solve this "issue" (not one at end), I have made some work to upgrade git2go and libgit2 (following compatibility matrix here: https://github.com/libgit2/git2go#which-go-version-to-use), that is why I opened a PR to benefit of those bumps:

#147

Thank you

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

No branches or pull requests

2 participants