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

packer 1.7.9 runtime panic issue #11512

Closed
chenrui333 opened this issue Jan 23, 2022 · 8 comments
Closed

packer 1.7.9 runtime panic issue #11512

chenrui333 opened this issue Jan 23, 2022 · 8 comments
Assignees
Labels

Comments

@chenrui333
Copy link

👋 tried to build from the source code of release 1.7.9, but failed to run on apple m1

$ /opt/homebrew/Cellar/packer/1.7.9/bin/packer version
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104afc800]

goroutine 1 [running, locked to thread]:
runtime.throw({0x108022b33, 0x2a})
	runtime/panic.go:1198 +0x54 fp=0x1400031f160 sp=0x1400031f130 pc=0x104b1dbb4
runtime.sigpanic()
	runtime/signal_unix.go:719 +0x230 fp=0x1400031f1a0 sp=0x1400031f160 pc=0x104b35b40
runtime.heapBitsSetType(0x14000299470, 0x10, 0x10, 0x1093b53c0)
	runtime/mbitmap.go:894 +0x370 fp=0x1400031f270 sp=0x1400031f1b0 pc=0x104afc800
runtime.mallocgc(0x10, 0x1093b53c0, 0x1)
	runtime/malloc.go:1106 +0x654 fp=0x1400031f300 sp=0x1400031f270 pc=0x104af40b4
runtime.newarray(0x1093b53c0, 0x4)
	runtime/malloc.go:1256 +0x8c fp=0x1400031f330 sp=0x1400031f300 pc=0x104af457c
runtime.makeBucketArray(0x108df4460, 0x2, 0x0)
	runtime/map.go:362 +0x168 fp=0x1400031f370 sp=0x1400031f330 pc=0x104af5468
runtime.makemap(0x108df4460, 0xe, 0x0)
	runtime/map.go:328 +0x128 fp=0x1400031f3c0 sp=0x1400031f370 pc=0x104af5248
golang.org/x/net/http2.init()
	golang.org/x/[email protected]/http2/errors.go:32 +0xa0 fp=0x1400031f470 sp=0x1400031f3c0 pc=0x105119dd0
runtime.doInit(0x10d16b380)
	runtime/proc.go:6498 +0x138 fp=0x1400031f5d0 sp=0x1400031f470 pc=0x104b2f038
runtime.doInit(0x10d170cc0)
	runtime/proc.go:6475 +0x70 fp=0x1400031f730 sp=0x1400031f5d0 pc=0x104b2ef70
runtime.doInit(0x10d161420)
	runtime/proc.go:6475 +0x70 fp=0x1400031f890 sp=0x1400031f730 pc=0x104b2ef70
runtime.doInit(0x10d162d60)
	runtime/proc.go:6475 +0x70 fp=0x1400031f9f0 sp=0x1400031f890 pc=0x104b2ef70
runtime.doInit(0x10d15a360)
	runtime/proc.go:6475 +0x70 fp=0x1400031fb50 sp=0x1400031f9f0 pc=0x104b2ef70
runtime.doInit(0x10d1637e0)
	runtime/proc.go:6475 +0x70 fp=0x1400031fcb0 sp=0x1400031fb50 pc=0x104b2ef70
runtime.doInit(0x10d19e860)
	runtime/proc.go:6475 +0x70 fp=0x1400031fe10 sp=0x1400031fcb0 pc=0x104b2ef70
runtime.doInit(0x10d16ca00)
	runtime/proc.go:6475 +0x70 fp=0x1400031ff70 sp=0x1400031fe10 pc=0x104b2ef70
runtime.main()
	runtime/proc.go:238 +0x22c fp=0x1400031ffd0 sp=0x1400031ff70 pc=0x104b2034c
runtime.goexit()
	runtime/asm_arm64.s:1133 +0x4 fp=0x1400031ffd0 sp=0x1400031ffd0 pc=0x104b51674

full build log, https://github.com/Homebrew/homebrew-core/runs/4885996522
relates to Homebrew/homebrew-core#93447

@JenGoldstrich
Copy link
Contributor

Hey @chenrui333, thanks for reaching out to us about this issue!

I tried to reproduce this on my m1 mac, by running Make on my M1 Pro mbp while having 1.7.9 checked out, it worked for me with the following results

bin git:(a3f94fd3d) ✗ ./packer version
Packer v1.7.9
➜  bin git:(a3f94fd3d) ✗ file packer
packer: Mach-O 64-bit executable arm64
➜  bin git:(a3f94fd3d) ✗ go version
go version go1.17.5 darwin/arm64
➜  bin git:(a3f94fd3d) ✗ file go
go: cannot open `go' (No such file or directory)
➜  bin git:(a3f94fd3d) ✗ which go
/opt/homebrew/bin/go
➜  bin git:(a3f94fd3d) ✗ file /opt/homebrew/bin/go
/opt/homebrew/bin/go: Mach-O 64-bit executable arm64

What commands are y'all running to build Packer from source, and can you make sure you're running the ARM version, rather than the intel one in Rosetta by running file packer in your bin directory?

I do notice a warning in my output

# github.com/shirou/gopsutil/cpu
../../../../pkg/mod/github.com/shirou/[email protected]+incompatible/cpu/cpu_darwin_cgo.go:13:5: warning: 'TARGET_OS_MAC' is not defined, evaluates to 0 [-Wundef-prefix=TARGET_OS_]

Not sure if this is related at all but I'd be curious if you also see this warning.

@azr azr added crt common release tooling issue and removed crt common release tooling issue labels Jan 27, 2022
@JenGoldstrich
Copy link
Contributor

Following up this morning I figured out how y'all are building packer using brew test-bot, working to configure my environment to use the PR branch of homebrew-core with 1.7.9 instead, will update you when I've gotten that figured out

@chenrui333
Copy link
Author

chenrui333 commented Jan 27, 2022

Yeah, we use test-bot for CI, thanks for the help!

@JenGoldstrich
Copy link
Contributor

This should be fixed by #11546, the next Packer release should fix this issue

@JenGoldstrich
Copy link
Contributor

Closing this, should be resolved in v1.7.10 https://github.com/hashicorp/packer/releases/tag/v1.7.10, please feel free to open a new issue or re-open this one if this issue reoccurs in your pipeline, thanks @azr for the fix!

@chenrui333
Copy link
Author

Thanks @JenGoldstrich, gonna give a shot.

@chenrui333
Copy link
Author

Yeah, it builds out fine with 1.7.10 now.

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this issue Feb 5, 2022
NOTES:

This patch release fixes a crash in m1 caused by the psutils dep,
hashicorp/packer#11546, originally reported by the
HomeBrew team here hashicorp/packer#11512
IMPROVEMENTS

* Print all locals errors when there is a circular
error. [GH-11527](hashicorp/packer#11527

BUG FIXES

* Prevent duplicate local block creation.
* Update psutils dep to avoid crash on Arm64 Macs.
@github-actions
Copy link

github-actions bot commented Mar 5, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants