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

[BUG] the second input() segfaults when using standard input redirection #3961

Open
puni073 opened this issue Jan 19, 2025 · 0 comments
Open
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@puni073
Copy link

puni073 commented Jan 19, 2025

Bug description

when using standard input redirection, the first input() works but the second causes a segmentation fault.

Steps to reproduce

main.mojo

def main():
  a = input()
  print(a)
  b = input()
  print(b)

input.txt

str1
str2
str3

magic run mojo build main.mojo
./main < input.txt

str1
Segmentation fault (core dumped)

System information

- What OS did you do install Mojo on ?
/etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"

- Provide version information for Mojo by pasting the output of `mojo -v`

mojo 24.6.0 (4487cd6e)

- Provide Magic CLI version by pasting the output of `magic -V` or `magic --version` 

magic 0.6.2 - (based on pixi 0.40.0)

- Optionally, provide more information with `magic info`.
@puni073 puni073 added bug Something isn't working mojo-repo Tag all issues with this label labels Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

1 participant