-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
ICE when combining "\r", unicode, and unused parameter in format string #70381
Comments
Godbolt says this regressed in 1.29.0. |
pre-triage: this doesn't seem to be very important but would be of course nice to fix. Tagging it as |
@rustbot claim |
I tried a few things and I will document what I found, so hopefully this can jumpstart some ideas: I removed the assert that was initiating the panic, and I see:
Notice the OBOE on the positioning of the So, I tried different escape sequences, and got mildly confusing results
Here we have an off by two error in the other direction Now, I tried the unicode escape that should (assuming I didn't misremember something) be equivalent to \r:
And that seems to work just fine. So, I suspect we somehow interpret escape sequences as the character they represent, but not other times. If this causes us to be offcut in the middle of a UTF-8 multibyte sequence, then we ICE, but there are cases where the EDIT: a few more observations Turns out the OBOE can be seen with just old fashioned ASCII (no multi-byte utf-8 characters needed):
In addition, springboarding off what @Centril found, going from 1.28.0 to.1.29.0 the
|
After a bunch of debug prints, and counting bytes, I am now convinced that the code in the function that is panicing, is not the problem. The inputs to that function are faulty. In particular the I forked and branched with what I have done so far: https://github.com/kfitch/rust/tree/issue-70381-escape-sequence-ice |
@rustbot claim |
It is open, go ahead :) |
@amadeusine , FYI what is in my branch: Also, I have not addressed unit tests at all yet. Also, I am beginning to suspect there may be a larger (yet subtle) underlying confusion somewhere else in the code about bytes vs characters. The find_skips function I just updated has comments talking about characters, but data derived from what it generates is later fed into |
I have also found that this off by n error will occur with any unicode character whose display width is non-standardized and non one.
I have not yet checked the source to try to fix the issue, but I have worked with |
Hi, are you still working on this issue @amadeusine? |
@rustbot release-assignment |
The following code causes an ICE:
As far as I can tell:
\r
and¡
and the error will still happen.¡
can be replaced with any unicode character and the error will still happen.\r
cause the error.The error is reproducible on the stable or nightly compiler at https://play.rust-lang.org.
rustc --version --verbose
outputs the following on my machine:Error output
Backtrace
The text was updated successfully, but these errors were encountered: