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

Panic in Terraform console command #33195

Open
pcarles opened this issue May 15, 2023 · 7 comments · May be fixed by #33305
Open

Panic in Terraform console command #33195

pcarles opened this issue May 15, 2023 · 7 comments · May be fixed by #33305
Labels
bug new new issue not yet triaged upstream

Comments

@pcarles
Copy link
Contributor

pcarles commented May 15, 2023

Terraform Version

Terraform v1.4.6
on linux_amd64

Terraform Configuration Files

No config files required

Debug Output

https://gist.github.com/pcarles/da14c26485822361018252868c66e62f

Expected Behavior

Terraform should exit gracefully

Actual Behavior

Terraform panic with a segfault

Steps to Reproduce

  1. terraform console anywhere
  2. Hit Ctrl + R to go in backward search
  3. Hit Ctrl + C to exit Terraform console

Additional Context

You don't need any configuration file to reproduce this error, and doing it with configuration files present do not change the behavior, it seems to be consistent.

I may open a PR to to fix it when I have a bit of time

References

No response

@pcarles pcarles added bug new new issue not yet triaged labels May 15, 2023
@crw
Copy link
Contributor

crw commented May 16, 2023

Thanks for this report!

@justincange
Copy link

justincange commented May 29, 2023

I took a look into this and I think it might actually be a bug from the ReadLine library. I'm seeing they have a very similar problem on exiting the console in this issue here.

Edit: After a closer look I think this is just an issue with ReadLine, which is getting called in (and crashing) from the console.

@crw crw added the upstream label May 30, 2023
@v1gnesh
Copy link

v1gnesh commented Jun 1, 2023

Seems like perfect timing.

@crw, could you please assess if chzyer/readline can be swapped out for a maintained fork - ergochat/readline?

chzyer/readline#226 (comment)

@slingamn
Copy link

slingamn commented Jun 1, 2023

Hi, I'm one of the ergochat/readline maintainers and I'm very interested in seeing if our fork is suitable for use in terraform! From my initial investigation:

  1. Our latest release, v0.0.3, can be used in terraform as a drop-in replacement. (Please don't be scared off by the unstable version number; the excessive size of the upstream API had become a tarpit. We are working on shrinking the public API to something that is more maintainable.)
  2. The panic from upstream's issue 163 is still present in our fork, but it should be an easy fix that I can work on immediately.

@slingamn
Copy link

slingamn commented Jun 1, 2023

I opened a PR for this: ergochat/readline#33

@slingamn slingamn linked a pull request Jun 2, 2023 that will close this issue
@slingamn
Copy link

slingamn commented Jun 2, 2023

I released the previously mentioned fix, released it as v0.0.5, and wrote a draft PR for Terraform that switches to ergochat/[email protected]: #33305

@crw
Copy link
Contributor

crw commented Jun 2, 2023

Thanks for this information and the pull request! The question of changing / updating dependencies is being run past the security team. We appreciate the background and info on these libraries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new new issue not yet triaged upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants