Terminal interrupt on terraform console causes panic
Terraform Version
Terraform v1.0.11
Darwin Kernel Version 19.6.0 x86_64
Terraform Configuration Files
Debug Output
2021-12-07T15:07:58.934Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.dataresource (expand)": entering dynamic subgraph 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.dataresource": starting visit (*terraform.NodeApplyableOutput) 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.policy_id": starting visit (*terraform.NodeApplyableOutput) 2021-12-07T15:07:58.934Z [TRACE] setValue: Saving Create change for module.alerts.output.policy_id in changeset 2021-12-07T15:07:58.934Z [TRACE] setValue: Saving value for module.alerts.output.policy_id in state 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.policy_id": visit complete 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.policy_id (expand)": dynamic subgraph completed successfully 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.policy_id (expand)": visit complete 2021-12-07T15:07:58.934Z [TRACE] setValue: Saving Create change for module.alerts.output.dataresource in changeset 2021-12-07T15:07:58.934Z [TRACE] setValue: Saving value for module.alerts.output.dataresource in state 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.dataresource": visit complete 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.dataresource (expand)": dynamic subgraph completed successfully 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts.output.dataresource (expand)": visit complete 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts (close)": starting visit (*terraform.nodeCloseModule) 2021-12-07T15:07:58.934Z [TRACE] vertex "module.alerts (close)": visit complete 2021-12-07T15:07:58.935Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/newrelic/newrelic/2.32.0/darwin_amd64/terraform-provider-newrelic_v2.32.0 pid=60577 2021-12-07T15:07:58.935Z [DEBUG] provider: plugin exited 2021-12-07T15:07:58.935Z [TRACE] vertex "provider["registry.terraform.io/newrelic/newrelic"] (close)": visit complete 2021-12-07T15:07:58.935Z [TRACE] GRPCProvider: Close 2021-12-07T15:07:58.935Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" 2021-12-07T15:07:58.936Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/newrelic/newrelic/2.32.0/darwin_amd64/terraform-provider-newrelic_v2.32.0 pid=60578 2021-12-07T15:07:58.936Z [DEBUG] provider: plugin exited 2021-12-07T15:07:58.936Z [TRACE] vertex "module.alerts.provider["registry.terraform.io/newrelic/newrelic"] (close)": visit complete 2021-12-07T15:07:58.936Z [TRACE] vertex "root": starting visit (*terraform.nodeCloseModule) 2021-12-07T15:07:58.936Z [TRACE] vertex "root": visit complete
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x18d6473]
goroutine 391 [running]: github.com/chzyer/readline.(*opSearch).ExitSearchMode(0xc000d606e0, 0x0) github.com/chzyer/[email protected]/search.go:118 +0x53 github.com/chzyer/readline.(*Operation).ioloop(0xc0001ba310) github.com/chzyer/[email protected]/operation.go:302 +0x6a7 created by github.com/chzyer/readline.NewOperation github.com/chzyer/[email protected]/operation.go:88 +0x310
Expected Behavior
What should have happened? Exit out of console without crash
Actual Behavior
What actually happened? Interrupt caused crash which froze terminal
Steps to Reproduce
Please list the full steps required to reproduce the issue, for example:
-
terraform console -
local.<var> * 1.1 -
^C
Additional Context
References
Hi @SennaSemakula,
Thanks for filing the issue. I'm not able to reproduce this, do you have any more information about the configuration or events that let up to the crash, and can you continue to replicate the issue? The same crash was once reported upstream with github.com/chzyer/readline, but that also contained no method to reproduce the issue.
There's a small possibility that this is fixed by some changes in the process handling of v1.1, so you could also try v1.1.0-rc1 to see if that behaves differently for you.
Thanks!
It seems like the more recent issue https://github.com/hashicorp/terraform/issues/33195 duplicated this one. Since that one has some more discussion about the cause I'm going to close this one in favor of that one, despite this being the earlier issue.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.