servo / unicode-bidi

Implementation of the Unicode Bidirection Algorithm in Rust
Other
77 stars 33 forks source link

String splicing being done incorrectly in process_text() #22

Closed vicky-katara closed 7 years ago

vicky-katara commented 8 years ago

Here is the stack trace. Somewhere in process_text(), the splicing is done incorrectly.

thread 'test::test_reorder_line' panicked at 'index 2 and/or 3 in אב(גד[&ef].)gh do not lie on character boundary', ../src/libcore/str/mod.rs:1284

stack backtrace: 1: 0x564cc1e817fe - sys::backtrace::write::haf6e4e635ac76143Ivs 2: 0x564cc1e84f25 - panicking::on_panic::ha085a58a08f78856lzx 3: 0x564cc1e7885e - rt::unwind::begin_unwind_inner::hc90ee27246f12475C0w 4: 0x564cc1e791f6 - rt::unwind::begin_unwind_fmt::ha4be06289e0df3dbIZw 5: 0x564cc1e84b86 - rust_begin_unwind 6: 0x564cc1eb3aa4 - panicking::panic_fmt::he7875691f9cbe589SgC 7: 0x564cc1eb624f - str::slice_error_fail::hbe442ed6cb13a72dsqK 8: 0x564cc1e0688a - str::traits::str.ops..Index>::index::h909793bab573faecccK at ../src/libcore/str/mod.rs:1104 9: 0x564cc1e0e9c0 - reorder_line::h180dad6937165a51e6b at /home/servo/unicode-bidi/src/lib.rs:176 10: 0x564cc1e32aae - test::test_reorder_line::reorder_with_para_level::ha84ac2c49163f9500Id at /home/servo/unicode-bidi/src/lib.rs:1237 11: 0x564cc1e31e66 - test::test_reorder_line::h00b48c9c08476d87iId at /home/servo/unicode-bidi/tools/:1262 12: 0x564cc1e5611b - boxed::F.FnBox::call_box::h13096251856404813500 13: 0x564cc1e58de1 - boxed::F.FnBox::call_box::h17352075482666389094 14: 0x564cc1e568c9 - rt::unwind::try::try_fn::h2399095994474881594 15: 0x564cc1e84add - __rust_try 16: 0x564cc1e7fe37 - rt::unwind::try::inner_try::h59523aa853a0e10avWw 17: 0x564cc1e56ae8 - boxed::F.FnBox::call_box::h389096937566750418 18: 0x564cc1e83c81 - sys::thread::Thread::new::thread_start::h890d1188505773c835v 19: 0x7fe317fc7554 - start_thread 20: 0x7fe3178e3b9c - __clone 21: 0x0 -

failures: test::test_reorder_line

test result: FAILED. 11 passed; 1 failed; 0 ignored; 0 measured

thread '

' panicked at 'Some tests failed', ../src/libtest/lib.rs:252 stack backtrace: 1: 0x564cc1e817fe - sys::backtrace::write::haf6e4e635ac76143Ivs 2: 0x564cc1e851b6 - panicking::on_panic::ha085a58a08f78856lzx 3: 0x564cc1e7885e - rt::unwind::begin_unwind_inner::hc90ee27246f12475C0w 4: 0x564cc1e35461 - rt::unwind::begin_unwind::h218749302018745608 5: 0x564cc1e36e1c - test_main::h6a499577710d847aI1a 6: 0x564cc1e3d6d2 - test_main_static::hb27df092379fd7dbd4a 7: 0x564cc1e3404c - test::main::hfd578a788dc6470cDee 8: 0x564cc1e84add - rust_try 9: 0x564cc1e86e7a - rt::lang_start::hefba4015e797c325hux 10: 0x564cc1e341cb - main 11: 0x7fe3178016ff - __libc_start_main 12: 0x564cc1dfb5f8 - _start 13: 0x0 -

behnam commented 7 years ago

This seams to be a bug cause by something outside of this library. I'm trying to repro it with what I think is was the source input (string index 2 and/or 3 in אב(גד[&ef].)gh do not lie on character boundary), but don't face a problem.

@vicky-katara, can you share more info about the cause, or do you think we can just close this at this point?

behnam commented 7 years ago

I cannot repro this. Must be fixed in one of the updates, or not existed on master in the first place.