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

Signal arrived during cgo execution #152

Open
SaifHcube opened this issue Aug 31, 2024 · 0 comments
Open

Signal arrived during cgo execution #152

SaifHcube opened this issue Aug 31, 2024 · 0 comments

Comments

@SaifHcube
Copy link

Hello,

I get this error when i run the build binary

SIGSEGV: segmentation violation
PC=0x0 m=0 sigcode=1 addr=0x0
signal arrived during cgo execution

goroutine 1 gp=0xc0000061c0 m=0 mp=0x54d940 [syscall]:
runtime.cgocall(0x48a2c0, 0xc00003a618)
        /xxx/xxx/xxx/go/src/runtime/cgocall.go:157 +0x4b fp=0xc00003a5f0 sp=0xc00003a5b8 pc=0x40672b
github.com/golang-fips/openssl/v2._Cfunc_go_openssl_EVP_sha256()
        _cgo_gotypes.go:2319 +0x48 fp=0xc00003a618 sp=0xc00003a5f0 pc=0x486128
github.com/golang-fips/openssl/v2.cryptoHashToMD(0x5)
        /xxx/xxx/go/pkg/mod/github.com/golang-fips/openssl/[email protected]/evp.go:87 +0x23a fp=0xc00003a678 sp=0xc00003a618 pc=0x48675a
github.com/golang-fips/openssl/v2.newEvpHash(0x5, 0x20, 0x40)
        /xxx/xxx/go/pkg/mod/github.com/golang-fips/openssl/[email protected]/hash.go:125 +0x26 fp=0xc00003a6d0 sp=0xc00003a678 pc=0x486c46
github.com/golang-fips/openssl/v2.NewSHA256(...)
        /xxx/xxx/go/pkg/mod/github.com/golang-fips/openssl/[email protected]/hash.go:411
main.main()
        /xxx/xxx/xxx/xxx/xxx/test.go:10 +0x27 fp=0xc00003a750 sp=0xc00003a6d0 pc=0x487d67
runtime.main()
        /xxx/xxx/xxx/go/src/runtime/proc.go:271 +0x29d fp=0xc00003a7e0 sp=0xc00003a750 pc=0x4380bd
runtime.goexit({})
        /xxx/xxx/xxx/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00003a7e8 sp=0xc00003a7e0 pc=0x464ba1

goroutine 2 gp=0xc000007340 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /xxx/xxx/xxx/go/src/runtime/proc.go:402 +0xce fp=0xc00003afa8 sp=0xc00003af88 pc=0x4384ee
runtime.goparkunlock(...)
        /xxx/xxx/xxx/go/src/runtime/proc.go:408
runtime.forcegchelper()
        /xxx/xxx/xxx/go/src/runtime/proc.go:326 +0xb3 fp=0xc00003afe0 sp=0xc00003afa8 pc=0x438373
runtime.goexit({})
        /xxx/xxx/xxx/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00003afe8 sp=0xc00003afe0 pc=0x464ba1
created by runtime.init.6 in goroutine 1
        /xxx/xxx/xxx/go/src/runtime/proc.go:314 +0x1a

goroutine 3 gp=0xc000007500 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /xxx/xxx/xxx/go/src/runtime/proc.go:402 +0xce fp=0xc00003b780 sp=0xc00003b760 pc=0x4384ee
runtime.goparkunlock(...)
        /xxx/xxx/xxx/go/src/runtime/proc.go:408
runtime.bgsweep(0xc00001e070)
        /xxx/xxx/xxx/go/src/runtime/mgcsweep.go:278 +0x94 fp=0xc00003b7c8 sp=0xc00003b780 pc=0x424774
runtime.gcenable.gowrap1()
        /xxx/xxx/xxx/go/src/runtime/mgc.go:203 +0x25 fp=0xc00003b7e0 sp=0xc00003b7c8 pc=0x4192c5
runtime.goexit({})
        /xxx/xxx/xxx/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00003b7e8 sp=0xc00003b7e0 pc=0x464ba1
created by runtime.gcenable in goroutine 1
        /xxx/xxx/xxx/go/src/runtime/mgc.go:203 +0x66

goroutine 4 gp=0xc0000076c0 m=nil [GC scavenge wait]:
runtime.gopark(0xc00001e070?, 0x4cc088?, 0x1?, 0x0?, 0xc0000076c0?)
        /xxx/xxx/xxx/go/src/runtime/proc.go:402 +0xce fp=0xc00003bf78 sp=0xc00003bf58 pc=0x4384ee
runtime.goparkunlock(...)
        /xxx/xxx/xxx/go/src/runtime/proc.go:408
runtime.(*scavengerState).park(0x54d2e0)
        /xxx/xxx/xxx/go/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc00003bfa8 sp=0xc00003bf78 pc=0x422169
runtime.bgscavenge(0xc00001e070)
        /xxx/xxx/xxx/go/src/runtime/mgcscavenge.go:653 +0x3c fp=0xc00003bfc8 sp=0xc00003bfa8 pc=0x4226fc
runtime.gcenable.gowrap2()
        /xxx/xxx/xxx/go/src/runtime/mgc.go:204 +0x25 fp=0xc00003bfe0 sp=0xc00003bfc8 pc=0x419265
runtime.goexit({})
        /xxx/xxx/xxx/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00003bfe8 sp=0xc00003bfe0 pc=0x464ba1
created by runtime.gcenable in goroutine 1
        /xxx/xxx/xxx/go/src/runtime/mgc.go:204 +0xa5

goroutine 5 gp=0xc000007c00 m=nil [runnable]:
runtime.runfinq()
        /xxx/xxx/xxx/go/src/runtime/mfinal.go:177 fp=0xc00003c7e0 sp=0xc00003c7d8 pc=0x418200
runtime.goexit({})
        /xxx/xxx/xxx/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00003c7e8 sp=0xc00003c7e0 pc=0x464ba1
created by runtime.createfing in goroutine 1
        /xxx/xxx/xxx/go/src/runtime/mfinal.go:164 +0x3d

rax    0x5acd08
rbx    0xc00003a618
rcx    0x48a2c0
rdx    0xc00003a5a8
rdi    0xc00003a618
rsi    0x54d380
rbp    0xc00003a5a8
rsp    0x7ffc2ea5d298
r8     0x54d940
r9     0x0
r10    0x2
r11    0x7f0708a2ec80
r12    0xc00003a800
r13    0x0
r14    0xc0000061c0
r15    0x3fffffffffffffff
rip    0x0
rflags 0x10212
cs     0x33
fs     0x0
gs     0x0

and this is the build test function

package main

import "github.com/golang-fips/openssl/v2"

func main() {
	hashFunc := openssl.NewSHA256()
	data := []byte("data")
	hashFunc.Write(data)
}

i am using your go fork (go1.22.5)

thank you for your help

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

1 participant