Open cversek opened 1 year ago
up
Here is a repro using my other system, Ubuntu 22.04.3 LTS. This time I inserted another print statement with the alphabet so the buffer misalignment can be measured (a clue?):
Welcome to Mojo! 🔥
Expressions are delimited by a blank line.
Type `:mojo help` for further assistance.
1> let my_var = "Hello mojo?"
2.
(StringLiteral) my_var = {
(string) value =
}
2> print(my_var)
3.
%.*s
3> let my_var2 = "Hello mojo!"
4. print(my_var2)
5.
Hello mojo!
(StringLiteral) my_var2 = {
(string) value =
}
5> print("abcdefghijklmnopqrstuvwxyz")
6.
abcdefghijklmnopqrstuvwxyz
6> print(my_var2)
7.
qrstuvwxyz
7> %%python
8. import sys
9. print("Python version from python:", sys.version)
10.
Python version from python: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:55:59) [GCC 12.3.0]
(PythonObject) sys = {
(PyObjectPtr) py_object = {
(pointer<scalar<si8>>) value = 0x00007f8d3457e390
}
}
10>
Bug is independent of variable mutability type:
1> my_var = "Hello mojo?"
2.
(StringLiteral) my_var = {
(string) value =
}
2> print(my_var)
3.
%.*s
3>
4> var my_var2 = "Hello mojo?"
5.
(StringLiteral) my_var2 = {
(string) value =
}
5> print(my_var2)
6.
%.*s
6>
not sure if related, but print("Hello, World!")
+ enter twice in Mojo REPL just hangs at the next line:
1> print("Hello, world!")
2.
Am running dev container on macos 11.7.8 (20G1351)
@hududed That bug might have a similar origin in your environment to the one in mine, but that statement seems to work correctly in mine.
@ematejska Still broken in v0.3 of the SDK... come on guys you need to prioritize a working REPL! Slightly different symptoms, but that's to be expected with a memory access bug:
Welcome to Mojo! 🔥
Expressions are delimited by a blank line.
Type `:quit` to exit the REPL and `:mojo help` for further assistance.
1> let my_var = "Hello mojo?"
2.
(StringLiteral) my_var = {
(string) value = "Hello mojo?"
}
2> print(my_var)
3.
%.*s
3> let my_var2 = "Hello mojo!"
4. print(my_var2)
5.
Hello mojo!
(StringLiteral) my_var2 = {
(string) value = "Hello mojo!"
}
5> print("abcdefghijklmnopqrstuvwxyz")
6.
abcdefghijklmnopqrstuvwxyz
6> print(my_var2)
7.
abcdefghijk
7>
- What OS did you do install Mojo on ?
Ubuntu 23.04
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 0.3.0 (f64f9601)
- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.1.4 (6b54d308)
@ematejska Still broken in v0.4.0 of the SDK, identical symptoms to v0.3.0 :
Welcome to Mojo! 🔥
Expressions are delimited by a blank line.
Type `:quit` to exit the REPL and `:mojo help` for further assistance.
1> let my_var = "Hello mojo?"
2.
(StringLiteral) my_var = "Hello mojo?"
2> print(my_var)
3.
%.*s
3> let my_var2 = "Hello mojo!"
4. print(my_var2)
5.
Hello mojo!
(StringLiteral) my_var2 = "Hello mojo!"
5> print("abcdefghijklmnopqrstuvwxyz")
6.
abcdefghijklmnopqrstuvwxyz
6> print(my_var2)
7.
abcdefghijk
7>
- What OS did you do install Mojo on ?
Ubuntu 23.04
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 0.4.0 (9e33b013)
- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.2.0 (355ea9c0)
This is a known issue with top level code.
@lattner It's great to hear that this issue is getting some attention now. I would have loved to contribute a possible fix with a PR, but that's hard to do without source code 😕... probably wouldn't understand all the mysterious layers anyway, but I do like a good puzzle. I imagine a working REPL would be a big priority, right up there with all the awesome features your team is currently implementing; so, can we expect a potential fix to test in v0.5?
@lattner @ematejska Well, it's been a while, on this occasion of the Mojo standard library being open sourced ( 🥂), I decided to test out this bug again.
Unfortunately, it is still broken in v24.2.0 of the SDK, similar symptoms as before:
Welcome to Mojo! 🔥
Expressions are delimited by a blank line.
Type `:quit` to exit the REPL and `:mojo help` for further assistance.
1> var my_var = "Hello mojo?"
2.
(StringLiteral) my_var = "Hello mojo?"
2> print(my_var)
3.
a
3> var my_var2 = "Hello mojo!"
4. print(my_var2)
5.
Hello mojo!
(StringLiteral) my_var2 = "Hello mojo!"
5> print("abcdefghijklmnopqrstuvwxyz")
6.
abcdefghijklmnopqrstuvwxyz
6> print(my_var2)
7> ^D
- What OS did you do install Mojo on ?
Ubuntu Ubuntu 23.10
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 24.2.0 (c2427bc5)
- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.5.2 (6b3a04fd)
Bug description
I just downloaded the 0.2.1 SDK and found a little quirk in the REPL. I couldn't find an existing issue which quite matched the odd behavior...
When a
let
type variable is entered in one block of the REPL and printed in another,print
shows a weird output. If the statements are in the same block it works (sort of).Steps to reproduce
The anomalous bind and print:
A working bind and print:
I am rocking Ubuntu 23.04 with this python interpreter:
Just for fun I tried to print that last variable again with weird results:
Looks like a buffer overflow?
System information