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

Segfaults when context vars are duplicated #121

Closed
naqvis opened this issue Oct 14, 2022 · 2 comments
Closed

Segfaults when context vars are duplicated #121

naqvis opened this issue Oct 14, 2022 · 2 comments
Labels

Comments

@naqvis
Copy link
Contributor

naqvis commented Oct 14, 2022

Bug Report

Duplicating context variables is causing Pipy to Segv on *nix based systems. Behavior is inconsistent on different Oses as on CentOS it crashes at startup, while on Ubuntu (focal) 20.04 LTS , it crashes at exit.

Mac M1 machine doesn't show this behavior

Pipy Version

Version     : nightly-202210120857
Commit      : 78b04769a3c9144aa42edb3b893bbce203c32e1f
Commit Date : Wed, 12 Oct 2022 16:57:28 +0800
Host        : Linux-5.15.0-1020-azure x86_64
OpenSSL     : OpenSSL 1.1.1q  5 Jul 2022
Builtin GUI : No

Steps to reproduce

$ pipy -e "pipy({_g: {}, _g: {}}).listen(8000)"

Output

$ ./pipy -e "pipy({_g: {}, _g: ''}).listen(8000)"
2022-10-14 14:13:09.638 [INF] [config]
2022-10-14 14:13:09.638 [INF] [config] Module
2022-10-14 14:13:09.638 [INF] [config] =======
2022-10-14 14:13:09.638 [INF] [config]
2022-10-14 14:13:09.638 [INF] [config]  [Listen on 8000 at 0.0.0.0]
2022-10-14 14:13:09.638 [INF] [config]  ----->|
2022-10-14 14:13:09.638 [INF] [config]        |
2022-10-14 14:13:09.638 [INF] [config]
2022-10-14 14:13:09.638 [INF] [config]  <---|
2022-10-14 14:13:09.638 [INF] [config]
2022-10-14 14:13:09.638 [INF] [listener] Listening on TCP port 8000 at 0.0.0.0
^C2022-10-14 14:13:12.648 [INF] [shutdown] Shutting down...
Segmentation fault (core dumped)
pajama-coder added a commit that referenced this issue Oct 15, 2022
…d be linearly increasing so crashed when duplicated field names made them non-linear
@pajama-coder
Copy link
Collaborator

Fixed in commit f812272

@naqvis
Copy link
Contributor Author

naqvis commented Oct 15, 2022

Thanks @pajama-coder. Verified on Ubuntu and CentOS and fix working as expected. Closing this issue now.

@naqvis naqvis closed this as completed Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants