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

thread '<main>' panicked at 'failed printing to stdout: text was not valid unicode', ../src/libstd\io\stdio.rs:605 #30399

Closed
elszben opened this issue Dec 15, 2015 · 5 comments

Comments

@elszben
Copy link

elszben commented Dec 15, 2015

The following program crashes with the following error:

thread '<main>' panicked at 'failed printing to stdout: text was not valid unicode', ../src/libstd\io\stdio.rs:605
stack backtrace:
   0:     0x7ff62b16bb96 - sys::ext::ffi::_<impl>::from_wide::h7d706ea0d2d75a8bTlv
   1:     0x7ff62b1708e2 - rt::lang_start::h4ab332ee47264f57Hvy
   2:     0x7ff62b162dec - sys_common::unwind::begin_unwind_inner::h1902e3662294cf5c4Vs
   3:     0x7ff62b16304b - sys_common::unwind::begin_unwind_fmt::hee4d7f2cd7bc1d63aVs
   4:     0x7ff62b1673f1 - io::stdio::_print::hdf467dee241e2e05mch
   5:     0x7ff62b161208 - main
                        at D:\git\test\src\main.rs:2
   6:     0x7ff62b170398 - rt::lang_start::h4ab332ee47264f57Hvy
   7:     0x7ff62b167a16 - sys_common::unwind::try::inner_try::haec75e9195599bf0CSs
   8:     0x7ff62b17029d - rt::lang_start::h4ab332ee47264f57Hvy
   9:     0x7ff62b1620a9 - main
  10:     0x7ff62b175847 - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264
  11:     0x7ff8ee3613d1 - BaseThreadInitThunk
Process didn't exit successfully: `target\debug\test.exe` (exit code: 101)
   fn main() {
       let v: Vec<u8> = vec![182, 47, 3, 114, 23, 26, 184, 178, 77, 8, 222, 146, 185, 207, 124, 92, 166, 133, 69, 220, 181, 72, 11, 145, 137, 41, 217, 214, 181, 211, 161, 118, 20, 240, 34, 109, 167, 62, 140, 247, 230, 16, 250, 98, 84, 3, 30, 195, 5, 155, 139, 108, 248, 215, 29, 161, 164, 158, 44, 153, 124, 240, 68, 109, 88, 62, 208, 134, 108, 70, 187, 40, 76, 214, 103, 9, 151, 56, 85, 141, 12, 250, 95, 124, 136, 90, 85, 27, 165, 175, 18, 93, 42, 87, 44, 250, 52, 27, 251, 102, 35, 22, 79, 154, 195, 157, 30, 179, 150, 237, 116, 39, 182, 23, 122, 16, 138, 194, 93, 200, 169, 184, 81, 89, 141, 56, 99, 133, 43, 186, 214, 190, 188, 133, 44, 96, 98, 233, 196, 6, 29, 197, 27, 215, 110, 224, 74, 231, 53, 180, 145, 153, 151, 169, 41, 246, 85, 134, 28, 173, 153, 210, 118, 236, 46, 197, 151, 173, 120, 114, 137, 138, 133, 237, 245, 42, 138, 7, 103, 79, 122, 88, 87, 227, 254, 89, 6, 182, 167, 255, 220, 136, 152, 198, 232, 59, 120, 170, 176, 161, 132, 26, 1, 128, 124, 96, 170, 184, 48, 30, 13, 115, 250, 151, 117, 162, 197, 252, 241, 189, 252, 183, 244, 234, 201, 195, 134, 122, 30, 63, 254, 19, 158, 68, 221, 124, 253, 77, 41, 122, 181, 74, 241, 99, 228, 114, 94, 249, 182, 181, 68, 207, 31, 66, 110, 205, 189, 80, 243, 193, 43, 15, 218, 244, 170, 232, 134, 131, 237, 59, 199, 234, 38, 157, 190, 205, 227, 16, 37, 179, 48, 58, 28, 153, 138, 148, 119, 161, 45, 57, 143, 64, 155, 34, 17, 28, 192, 18, 237, 6, 136, 43, 160, 236, 63, 84, 18, 250, 15, 250, 9, 189, 103, 56, 190, 38, 70, 129, 137, 223, 89, 127, 43, 102, 9, 102, 223, 150, 58, 37, 25, 178, 85, 237, 99, 157, 17, 165, 187, 210, 230, 70, 22, 119, 10, 59, 252, 207, 96, 127, 155, 42, 164, 47, 247, 209, 73, 24, 38, 154, 142, 111, 46, 121, 15, 119, 128, 65, 235, 32, 140, 99, 137, 99, 158, 19, 15, 56, 58, 196, 138, 239, 4, 145, 210, 171, 168, 194, 11, 23, 110, 18, 251, 33, 101, 216, 208, 72, 13, 48, 175, 237, 51, 39, 49, 185, 123, 36, 232, 220, 90, 128, 238, 130, 117, 142, 163, 87, 137, 62, 179, 59, 198, 96, 96, 151, 20, 89, 143, 70, 169, 170, 223, 148, 60, 61, 253, 95, 113, 78, 113, 121, 168, 35, 139, 25, 27, 120, 72, 242, 11, 213, 126, 37, 230, 191, 54, 234, 57, 132, 138, 210, 126, 220, 150, 166, 24, 9, 27, 122, 153, 253, 156, 58, 41, 238, 194, 64, 148, 216, 247, 112, 54, 130, 135, 92, 155, 144, 115, 188, 165, 124, 159, 26, 193, 183, 86, 205, 164, 20, 207, 208, 243, 211, 49, 157, 2, 46, 108, 52, 58, 178, 82, 216, 127, 179, 26, 175, 72, 183, 171, 34, 228, 172, 131, 93, 175, 231, 221, 202, 23, 229, 133, 6, 119, 4, 121, 11, 176, 174, 86, 166, 112, 237, 191, 17, 115, 196, 218, 78, 215, 37, 231, 71, 254, 225, 26, 207, 221, 179, 214, 184, 159, 151, 49, 251, 214, 96, 209, 123, 252, 104, 14, 54, 105, 57, 225, 247, 9, 58, 148, 164, 91, 238, 141, 213, 138, 254, 214, 175, 210, 224, 15, 160, 89, 227, 5, 32, 204, 173, 123, 64, 154, 54, 132, 82, 176, 17, 128, 224, 178, 27, 105, 177, 14, 71, 66, 13, 224, 234, 83, 158, 57, 138, 199, 239, 122, 126, 163, 184, 17, 114, 215, 181, 96, 246, 182, 3, 154, 248, 138, 88, 27, 128, 84, 86, 57, 45, 60, 8, 143, 222, 75, 26, 41, 242, 84, 152, 151, 73, 87, 96, 194, 85, 238, 129, 253, 251, 82, 221, 27, 188, 236, 131, 192, 238, 227, 69, 39, 133, 107, 244, 78, 27, 133, 7, 159, 202, 143, 201, 141, 114, 172, 110, 29, 140, 150, 93, 128, 155, 169, 61, 245, 223, 194, 184, 16, 228, 50, 253, 125, 105, 196, 17, 96, 143, 206, 204, 30, 183, 20, 185, 32, 208, 12, 75, 36, 45, 46, 136, 77, 233, 106, 209, 220, 133, 16, 229, 216, 235, 84, 30, 53, 212, 45, 21, 17, 0, 69, 224, 117, 68, 231, 247, 205, 14, 214, 156, 162, 170, 237, 163, 246, 108, 67, 169, 187, 238, 184, 107, 43, 235, 22, 96, 70, 117, 127, 96, 225, 79, 15, 79, 34, 110, 127, 62, 110, 120, 226, 151, 204, 85, 200, 188, 183, 49, 241, 222, 166, 105, 207, 53, 112, 141, 59, 159, 125, 120, 227, 191, 2, 101, 254, 138, 149, 123, 162, 164, 60, 172, 126, 144, 177, 160, 22, 119, 205, 75, 92, 110, 243, 33, 179, 133, 240, 8, 65, 81, 10, 162, 219, 164, 187, 225, 7, 10, 179, 34, 226, 182, 65, 12, 5, 13, 183, 204, 78, 150, 5, 123, 242, 253, 161, 0, 105, 18, 185, 41, 213, 122, 47, 51, 32, 217, 111, 202, 119, 233, 205, 188, 254, 22, 151, 59, 59, 35, 37, 167, 178, 71, 180, 44, 86, 47, 79, 218, 42, 130, 243, 154, 150, 8, 26, 156, 237, 141, 17, 30, 96, 5, 24, 206, 246, 112, 147, 83, 76, 144, 14, 76, 117, 73, 88, 67, 216, 182, 7, 142, 233, 142, 109, 161, 54, 28, 218, 207, 125, 9, 109, 84, 49, 210, 126, 92, 143, 174, 90, 216, 128, 53, 22, 102, 130, 242, 252, 54, 196, 220, 96, 35, 88, 104, 30, 187, 89, 54, 108, 137, 158, 69, 144, 31, 177, 77, 220, 50, 227, 34, 81, 9, 109, 135, 53, 97, 129, 252, 81, 73, 51, 123, 124, 194, 199, 149, 183, 93, 108, 0, 68, 4, 184, 18, 84, 42, 247, 60, 64, 112, 232, 31, 130, 25, 159, 185, 107, 89, 98, 89, 113, 165, 106, 151, 93, 23, 172, 247, 142, 208, 219, 113, 69, 74, 73, 30, 47, 155, 15, 127, 173, 54, 163, 56, 149, 218, 124, 25, 234, 191, 245, 0, 14, 80, 186, 41, 165, 237, 183, 128, 250, 132, 35, 36, 54, 32, 13, 5, 103, 108, 27, 238, 110, 226, 56, 113, 22, 93, 248, 216, 124, 40, 240, 121, 238, 209, 73, 161, 1, 83, 16, 4, 21, 13, 38, 125, 45, 182, 86, 96, 84, 197, 12, 93, 230, 77, 222, 173, 215, 125, 182, 89, 120, 130, 89, 104, 92, 136, 181, 183, 7, 79, 212, 63, 239, 190, 163, 73, 22, 25, 216, 126, 109, 168, 247, 128, 231, 227, 91, 111, 244, 24, 51, 132, 8, 67, 15, 202, 156, 210, 16, 166, 68, 213, 118, 176, 239, 226, 174, 250, 25, 34, 130, 166, 24, 55, 186, 118, 58, 214, 221, 180, 213, 149, 74, 61, 227, 107, 165, 32, 191, 175, 89, 115, 107, 12, 216, 96, 47, 41, 62, 126, 131, 254, 94, 113, 191, 216, 147, 221, 227, 55, 194, 136, 101, 205, 160, 119, 211, 203, 247, 43, 30, 183, 55, 180, 103, 88, 91, 124, 169, 50, 244, 135, 127, 38, 91, 38, 71, 10, 110, 210, 116, 114, 116, 60, 254, 171, 124, 44, 177, 119, 133, 167, 109, 28, 18, 192, 146, 75, 203, 24, 58, 77, 66, 222, 218, 209, 187, 213, 192, 110, 224, 115, 4, 146, 104, 41, 119, 192, 247, 128, 51, 71, 91, 219, 35, 106, 135, 7, 164, 21, 73, 187, 236, 157, 199, 108, 93, 247, 222, 51, 200, 225, 34, 115, 246, 31, 125, 54, 119, 246, 74, 171, 176, 205, 85, 163, 21, 243, 3, 107, 23, 52, 42, 153, 212, 117, 11, 103, 169, 145, 148, 203, 142, 29, 36, 45, 242, 175, 235, 51, 174, 100, 233, 35, 49, 123, 206, 183, 184, 197, 194, 123, 224, 83, 35, 212, 42, 1, 218, 1, 11, 19, 88, 132, 146, 171, 135, 240, 243, 44, 240, 125, 190, 159, 251, 251, 184, 10, 83, 165, 170, 32, 47, 230, 137, 228, 156, 252, 18, 124, 84, 179, 201, 168, 55, 147, 102, 73, 203, 208, 78, 244, 107, 10, 33, 123, 183, 224, 42, 200, 127, 208, 208, 71, 224, 39, 200, 134, 158, 21, 177, 33, 174, 57, 191, 73, 113, 21, 37, 71, 181, 81, 93, 159, 17, 132, 197, 53, 228, 84, 142, 135, 99, 111, 181, 74, 4, 88, 110, 128, 237, 215, 85, 18, 234, 143, 154, 86, 136, 245, 167, 84, 141, 199, 217, 78, 96, 83, 45, 202, 117, 161, 171, 124, 163, 143, 2, 114, 44, 207, 87, 206, 226, 103, 246, 243, 200, 212, 28, 253, 205, 29, 83, 249, 67, 189, 233, 58, 231, 189, 133, 86, 217, 166, 134, 151, 96, 137, 128, 228, 237, 244, 193, 109, 134, 6, 160, 44, 166, 32, 28, 101, 164, 27, 132, 95, 188, 123, 99, 162, 65, 7, 166, 27, 199, 204, 92, 169, 223, 160, 125, 144, 137, 81, 59, 243, 237, 29, 152, 84, 152, 169, 26, 192, 210, 100, 112, 50, 228, 249, 181, 12, 230, 195, 10, 254, 123, 119, 29, 16, 92, 57, 93, 157, 78, 245, 35, 138, 50, 85, 155, 250, 179, 190, 19, 101, 55, 90, 240, 216, 55, 191, 20, 111, 101, 175, 147, 138, 244, 97, 36, 101, 191, 146, 57, 173, 106, 96, 207, 200, 164, 177, 97, 131, 183, 32, 52, 184, 9, 117, 84, 229, 17, 66, 66, 190, 80, 130, 249, 55, 156, 29, 207, 3, 214, 54, 134, 16, 33, 93, 131, 55, 239, 211, 121, 59, 188, 25, 128, 86, 242, 200, 22, 105, 83, 59, 232, 224, 35, 13, 134, 53, 41, 11, 107, 252, 176, 226, 221, 56, 245, 91, 40, 31, 11, 105, 69, 199, 199, 127, 210, 221, 14, 186, 121, 176, 48, 96, 177, 106, 122, 173, 198, 149, 147, 221, 159, 169, 116, 117, 66, 238, 222, 46, 138, 163, 175, 15, 63, 192, 170, 159, 113, 38, 83, 10, 182, 59, 97, 32, 130, 147, 172, 43, 216, 246, 210, 122, 39, 105, 207, 184, 0, 175, 63, 206, 210, 67, 231, 18, 252, 215, 96, 227, 127, 140, 119, 78, 231, 25, 89, 125, 198, 87, 122, 45, 73, 90, 232, 205, 115, 227, 200, 89, 56, 101, 32, 112, 76, 100, 233, 147, 240, 62, 23, 81, 132, 148, 134, 160, 51, 68, 200, 101, 135, 196, 189, 204, 125, 255, 90, 60, 222, 57, 140, 187, 38, 43, 1, 193, 107, 150, 156, 217, 30, 152, 93, 46, 189, 77, 96, 97, 41, 230, 56, 215, 69, 0, 13, 109, 59, 200, 45, 229, 191, 147, 178, 209, 27, 249, 135, 12, 102, 235, 87, 229, 32, 101, 208, 38, 120, 127, 147, 112, 206, 161, 243, 192, 194, 168, 204, 188, 178, 250, 150, 36, 112, 102, 101, 128, 235, 122, 145, 61, 242, 190, 100, 172, 16, 119, 156, 243, 43, 203, 143, 26, 29, 80, 153, 146, 159, 163, 115, 26, 193, 3, 236, 251, 68, 222, 223, 72, 5, 95, 211, 57, 107, 100, 40, 202, 151, 129, 34, 174, 184, 25, 89, 100, 247, 209, 27, 193, 192, 244, 73, 249, 97, 95, 177, 223, 157, 66, 245, 21, 177, 40, 107, 54, 8, 96, 86, 189, 152, 92, 65, 123, 8, 75, 2, 209, 64, 137, 254, 246, 88, 191, 86, 26, 181, 210, 235, 116, 233, 102, 203, 45, 208, 202, 98, 2, 211, 189, 79, 75, 4, 163, 108, 5, 16, 195, 206, 68, 106, 85, 202, 142, 24, 122, 170, 162, 214, 125, 72, 48, 118, 88, 194, 135, 158, 48, 47, 26, 204, 232, 156, 73, 145, 154, 178, 222, 160, 148, 101, 8, 97, 76, 91, 29, 240, 244, 64, 51, 216, 194, 19, 194, 92, 93, 1, 52, 61, 186, 111, 160, 149, 203, 207, 132, 147, 170, 40, 54, 243, 208, 179, 105, 23, 130, 119, 85, 176, 21, 91, 188, 235, 114, 19, 165, 188, 35, 195, 8, 162, 152, 193, 223, 175, 161, 38, 188, 16, 58, 129, 47, 69, 129, 61, 83, 192, 80, 121, 9, 141, 147, 254, 228, 100, 232, 49, 12, 221, 123, 10, 230, 87, 59, 14, 6, 137, 97, 54, 125, 74, 90, 176, 209, 102, 92, 23, 192, 26, 26, 159, 174, 245, 166, 81, 56, 185, 175, 147, 111, 176, 3, 45, 185, 245, 74, 8, 136, 198, 58, 238, 74, 138, 233, 152, 204, 184, 230, 254, 233, 251, 253, 225, 221, 154, 158, 89, 146, 159, 81, 177, 183, 32, 73, 237, 144, 23, 85, 61, 89, 7, 58, 46, 110, 0, 41, 148, 195, 67, 56, 82, 195, 96, 210, 168, 190, 143, 22, 214, 168, 167, 113, 39, 239, 252, 190, 88, 243, 110, 94, 137, 64, 132, 85, 78, 172, 150, 122, 151, 131, 78, 40, 250, 32, 64, 52, 151, 215, 87, 160, 70, 39, 232, 64, 182, 173, 255, 129, 122, 3, 54, 122, 55, 200, 252, 229, 99, 129, 240, 21, 20, 50, 37, 51, 102, 63, 113, 137, 162, 71, 134, 91, 241, 103, 104, 219, 147, 247, 95, 42, 71, 197, 129, 96, 244, 155, 220, 119, 193, 38, 140, 205, 199, 180, 253, 221, 91, 125, 126, 255, 239, 234, 179, 219, 251, 241, 66, 110, 174, 247, 219, 32, 147, 192, 133, 251, 174, 101, 170, 3, 223, 133, 213, 222, 253, 173, 115, 100, 12, 99, 247, 152, 119, 55, 25, 129, 242, 127, 36, 129, 222, 18, 133, 21, 205, 88, 89, 240, 197, 17, 250, 47, 53, 113, 227, 84, 115, 13, 178, 31, 181, 43, 183, 202, 144, 243, 39, 13, 90, 183, 131, 165, 4, 80, 188, 110, 196, 25, 189, 36, 208, 139, 24, 103, 8, 98, 191, 245, 202, 76, 119, 213, 21, 47, 60, 170, 239, 83, 152, 187, 182, 196, 253, 123, 9, 165, 58, 253, 72, 178, 49, 47, 53, 245, 135, 40, 53, 18, 244, 238, 159, 245, 150, 139, 106, 150, 113, 150, 118, 116, 160, 146, 118, 124, 238, 251, 74, 232, 40, 186, 16, 66, 194, 79, 114, 114, 35, 254, 87, 66, 249, 193, 29, 227, 60, 73, 209, 4, 92, 41, 63, 203, 10, 103, 236, 138, 41, 16, 97, 226, 83, 250, 48, 180, 109, 214, 186, 91, 63, 106, 84, 73, 14, 94, 120, 198, 222, 13, 123, 154, 142, 10, 21, 16, 212, 253, 68, 66, 135, 227, 6, 243, 76, 106, 60, 101, 250, 249, 233, 41, 81, 244, 15, 148, 191, 240, 143, 77, 107, 42, 224, 201, 154, 189, 139, 201, 163, 93, 44, 62, 180, 54, 218, 206, 94, 34, 76, 205, 79, 229, 8, 160, 187, 101, 135, 105, 125, 81, 229, 52, 170, 161, 89, 168, 31, 203, 168, 27, 96, 215, 147, 65, 162, 92, 124, 237, 59, 157, 210, 225, 19, 104, 60, 220, 221, 134, 251, 41, 101, 199, 41, 82, 224, 67, 68, 117, 173, 220, 8, 176, 207, 197, 13, 92, 195, 219, 40, 94, 66, 116, 209, 209, 14, 154, 135, 21, 247, 92, 205, 227, 54, 170, 13, 168, 183, 141, 62, 164, 105, 28, 232, 152, 48, 198, 154, 222, 189, 230, 175, 35, 100, 107, 42, 20, 70, 252, 127, 206, 16, 94, 233, 153, 20, 248, 34, 103, 243, 4, 168, 198, 43, 203, 68, 136, 238, 227, 220, 114, 139, 9, 195, 100, 198, 54, 255, 230, 10, 52, 158, 158, 184, 248, 209, 234, 202, 172, 207, 169, 212, 127, 94, 158, 180, 61, 123, 130, 238, 164, 109, 133, 85, 75, 195, 6, 202, 12, 141, 74, 127, 4, 124, 15, 220, 187, 92, 171, 199, 90, 217, 101, 159, 8, 211, 103, 12, 60, 114, 114, 234, 151, 88, 223, 222, 121, 228, 183, 136, 1, 60, 89, 238, 21, 124, 118, 228, 81, 175, 186, 162, 95, 23, 56, 117, 20, 60, 38, 81, 47, 24, 42, 129, 1, 21, 82, 180, 54, 10, 18, 131, 178, 224, 183, 4, 83, 120, 247, 168, 23, 149, 87, 223, 226, 20, 133, 180, 48, 129, 196, 122, 13, 90, 245, 127, 92, 248, 22, 201, 7, 17, 238, 18, 251, 148, 239, 51, 33, 236, 210, 0, 60, 201, 214, 19, 234, 240, 38, 174, 163, 15, 242, 117, 209, 231, 120, 203, 198, 49, 206, 192, 171, 105, 120, 14, 53, 21, 118, 207, 148, 104, 159, 36, 240, 83, 219, 114, 123, 86, 187, 132, 27, 190, 201, 12, 228, 214, 31, 176, 168, 197, 168, 4, 44, 21, 221, 6, 189, 38, 6, 66, 235, 131, 208, 122, 249, 103, 200, 18, 76, 238, 12, 135, 233, 235, 154, 144, 91, 18, 175, 91, 72, 240, 213, 124, 107, 227, 52, 137, 175, 0, 170, 62, 128, 23, 161, 119, 82, 254, 136, 52, 233, 39, 194, 69, 169, 42, 220, 106, 66, 64, 104, 170, 142, 183, 0, 220, 160, 31, 203, 168, 97, 160, 80, 29, 225, 118, 89, 210, 68, 221, 212, 45, 191, 233, 97, 119, 215, 55, 23, 215, 0, 26, 126, 155, 92, 89, 135, 139, 0, 188, 218, 160, 172, 24, 176, 139, 53, 7, 170, 6, 36, 180, 34, 130, 175, 124, 107, 255, 28, 254, 145, 75, 205, 195, 83, 27, 145, 9, 212, 188, 94, 201, 232, 72, 132, 19, 43, 80, 178, 163, 225, 228, 224, 76, 241, 226, 222, 231, 89, 39, 141, 70, 242, 123, 117, 43, 157, 92, 106, 174, 215, 32, 242, 154, 174, 80, 175, 91, 241, 14, 31, 43, 159, 117, 152, 52, 24, 88, 84, 140, 185, 41, 145, 0, 154, 125, 158, 191, 200, 180, 93, 160, 183, 101, 164, 60, 32, 238, 201, 216, 189, 195, 229, 135, 227, 68, 90, 216, 122, 19, 21, 228, 186, 6, 193, 69, 28, 34, 81, 42, 53, 209, 27, 219, 108, 120, 180, 64, 166, 232, 68, 197, 55, 0, 130, 172, 96, 2, 131, 131, 155, 105, 107, 50, 156, 201, 17, 144, 123, 10, 254, 240, 210, 91, 239, 69, 155, 174, 104, 137, 169, 188, 52, 23, 68, 170, 9, 148, 183, 187, 250, 109, 46, 234, 183, 147, 54, 8, 74, 158, 24, 199, 79, 92, 235, 73, 117, 212, 25, 7, 203, 52, 11, 182, 179, 122, 72, 169, 0, 29, 190, 44, 185, 213, 50, 160, 207, 220, 246, 25, 181, 61, 242, 47, 217, 129, 10, 189, 18, 154, 117, 191, 13, 243, 166, 243, 79, 120, 126, 74, 46, 237, 243, 45, 175, 12, 45, 141, 13, 111, 24, 61, 198, 199, 146, 14, 27, 147, 7, 85, 205, 36, 69, 8, 131, 115, 146, 153, 40, 114, 251, 241, 53, 89, 196, 254, 85, 172, 211, 30, 72, 79, 68, 169, 91, 243, 177, 140, 80, 54, 132, 241, 20, 114, 86, 106, 211, 171, 95, 177, 141, 4, 222, 229, 155, 76, 8, 250, 88, 35, 165, 152, 210, 146, 183, 60, 62, 130, 113, 65, 45, 202, 79, 19, 11, 42, 46, 132, 146, 135, 184, 150, 240, 21, 239, 137, 249, 164, 176, 101, 5, 164, 116, 4, 58, 131, 199, 198, 244, 8, 166, 240, 168, 24, 195, 41, 68, 63, 146, 224, 197, 101, 82, 245, 64, 5, 219, 201, 22, 227, 247, 224, 60, 123, 5, 99, 119, 105, 36, 239, 169, 120, 104, 26, 24, 230, 212, 249, 63, 110, 42, 245, 64, 88, 94, 242, 13, 181, 164, 66, 194, 99, 4, 131, 178, 121, 36, 89, 39, 206, 65, 38, 194, 252, 132, 27, 149, 54, 143, 103, 141, 5, 202, 163, 185, 135, 185, 195, 196, 154, 48, 242, 182, 61, 148, 63, 197, 102, 162, 244, 166, 247, 137, 174, 90, 186, 40, 235, 113, 219, 0, 207, 98, 180, 32, 113, 83, 37, 105, 151, 60, 205, 243, 172, 84, 31, 119, 88, 196, 167, 209, 249, 221, 80, 87, 88, 77, 230, 54, 12, 185, 73, 11, 213, 46, 157, 152, 197, 75, 60, 225, 76, 52, 136, 13, 121, 248, 42, 218, 84, 79, 195, 238, 155, 14, 20, 64, 197, 27, 106, 170, 152, 201, 222, 117, 117, 182, 165, 247, 60, 65, 225, 246, 175, 149, 210, 81, 60, 123, 24, 209, 245, 138, 221, 187, 113, 238, 72, 56, 45, 139, 220, 199, 65, 228, 62, 230, 28, 24, 6, 45, 15, 108, 110, 205, 95, 188, 132, 90, 97, 189, 66, 218, 139, 17, 12, 12, 69, 193, 3, 13, 201, 235, 168, 233, 188, 90, 220, 43, 52, 37, 194, 203, 131, 75, 50, 163, 125, 169, 140, 129, 47, 99, 43, 147, 32, 72, 218, 245, 19, 41, 186, 50, 216, 17, 114, 232, 9, 185, 43, 69, 219, 53, 125, 7, 28, 215, 222, 229, 99, 137, 230, 201, 222, 220, 201, 213, 186, 56, 85, 113, 32, 72, 0, 31, 88, 121, 237, 130, 49, 11, 169, 160, 122, 233, 168, 107, 179, 22, 101, 193, 107, 200, 234, 151, 42, 241, 15, 251, 185, 232, 1, 176, 41, 164, 67, 101, 112, 67, 55, 124, 83, 79, 15, 50, 38, 61, 49, 6, 174, 76, 21, 215, 69, 136, 75, 145, 66, 172, 187, 237, 55, 157, 72, 69, 175, 229, 47, 222, 169, 114, 250, 111, 168, 110, 201, 109, 36, 106, 247, 131, 80, 63, 119, 190, 239, 225, 40, 54, 137, 62, 236, 64, 29, 54, 80, 94, 26, 241, 77, 255, 64, 44, 72, 232, 253, 186, 36, 68, 208, 150, 237, 93, 150, 21, 173, 56, 85, 47, 128, 218, 244, 78, 153, 2, 27, 211, 248, 5, 40, 165, 6, 43, 94, 87, 93, 105, 90, 146, 116, 102, 73, 121, 195, 213, 41, 149, 57, 130, 159, 40, 144, 40, 165, 174, 141, 224, 76, 196, 94, 255, 217, 40, 203, 168, 194, 196, 20, 91, 21, 8, 206, 60, 123, 95, 157, 69, 9, 169, 249, 89, 219, 21, 179, 30, 149, 167, 129, 249, 102, 216, 116, 138, 21, 156, 72, 30, 8, 146, 19, 21, 84, 20, 173, 134, 95, 177, 76, 3, 71, 91, 158, 216, 90, 249, 196, 178, 215, 83, 92, 88, 24, 2, 216, 127, 206, 90, 147, 236, 225, 47, 14, 80, 151, 175, 64, 245, 1, 108, 190, 234, 158, 61, 203, 118, 170, 103, 132, 184, 146, 126, 64, 30, 77, 33, 71, 153, 121, 103, 203, 113, 57, 88, 218, 147, 244, 139, 211, 137, 236, 236, 90, 20, 76, 223, 190, 50, 154, 255, 10, 244, 19, 171, 10, 61, 1, 157, 197, 163, 142, 240, 241, 249, 27, 143, 28, 219, 48, 223, 94, 238, 18, 89, 225, 154, 251, 80, 29, 47, 253, 183, 157, 243, 45, 236, 7, 232, 240, 146, 0, 144, 234, 67, 251, 170, 114, 27, 175, 235, 57, 95, 203, 61, 62, 1, 39, 127, 190, 116, 136, 145, 217, 38, 4, 194, 163, 95, 154, 154, 209, 52, 151, 142, 107, 31, 231, 207, 40, 14, 127, 37, 173, 143, 53, 219, 121, 240, 210, 81, 180, 152, 50, 55, 73, 202, 152, 217, 232, 165, 85, 242, 215, 93, 216, 252, 158, 55, 106, 30, 167, 28, 19, 10, 7, 145, 32, 161, 236, 222, 11, 228, 124, 49, 219, 149, 88, 157, 9, 43, 181, 10, 215, 119, 236, 236, 215, 117, 109, 193, 113, 147, 169, 219, 59, 245, 33, 31, 164, 237, 69, 41, 77, 112, 239, 241, 104, 44, 136, 249, 149, 187, 172, 127, 212, 155, 95, 213, 22, 29, 229, 239, 40, 185, 69, 105, 97, 121, 95, 155, 33, 223, 63, 82, 29, 78, 101, 114, 150, 88, 50, 226, 26, 84, 251, 189, 129, 243, 225, 107, 214, 25, 212, 35, 42, 213, 213, 182, 73, 130, 213, 14, 245, 88, 160, 119, 84, 125, 187, 11, 124, 16, 32, 37, 233, 168, 164, 148, 224, 19, 96, 159, 139, 31, 177, 4, 64, 124, 85, 202, 231, 63, 211, 102, 239, 88, 194, 11, 231, 104, 90, 223, 180, 125, 173, 37, 82, 240, 81, 196, 135, 93, 115, 19, 9, 105, 230, 63, 167, 255, 230, 143, 175, 207, 86, 167, 138, 69, 12, 7, 119, 137, 176, 171, 1, 180, 87, 243, 62, 140, 153, 65,
   131, 124, 80, 153, 136, 46, 242, 92, 21, 255, 18, 227, 189, 134, 234, 7, 195, 4, 210, 45, 69, 187, 32, 54, 95, 43, 149, 129, 9, 222, 44, 104, 165, 246, 130, 68, 127, 214, 233, 220, 12, 6, 192, 127, 92, 34, 6, 9, 53, 71, 144, 61, 213, 209, 66, 163, 5, 165, 56, 7, 212, 175, 51, 248, 209, 164, 158, 152, 16, 95, 88, 202, 105, 55, 57, 228, 58, 15, 181, 218, 200, 16, 7, 165, 243, 77, 30, 23, 213, 110, 96, 105, 106, 151, 215, 9, 205, 135, 104, 52, 220, 77, 121, 233, 237, 219, 229, 66, 112, 126, 246, 41, 31, 14, 159, 247, 168, 236, 116, 161, 120, 229, 52, 201, 127, 42, 22, 139, 118, 32, 58, 108, 151, 47, 66, 71, 17, 197, 227, 109, 212, 3, 31, 132, 178, 101, 194, 40, 52, 20, 3, 99, 101, 83, 156, 147, 20, 62, 34, 188, 150, 37, 124, 255, 45, 59, 96, 149, 42, 126, 155, 234, 21, 140, 50, 132, 240, 162, 170, 41, 39, 17, 38, 52, 26, 1, 195, 157, 144, 104, 101, 144, 118, 222, 73, 238, 37, 189, 88, 190, 102, 192, 120, 166, 97, 221, 196, 218, 225, 199, 127, 80, 177, 156, 218, 201, 192, 134, 120, 14, 35, 83, 181, 215, 113, 152, 238, 75, 97, 178, 74, 14, 68, 116, 212, 190, 18, 139, 26, 250, 230, 127, 35, 60, 163, 174, 154, 153, 252, 99, 176, 215, 135, 12, 0, 251, 217, 107, 43, 241, 42, 75,
   157, 79, 36, 89, 8, 253, 207, 85, 48, 238, 155, 183, 92, 18, 151, 47, 146, 77, 137, 27, 215, 47, 206, 213, 236, 249, 72, 46, 132, 151, 164, 56, 4, 68, 140, 74, 195, 209, 225, 193, 211, 90, 131, 184, 27, 159, 248, 108, 254, 40, 220, 81, 145, 38, 17, 198, 114, 227, 154, 217, 225, 173, 171, 164, 13, 209, 117, 90, 157, 133, 250, 16, 73, 82, 107, 232, 160, 161, 215, 7, 198, 160, 151, 128, 227, 71, 12, 200, 97, 165, 38, 237, 225, 108, 239, 49, 171, 121, 58, 192, 42, 239, 141, 121, 177, 14, 19, 164, 248, 100, 151, 173, 106, 81, 67, 98, 165, 229, 124, 220, 113, 246, 218, 206, 145, 68, 242, 251, 119, 187, 235, 185, 162, 199, 72, 234, 98, 137, 9, 101, 238, 189, 202, 21, 196, 8, 65, 29, 14, 16, 66, 2, 17, 114, 213, 169, 225, 59, 239, 162, 153, 216, 53, 182, 76, 251, 97, 237, 78, 79, 93, 120, 8, 29, 35, 125, 233, 146, 30, 176, 160, 255, 10, 43, 73, 131, 114, 81, 76, 145, 34, 180, 119, 45, 182, 92, 155, 108, 140, 18, 141, 33, 192, 206, 76, 132, 97, 146, 54, 181, 129, 227, 46, 172, 89, 215, 88, 246, 93, 53, 36, 120, 213, 144, 92, 143, 38, 154, 250, 3, 46, 95, 123, 2, 180, 12, 235, 139, 147, 244, 89, 221, 0, 52, 252, 74, 133, 78, 183, 247, 171, 101, 252, 33, 74, 175, 5, 111, 79, 13, 90, 173, 191, 91, 233, 40, 14, 218, 130, 68, 134, 82, 236, 214, 177, 162, 42, 101, 220, 128, 220, 121, 151, 127, 29, 98, 223, 140, 103, 14, 46, 44, 242, 1, 106, 205, 151, 101, 9, 34, 173, 60, 231, 108, 184, 23, 232, 96, 123, 44, 8, 110, 147, 81, 42, 243, 121, 57, 239, 233, 9, 147, 133, 109, 127, ];
    let s = String::from_utf8_lossy(&v);
    // println!("Len {}", s.len());
    println!("{}", s);
}

Unfortunately I could not reduce the size further, if I remove larger blocks the fault disappear and I couldn't be bothered to figure out what exactly can be removed by removing single bytes:)
The fault does not appear in the playground. Possibly windows related?

The used rustc version:
rustc 1.7.0-nightly (110df04 2015-12-13) (MSVC edition)

It is running on windows 8.1 64bit.

@mbrubeck
Copy link
Contributor

cc #23344

@AerialX
Copy link

AerialX commented Dec 15, 2015

Related to #23344

When writing data, we don't handle the case where a multibyte character straddles calls to write. Like the reading case, this could be alleviated with a 4-byte buffer for unwritten-but-valid-utf8 characters.

Regardless of a proper approach to all of #23344, dealing with this case would be a good interim fix.

@elszben
Copy link
Author

elszben commented Dec 15, 2015

This code crashes with the same error.

    let v = vec![255u8; 5000];
    let s = String::from_utf8_lossy(&v);
    // println!("Len {}", s.len());
    println!("{}", s);

@retep998
Copy link
Member

I suppose it was inevitable that someone would run into this edge case of how we handle unicode in the console on Windows.

@alexcrichton
Copy link
Member

I believe that this is an unfortunate result of #23344, so I'm going to close in favor of that (as that's the issue at hand here), but thanks for the report!

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

No branches or pull requests

5 participants