Closed pjox closed 5 years ago
This is the backtrace by the way (sorry I forgot to add it on my last message):
thread 'main' panicked at 'attempt to subtract with overflow', /Users/portizsu/.cargo/registry/src/github.com-1ecc6299db9ec823/bytelines-2.1.0/src/lib.rs:124:36
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/libunwind.rs:88
1: backtrace::backtrace::trace_unsynchronized
at /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:47
3: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:36
4: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:200
5: std::panicking::default_hook
at src/libstd/panicking.rs:214
6: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:477
7: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:384
8: rust_begin_unwind
at src/libstd/panicking.rs:311
9: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
10: core::panicking::panic
at src/libcore/panicking.rs:49
11: bytelines::ByteLines<B>::next
at /Users/portizsu/.cargo/registry/src/github.com-1ecc6299db9ec823/bytelines-2.1.0/src/lib.rs:124
12: runiq::main
at src/main.rs:67
13: std::rt::lang_start::{{closure}}
at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
14: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:49
15: std::panicking::try::do_call
at src/libstd/panicking.rs:296
16: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:80
17: std::panicking::try
at src/libstd/panicking.rs:275
18: std::panic::catch_unwind
at src/libstd/panic.rs:394
19: std::rt::lang_start_internal
at src/libstd/rt.rs:48
20: std::rt::lang_start
at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
21: runiq::main
Here is my system's info:
runiq on master [!?] is 📦 v1.1.3 via 🦀 v1.38.0
❯ rustc --version --verbose
rustc 1.38.0 (625451e37 2019-09-23)
binary: rustc
commit-hash: 625451e376bb2e5283fc4741caa0a3e8a2ca4d54
commit-date: 2019-09-23
host: x86_64-apple-darwin
release: 1.38.0
LLVM version: 9.0
Again, thanks in advance.
@pjox this is interesting, because the cargo install runiq
command only has one commit missing, which is just linting changes. Can you provide me a link to the exact file you're running this on? I know you pasted text above, but I want to make sure I get the correct encoding etc.
Thank you so much for the reply! (and sorry for the delay in answering!). The text file is plain text crawled from French websites and it should be in UTF-8. The panic occurs as soon as runiq encounters an empty newline between two paragraphs. I was also able to replicate the panic on a linux computer, so it is not specific to MacOS. Here is a link to the file: https://pjortiz.com/files/fr_test.txt
Hi @pjox!
I was able to reproduce this and it has been resolved in master; the Cargo.lock
in the repository was pinned on a bad version of a dependency which is why you only saw the issue when cloning. I have updated the dependencies as well to avoid any further issues.
Can you please try it and let me know? When I use your sample file, it appears to be fixed.
Hello @whitfin!
I can confirm the issue is fixed. Thank you so much!
Hello,
I downloaded runiq's code and compiled myself for mac, and I'm getting the following panic:
When running runiq on the following text:
The problem disappears if I remove the newlines. Also the problem is not present if I use runiq via
rust install runiq
.I want to download the code, because I want to introduce a simple modification to ignore empty lines, so that I can preserve new lines between paragraphs. Thus the vanilla version of
runiq
won't work for me.Thank you in advance for your help.