You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sending ctrl-d to input() when it asks for input causes mojo to crash. this doesn't happen if you do provide some input before pressing ctrl-d.
also, this is probably not relevant but im including it just in case, i noticed that input() behaved differently compared to python's input() when the user presses ctrl-d after providing some input (the programs' output is identical).
in this python program, input() returns the input after the user presses ctrl-d 3 times:
name=input("Who are you? ")
greeting="Hi, "+name+"!"print(greeting)
output: Who are you? mahiroHi, mahir!
whereas in the mojo program from the mojo manual, for example, input() will return after the users press ctrl-d 2 times.
output: Who are you? mahiroHi, mahir!
Steps to reproduce
write any program that calls input()
run the program with mojo run program_name.mojo
press ctrl-d when the program asks for input
crash backtrace of the program linked earlier that asks the user for their name to greet them:
(conway-gol) conway-gol -> mojo run main.mojo
Who are you? Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0. Program arguments: mojo run main.mojo
#0 0x00006144c6a616bb llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) Signals.cpp:0:0
#1 0x00006144c6a5f619 llvm::sys::RunSignalHandlers() Signals.cpp:0:0
#2 0x00006144c6a61d3d SignalHandler(int) Signals.cpp:0:0
#3 0x00007005824d81d0 (/usr/lib/libc.so.6+0x3d1d0)
#4 0x00007004e8001e85
mojo crashed!
Please file a bug report.
Segmentation fault (core dumped)
Bug description
sending
ctrl-d
toinput()
when it asks for input causes mojo to crash. this doesn't happen if you do provide some input before pressingctrl-d
.also, this is probably not relevant but im including it just in case, i noticed that
input()
behaved differently compared to python'sinput()
when the user pressesctrl-d
after providing some input (the programs' output is identical).in this python program,
input()
returns the input after the user pressesctrl-d
3 times:output:
Who are you? mahiroHi, mahir!
whereas in the mojo program from the mojo manual, for example,
input()
will return after the users pressctrl-d
2 times.output:
Who are you? mahiroHi, mahir!
Steps to reproduce
input()
mojo run program_name.mojo
ctrl-d
when the program asks for inputcrash backtrace of the program linked earlier that asks the user for their name to greet them:
System information
The text was updated successfully, but these errors were encountered: