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

SIGILL: illegal instruction #96

Open
agorman opened this issue Jan 31, 2023 · 5 comments
Open

SIGILL: illegal instruction #96

agorman opened this issue Jan 31, 2023 · 5 comments

Comments

@agorman
Copy link

agorman commented Jan 31, 2023

I'm having an issue where when build the binary inside a docker container and then try to run it on another machine I get SIGILL: illegal instruction. If I build and run it on the same machine then it works fine. I'm thinking it may be due to differing CPU capabilities. It's being built on a system with an AMD processor and it's being run on a system with an Intel processor.

I've tried building with CGO_CXXFLAGS="-std=c++1z -Wall -DNDEBUG -march=x86-64 -mtune=generic" but it doesn't seem to help.

Any ideas on how I can get the binary to run on any x86_64 machine?

SIGILL: illegal instruction
PC=0xdf7133 m=8 sigcode=2
signal arrived during cgo execution
instruction bytes: 0xc4 0xe3 0xd1 0x6b 0xc9 0x50 0x48 0x39 0xd8 0x7c 0xea 0xc5 0xfb 0x10 0xad 0x90

goroutine 26 [syscall]:
runtime.cgocall(0xdc2ff0, 0xc0000afbd0)
	/usr/local/go/src/runtime/cgocall.go:158 +0x5c fp=0xc0000afba8 sp=0xc0000afb70 pc=0x478e3c
github.com/Kagami/go-face._Cfunc_facerec_init(0x7fc58c000b60)
	_cgo_gotypes.go:176 +0x49 fp=0xc0000afbd0 sp=0xc0000afba8 pc=0xd8abe9
github.com/Kagami/go-face.NewRecognizer({0x1169d9c?, 0xc000110270?})
	/root/go/pkg/mod/github.com/!kagami/[email protected]/face.go:68 +0x67 fp=0xc0000afc38 sp=0xc0000afbd0 pc=0xd8b107
github.com/Kagami/go-face.NewRecognizerWithConfig({0x1169d9c?, 0xc0000afcb8?}, 0x482a67?, 0x3e800000, 0x0)
	/root/go/pkg/mod/github.com/!kagami/[email protected]/face.go:82 +0x3b fp=0xc0000afc88 sp=0xc0000afc38 pc=0xd8b55b
@leandroveronezi
Copy link

I have the same problem here.

@omezro
Copy link

omezro commented Mar 8, 2023

build in docker, debian. same problem here.

@leandroveronezi
Copy link

Here it worked for me to change the following line in the file.go file::

// #cgo CXXFLAGS: -std=c++1z -Wall -O3 -DNDEBUG -march=native

to:

// #cgo CXXFLAGS: -std=c++1z -Wall -O3 -DNDEBUG -march=x86-64 -mtune=generic

@agorman
Copy link
Author

agorman commented Mar 21, 2023

@leandroveronezi do you know if it's possible to pass these flags from the command line?

When I try CGO_CXXFLAGS="-std=c++1z -Wall -O3 -DNDEBUG -march=x86-64 -mtune=generic" go build ... I'm still getting SIGILL: illegal instruction

@leandroveronezi
Copy link

By command I think it is not possible. The flag is defined in the face.go file. See this link to my local change.

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

3 participants