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

rusti seg faults with non-ascii comments #8924

Closed
gifnksm opened this issue Sep 2, 2013 · 2 comments · Fixed by #9897
Closed

rusti seg faults with non-ascii comments #8924

gifnksm opened this issue Sep 2, 2013 · 2 comments · Fixed by #9897

Comments

@gifnksm
Copy link
Contributor

gifnksm commented Sep 2, 2013

rusti 0.8-pre has this program.

$ rust -v
rust 0.8-pre (04fac7f 2013-08-31 15:15:40 -0700)
host: x86_64-unknown-linux-gnu

$ rusti
WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> let a = 123; // 日本語
zsh: segmentation fault (core dumped)  rusti

$ rusti
WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> let a = 123; // 中华
zsh: segmentation fault (core dumped)  rusti

$ rusti
WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> let a = 123; // Việt Nam
zsh: segmentation fault (core dumped)  rusti

If the lines with non-ascii comments contain syntax error and the next line without errors nor comments, rusti causes seg faults.

$ rusti
WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> lest a = 123; // 日本語
<anon>:2:6: 2:7 error: expected one of `; }` but found `a`
<anon>:2  lest a = 123; // 日本語
               ^
task <unnamed> failed at 'explicit failure', /home/nksm/pkg/rust/src/rust/src/libsyntax/diagnostic.rs:69
rusti> let a = 123;
zsh: segmentation fault (core dumped)  rusti

rusti 0.7 doesn't have this problem.

$ rust -v
rust 0.7
host: x86_64-unknown-linux-gnu

$ rusti
WARNING: The Rust REPL is experimental and may be
unstable. If you encounter problems, please use the
compiler instead. Type :help for help.
rusti> let a = 123; // 中华
rusti> let a = 123; // 日本語
rusti> let a = 123; // Việt Nam
rusti>
@klutzy
Copy link
Contributor

klutzy commented Sep 3, 2013

Does rusti work at all? Mine (73a28e5 / x86_64-unknown-linux-gnu) just segfaults with let a = 1; without comments.

@alexcrichton
Copy link
Member

Sadly rusti's tests are disabled (for being far too flaky), so it's very possible that it's not working. It sounded like @mrordinaire was going to start looking into rusti soon though.

bors added a commit that referenced this issue Oct 17, 2013
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
Closes #5038
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2022
…ffate

Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`

fixes rust-lang#8924

changelog: Suggest casting the pointer for any type containing lifetimes in `transmute_ptr_to_ref`.
changelog: Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants