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
using cgo causes crash on macos #492
Comments
This is rather bizarre. Do you have a very simple reproducer program? |
I do! I'm not too familiar with tcell (I use it via tview), so, to reproduce, I added the line The only differences from what's in TUTORIAL.md are,
|
This problem does not reproduce for me. I am using go 1.17.2 on M1 (macOS Big Sur). I am also using clang 13.0 (from Xcode). My guess is that there is something wrong in your tool chain and that is what is breaking - probably something is not getting linked correctly. Maybe try updating go, and Xcode and seeing if that helps. Make sure that there aren't any other versions of gcc or anything like that in your PATH that might conflict. |
It also looks like you have a locally built version of go. I just installed the normal go from the go website using the macOS installer. |
I upgraded go, and verified that I'm on latest Xcode and stock gcc/clang, but I still get the crash. Here are more facts about my system:
c compiler info:
here is a stacktrace from after all that:
|
I didn't have a gcc on my path. But I do have clang. Other than that the only difference is arm64 vs x86_64. The fact that cgo makes a difference makes me feel very much this is a tool chain problem. |
I am having the same issue stated here. OS: Hardware: |
This is strange. I cannot think of any good reason for this to occur apart from a bug in the runtime or tool chain. It works fine on M1 and I'm no longer in possession of an Intel Mac. If I have a little time I'll see if I can cross build and test with Rosetta. It would be instructive to test this on an earlier version of macOS and Xcode. |
Well, in the original issue made on the tview repo, by the same OP as this issue, he mentions specifically:
Can we look into what has changed? If it is a "toolchain" issue is there any way to fix this? I reinstalled XCode and more, nothing changes. |
NOTE: I got the error to disappear with modifying the version of "golang.org/x/sys". BUT the go module "github.com/sqweek/dialog" I am using still is not working on the Mac system. Obviously not a tcell issue. I think this issue can be closed. |
What version of golang.org/x/sys worked for you? |
|
Hello, I just hit this issue when upgrading to tcell 2.4.0 (from 1.3) in a program that uses the "plugin" package. For reference, I can reproduce the panic with this minimal program package main
import "golang.org/x/sys/unix"
import "C"
func main() {
unix.IoctlGetTermios(0, unix.TIOCGETA) // The syscall tcell makes when initializing
} So the bug is definitely unrelated to tcell. Upgrading |
Using
import "C"
in a program which also uses tcell causes a crash on macos.I am using this go version:
To repro, I added the line
import "C"
to the example program in TUTORIAL.md. Here's a gist.I did a bisect, and it reports this commit:
here is my stacktrace:
The text was updated successfully, but these errors were encountered: