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

Segmentation Fault When Running v0.6.1 binary on Ubuntu 20.04 & 22.04 #1008

Closed
tonnyadhi opened this issue Dec 7, 2022 · 7 comments
Closed
Assignees

Comments

@tonnyadhi
Copy link

tonnyadhi commented Dec 7, 2022

Segmentation Fault When Running v0.6.1 binary on Ubuntu 20.04 & 22.04

Description

Binary release from Polygin Edge v0.6.1 experiencing segmentation fault when running under Ubuntu 20.04 anda Ubuntu 22.04

Your environment

  • Ubuntu 20.04 , kernel 5.15.0 - libc6 v2.3.5 , Ubuntu 22.04 kernel .5.19, x86-64
  • v0.6.1 static binary releases from Polygon Edge Github
  • Cloud Hosted : AWS
  • No. Its running under VM

Steps to reproduce

  • Download amd64 / x86-64 release from Polygon Edge Github Release
  • Extract the tarball and run the binary
  • It will resulted on segmentationfault

Expected behavior

  • Polygon Edge Running Normally

Logs

SegFault Log Dump

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe5 pc=0x7f28a7e27ef4]

runtime stack:
runtime.throw({0x1c08cf8?, 0x0?})
        /usr/local/go/src/runtime/panic.go:992 +0x71
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:802 +0x3a9

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x15821c0, 0xc000bbf0b8)
        /usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc000bbf090 sp=0xc000bbf058 pc=0x40575c
os/user._Cfunc_mygetpwuid_r(0x0, 0xc000d6ec90, 0x4801cc0, 0x400, 0xc0000bce70)
        _cgo_gotypes.go:175 +0x4c fp=0xc000bbf0b8 sp=0xc000bbf090 pc=0xcff66c
os/user.lookupUnixUid.func1.1(0x0, 0x31c7c80?, 0xc000bbf150?, 0x40f807?)
        /usr/local/go/src/os/user/cgo_lookup_unix.go:102 +0xa6 fp=0xc000bbf118 sp=0xc000bbf0b8 pc=0xcffde6
os/user.lookupUnixUid.func1()
        /usr/local/go/src/os/user/cgo_lookup_unix.go:102 +0x29 fp=0xc000bbf148 sp=0xc000bbf118 pc=0xcffd29
os/user.retryWithBuffer(0xc000d32db0, 0xc000bbf228)
        /usr/local/go/src/os/user/cgo_lookup_unix.go:244 +0x39 fp=0xc000bbf190 sp=0xc000bbf148 pc=0xd009d9
os/user.lookupUnixUid(0x0)
        /usr/local/go/src/os/user/cgo_lookup_unix.go:95 +0x10f fp=0xc000bbf268 sp=0xc000bbf190 pc=0xcffb2f
os/user.current()
        /usr/local/go/src/os/user/cgo_lookup_unix.go:48 +0x47 fp=0xc000bbf2a8 sp=0xc000bbf268 pc=0xcff9a7
os/user.Current.func1()
        /usr/local/go/src/os/user/lookup.go:15 +0x17 fp=0xc000bbf2b8 sp=0xc000bbf2a8 pc=0xcff177
sync.(*Once).doSlow(0x0?, 0xc000bbf328?)
        /usr/local/go/src/sync/once.go:68 +0xc2 fp=0xc000bbf318 sp=0xc000bbf2b8 pc=0x4761c2
sync.(*Once).Do(...)
        /usr/local/go/src/sync/once.go:59
os/user.Current()
        /usr/local/go/src/os/user/lookup.go:15 +0x37 fp=0xc000bbf348 sp=0xc000bbf318 pc=0xcff217
github.com/golang/glog.init.1()
        /go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog_file.go:63 +0x92 fp=0xc000bbf3a0 sp=0xc000bbf348 pc=0x149ca72
runtime.doInit(0x3087700)
        /usr/local/go/src/runtime/proc.go:6222 +0x126 fp=0xc000bbf4d0 sp=0xc000bbf3a0 pc=0x449cc6
runtime.doInit(0x308c020)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbf600 sp=0xc000bbf4d0 pc=0x449c11
runtime.doInit(0x307c7c0)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbf730 sp=0xc000bbf600 pc=0x449c11
runtime.doInit(0x30848c0)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbf860 sp=0xc000bbf730 pc=0x449c11
runtime.doInit(0x3091fc0)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbf990 sp=0xc000bbf860 pc=0x449c11
runtime.doInit(0x3092f00)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbfac0 sp=0xc000bbf990 pc=0x449c11
runtime.doInit(0x30846e0)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbfbf0 sp=0xc000bbfac0 pc=0x449c11
runtime.doInit(0x307f0a0)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbfd20 sp=0xc000bbfbf0 pc=0x449c11
runtime.doInit(0x3086120)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbfe50 sp=0xc000bbfd20 pc=0x449c11
runtime.doInit(0x3074e80)
        /usr/local/go/src/runtime/proc.go:6199 +0x71 fp=0xc000bbff80 sp=0xc000bbfe50 pc=0x449c11
runtime.main()
        /usr/local/go/src/runtime/proc.go:233 +0x1d3 fp=0xc000bbffe0 sp=0xc000bbff80 pc=0x43cc73
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc000bbffe8 sp=0xc000bbffe0 pc=0x46bca1

goroutine 23 [select]:
github.com/ipfs/go-log/writer.(*MirrorWriter).logRoutine(0xc0001c6ea0)
        /go/pkg/mod/github.com/ipfs/go-log@v1.0.5/writer/writer.go:71 +0x11f
created by github.com/ipfs/go-log/writer.NewMirrorWriter
        /go/pkg/mod/github.com/ipfs/go-log@v1.0.5/writer/writer.go:36 +0xca

goroutine 26 [runnable]:
net.CIDRMask(...)
        /usr/local/go/src/net/ip.go:85
net.ParseCIDR({0x1b1010c, 0x11})
        /usr/local/go/src/net/ip.go:757 +0x253
github.com/libp2p/go-libp2p-asn-util.newAsnStore()
        /go/pkg/mod/github.com/libp2p/go-libp2p-asn-util@v0.2.0/asn.go:56 +0xb7
github.com/libp2p/go-libp2p-asn-util.newIndirectAsnStore.func1()
        /go/pkg/mod/github.com/libp2p/go-libp2p-asn-util@v0.2.0/asn.go:89 +0x65
created by github.com/libp2p/go-libp2p-asn-util.newIndirectAsnStore
        /go/pkg/mod/github.com/libp2p/go-libp2p-asn-util@v0.2.0/asn.go:87 +0x9b

goroutine 40 [runnable]:
go.opencensus.io/stats/view.init.0.func1()
        /go/pkg/mod/go.opencensus.io@v0.23.0/stats/view/worker.go:34
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1571 +0x1
created by go.opencensus.io/stats/view.init.0
        /go/pkg/mod/go.opencensus.io@v0.23.0/stats/view/worker.go:34 +0x8d

goroutine 42 [runnable]:
github.com/golang/glog.init.0.func1()
        /go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:410
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1571 +0x1
created by github.com/golang/glog.init.0
        /go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:410 +0x1bf`
@JekaMas
Copy link
Contributor

JekaMas commented Dec 7, 2022

Thank you for the report!

@JekaMas
Copy link
Contributor

JekaMas commented Dec 7, 2022

@ferranbt @lazartravica @b00ris I found a few different cases about segfaults and glog. In few of them the solution is to update golang version (and sys from standard library) golang/go#49992
What do you think, guys, about it?

@lazartravica
Copy link
Contributor

@JekaMas The error is in the compiler flags, and the environment. Upgrading x/sys doesn't fix the issue (as discussed on the linked issue).

@epikichi is on it 🙏 We hope to have an update soon.

@JekaMas
Copy link
Contributor

JekaMas commented Dec 10, 2022

@JekaMas The error is in the compiler flags, and the environment. Upgrading x/sys doesn't fix the issue (as discussed on the linked issue).

@epikichi is on it 🙏 We hope to have an update soon.

The thing is that it's not safe to switch cgo off either. I believe, this is one of the requirements of running data race detector https://go.dev/doc/articles/race_detector#Requirements .
We might need to do something else, like not switching off cgo, but rather add new build tags or something.

@epikichi
Copy link
Contributor

@JekaMas Understood. Looks like this can be resolved by adding in the osusergo build tag. Will reopen the PRs

@laviniat1996
Copy link
Contributor

laviniat1996 commented Dec 19, 2022

@tonnyadhi The fix for this issue was added to our latest release: v0.6.2

@tonnyadhi
Copy link
Author

Thank you @laviniat1996 and Polygon Edge team.

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

6 participants