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

Crash when type is HTTP and module not set #40

Closed
rogerogers opened this issue Feb 27, 2023 · 0 comments · Fixed by #41
Closed

Crash when type is HTTP and module not set #40

rogerogers opened this issue Feb 27, 2023 · 0 comments · Fixed by #41
Labels
bug A proposal of some kind, and a request for comments.

Comments

@rogerogers
Copy link
Collaborator

Describe the bug

Crash when type is HTTP and module not set

A clear and concise description of what the bug is.

To Reproduce

syntax = "proto3";

package biz.hello;

// The greeting service definition.
option go_package = "biz/hello";

message Request {
  string message = 1;
}

message Response {
  string message = 1;
}

service Echo {
  rpc Echo (Request) returns (Response) {}
}
➜ cwgo server -service=Host -type HTTP -I idl -idl idl/hello/hello.proto
plugin protoc_gen_hertz returns error: exit status 1, cause:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x100adb498]

goroutine 1 [running]:
github.com/cloudwego/hertz/cmd/hz/protobuf.(*Plugin).Run.func1()
	/Users/rogers/go/pkg/mod/github.com/cloudwego/hertz/cmd/hz@v0.5.3-0.20230208061226-42701b832677/protobuf/plugin.go:86 +0x28
github.com/cloudwego/hertz/cmd/hz/protobuf.(*Plugin).Run(0x14000121eb8)
	/Users/rogers/go/pkg/mod/github.com/cloudwego/hertz/cmd/hz@v0.5.3-0.20230208061226-42701b832677/protobuf/plugin.go:115 +0x518
github.com/cloudwego/hertz/cmd/hz/app.PluginMode()
	/Users/rogers/go/pkg/mod/github.com/cloudwego/hertz/cmd/hz@v0.5.3-0.20230208061226-42701b832677/app/app.go:130 +0x9c
main.main()
	/Users/rogers/go/pkg/mod/github.com/cloudwego/cwgo@v0.0.0-20230224083820-c081b37bf35f/cwgo.go:32 +0x20
--hertz_out: protoc-gen-hertz: Plugin failed with status code 2.

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Kitex version:

Please provide the version of Kitex you are using.

Environment:

The output of go env.

Additional context

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A proposal of some kind, and a request for comments.
Development

Successfully merging a pull request may close this issue.

2 participants