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

:GoTest crashes nvim #12

Closed
jawr opened this issue Jul 4, 2021 · 6 comments
Closed

:GoTest crashes nvim #12

jawr opened this issue Jul 4, 2021 · 6 comments

Comments

@jawr
Copy link

jawr commented Jul 4, 2021

If the test does not build correctly, i.e.:

[jawr@walnut mxax.v2]$ go test ./...
# github.com/jawr/mxax/internal/http
internal/http/user.go:41:27: s.userService.Register undefined (type mxax.UserService has no field or method Register)
internal/http/user.go:83:14: s.service undefined (type *Server has no field or method service)
FAIL    github.com/jawr/mxax/internal/http [build failed]
ok      github.com/jawr/mxax/internal/inmem     (cached)
ok      github.com/jawr/mxax/mxax       (cached)
FAIL UserRegister attempts to unmarshall a JSON request and then register a user

then nvim crashes out:

free(): invalid pointer
Aborted (core dumped)
@crispgm
Copy link
Owner

crispgm commented Jul 4, 2021

@jawr thanks for reporting. I can reproduce and this is so weird.

UPDATE: I can confirm the failing point but dunno what causes that.

Popup window could be closed by config: require('go').setup({ test_popup = false }) but this also will not show other normal test outputs.

@jawr
Copy link
Author

jawr commented Jul 4, 2021

If I find some time I would love to have a dig around! Just switched to nvim and love the reasoning and effort of this! Thanks for writing it!

@crispgm
Copy link
Owner

crispgm commented Jul 4, 2021

If I find some time I would love to have a dig around! Just switched to nvim and love the reasoning and effort of this! Thanks for writing it!

I reported to the upstream as well and you may read it to get some idea of what happens nvim-lua/popup.nvim#14.

@crispgm
Copy link
Owner

crispgm commented Jul 6, 2021

I diagnosed nvim and go test commands then I think go test command returns both stderr and stdout, which causes popup windows crashed nvim. I make a workaround by redirect stderr to stdout. And it basically works well for me.

You may have a try on your use case. @jawr #13

@jawr
Copy link
Author

jawr commented Jul 6, 2021

That works perfectly crispgm! Thanks for investigating and fixing.

crispgm added a commit that referenced this issue Jul 7, 2021
* fix: test build failure which crashes nvim #12

* fix: stylua
@crispgm
Copy link
Owner

crispgm commented Jul 7, 2021

That works perfectly crispgm! Thanks for investigating and fixing.

I merged. Thanks for your report again. And I think I should continue to push and investigate what really happen to nvim core.

@crispgm crispgm closed this as completed Jul 7, 2021
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

2 participants