Bug 2153040

Summary: Running or installing any classic snap results in Go segfault with BoringSSL error
Product: [Fedora] Fedora EPEL Reporter: Alex Zorin <rhbugs>
Component: snapdAssignee: Zygmunt Krynicki <me>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: bmw, go-sig, maciek.borzecki, me, ngompa13
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-13 21:22:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Zorin 2022-12-13 21:05:13 UTC
Description of problem:
Since the release of snapd-2.57.6-1.el7.x86_64 to EPEL7, it is impossible to install or run any --classic (unconfined) snap. Both tasks result in a segfault.

Version-Release number of selected component (if applicable):
snapd-2.57.6-1.el7.x86_64

How reproducible:
100%.

Steps to Reproduce:
1. Install snapd on CentOS 7 and enable classic snap support (https://snapcraft.io/docs/installing-snap-on-centos)
2. Try to install a classic snap (e.g. https://snapcraft.io/install/snapcraft/centos)

Actual results:

# snap install --classic certbot
error: cannot perform the following tasks:
- Run configure hook of "certbot" snap if present (run hook "configure":
-----
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x0]

runtime stack:
runtime.throw({0x7257cd, 0x0})
		/usr/lib/golang/src/runtime/panic.go:1198 +0x71 fp=0x7fffdbc5b340 sp=0x7fffdbc5b310 pc=0x435291
runtime.sigpanic()
		/usr/lib/golang/src/runtime/signal_unix.go:719 +0x396 fp=0x7fffdbc5b390 sp=0x7fffdbc5b340 pc=0x44aa16

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x5e9a70, 0xc0000a76c0)
		/usr/lib/golang/src/runtime/cgocall.go:156 +0x5c fp=0xc0000a7698 sp=0xc0000a7660 pc=0x40551c
crypto/internal/boring._Cfunc__goboringcrypto_DLOPEN_OPENSSL()
		_cgo_gotypes.go:603 +0x49 fp=0xc0000a76c0 sp=0xc0000a7698 pc=0x5366c9
crypto/internal/boring.init.0()
		/usr/lib/golang/src/crypto/internal/boring/boring.go:46 +0x45 fp=0xc0000a76f8 sp=0xc0000a76c0 pc=0x537445
runtime.doInit(0xad84a0)
		/usr/lib/golang/src/runtime/proc.go:6498 +0x123 fp=0xc0000a7830 sp=0xc0000a76f8 pc=0x4449a3
runtime.doInit(0xad61a0)
		/usr/lib/golang/src/runtime/proc.go:6475 +0x71 fp=0xc0000a7968 sp=0xc0000a7830 pc=0x4448f1
runtime.doInit(0xad9280)
		/usr/lib/golang/src/runtime/proc.go:6475 +0x71 fp=0xc0000a7aa0 sp=0xc0000a7968 pc=0x4448f1
runtime.doInit(0xad8260)
		/usr/lib/golang/src/runtime/proc.go:6475 +0x71 fp=0xc0000a7bd8 sp=0xc0000a7aa0 pc=0x4448f1
runtime.doInit(0xad9bc0)
		/usr/lib/golang/src/runtime/proc.go:6475 +0x71 fp=0xc0000a7d10 sp=0xc0000a7bd8 pc=0x4448f1
runtime.doInit(0xad7220)
		/usr/lib/golang/src/runtime/proc.go:6475 +0x71 fp=0xc0000a7e48 sp=0xc0000a7d10 pc=0x4448f1
runtime.doInit(0xad7fe0)
		/usr/lib/golang/src/runtime/proc.go:6475 +0x71 fp=0xc0000a7f80 sp=0xc0000a7e48 pc=0x4448f1
runtime.main()
		/usr/lib/golang/src/runtime/proc.go:238 +0x1e6 fp=0xc0000a7fe0 sp=0xc0000a7f80 pc=0x437926
runtime.goexit()
		/usr/lib/golang/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0000a7fe8 sp=0xc0000a7fe0 pc=0x464361

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0, 0x0, 0x0, 0x0, 0x0)
		/usr/lib/golang/src/runtime/proc.go:366 +0xd6 fp=0xc000032fb0 sp=0xc000032f90 pc=0x437d36
runtime.goparkunlock(...)
		/usr/lib/golang/src/runtime/proc.go:372
runtime.forcegchelper()
		/usr/lib/golang/src/runtime/proc.go:306 +0xad fp=0xc000032fe0 sp=0xc000032fb0 pc=0x437bcd
runtime.goexit()
		/usr/lib/golang/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000032fe8 sp=0xc000032fe0 pc=0x464361
created by runtime.init.8
		/usr/lib/golang/src/runtime/proc.go:294 +0x25

goroutine 3 [GC sweep wait]:
runtime.gopark(0x0, 0x0, 0x0, 0x0, 0x0)
		/usr/lib/golang/src/runtime/proc.go:366 +0xd6 fp=0xc0000337b0 sp=0xc000033790 pc=0x437d36
runtime.goparkunlock(...)
		/usr/lib/golang/src/runtime/proc.go:372
runtime.bgsweep()
		/usr/lib/golang/src/runtime/mgcsweep.go:163 +0x88 fp=0xc0000337e0 sp=0xc0000337b0 pc=0x4243a8
runtime.goexit()
		/usr/lib/golang/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0000337e8 sp=0xc0000337e0 pc=0x464361
created by runtime.gcenable
		/usr/lib/golang/src/runtime/mgc.go:181 +0x55

goroutine 4 [GC scavenge wait]:
runtime.gopark(0x0, 0x0, 0x0, 0x0, 0x0)
		/usr/lib/golang/src/runtime/proc.go:366 +0xd6 fp=0xc000033f80 sp=0xc000033f60 pc=0x437d36
runtime.goparkunlock(...)
		/usr/lib/golang/src/runtime/proc.go:372
runtime.bgscavenge()
		/usr/lib/golang/src/runtime/mgcscavenge.go:265 +0xcd fp=0xc000033fe0 sp=0xc000033f80 pc=0x4224ad
runtime.goexit()
		/usr/lib/golang/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000033fe8 sp=0xc000033fe0 pc=0x464361
created by runtime.gcenable
		/usr/lib/golang/src/runtime/mgc.go:182 +0x65

goroutine 5 [finalizer wait]:
runtime.gopark(0xaec640, 0xc000032770, 0xf1, 0x48, 0xad75e0)
		/usr/lib/golang/src/runtime/proc.go:366 +0xd6 fp=0xc000032630 sp=0xc000032610 pc=0x437d36
runtime.goparkunlock(...)
		/usr/lib/golang/src/runtime/proc.go:372
runtime.runfinq()
		/usr/lib/golang/src/runtime/mfinal.go:177 +0xb3 fp=0xc0000327e0 sp=0xc000032630 pc=0x419f33
runtime.goexit()
		/usr/lib/golang/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0000327e8 sp=0xc0000327e0 pc=0x464361
created by runtime.createfing
		/usr/lib/golang/src/runtime/mfinal.go:157 +0x45

Expected results:

The snap should install without failing.

Additional info:

I originally reported this issue to Canonical at https://forum.snapcraft.io/t/snap-exec-segfaults-on-centos-7-2-57-6-1-el7/33030.

My suspicion is that owing to this snapd package being built by boringcrypto/FIPS-enabled Go, something is going wrong when the Go runtime tries to link to OpenSSL/BoringSSL.

We have over 50k users using the Certbot snap on CentOS 7 who are unable to use the software right now, but the issue is not exclusive to the Certbot snap. Any other classic snap (like snapcraft) is also affected.

Comment 1 Alex Zorin 2022-12-13 21:22:57 UTC

*** This bug has been marked as a duplicate of bug 2152903 ***