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

String-related panic when processing valid line of Markdown #58

Closed
ebkalderon opened this issue Mar 13, 2016 · 6 comments
Closed

String-related panic when processing valid line of Markdown #58

ebkalderon opened this issue Mar 13, 2016 · 6 comments
Labels
bug Not as expected

Comments

@ebkalderon
Copy link

Note: I posted this first on the johannhof/markdown.rs#13. Not sure whether the bug is in cobalt or in the Markdown library, so reposting here.

The error message reported by the panic, when looked up on Google, led me to this Rust book page on string slicing. Could you please look into this? This is a pretty major bug. Thanks!

Update: I'm using cobalt 0.2.0 with markdown 0.1.1 on rustc 1.9.0-nightly (eabfc160f) on 64-bit Arch Linux.

Output

[info]   Building from blog into web
[info]   Created web/index.html
[info]   Created web/_posts/week0.html
thread '<unnamed>' panicked at 'index 42 and/or 43 in `strictly read-only operations, so they don’t fit into either *views* or` do not lie on character boundary', ../src/libcore/str/mod.rs:1670
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Any', ../src/libcore/result.rs:746
[info]   Created web/_posts/week6.html

Backtrace

stack backtrace:
   1:     0x55b8389646c0 - sys::backtrace::tracing::imp::write::h3e252ef592ef6f37cHv
   2:     0x55b83896757b - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.44999
   3:     0x55b8389671e8 - panicking::default_handler::h5a98c984225a759d1nA
   4:     0x55b838958bbc - sys_common::unwind::begin_unwind_inner::ha2071187f9cf0076vvu
   5:     0x55b838959008 - sys_common::unwind::begin_unwind_fmt::h65e28ed738ec1ab9Buu
   6:     0x55b838963b31 - rust_begin_unwind
   7:     0x55b83899e48f - panicking::panic_fmt::h98dcb863ad76e04b7mM
   8:     0x55b8389a5584 - str::slice_error_fail::h98e1db52ab0be957SIT
   9:     0x55b83890bbed - parser::span::parse_spans::hd76b1aa268612ed8qja
  10:     0x55b838907404 - parser::block::parse_blocks::h40207e955dc8e399kza
  11:     0x55b838902e54 - to_html::h178a80c20d1918a2kcb
  12:     0x55b8388ac73a - F.FnBox::call_box::h9582497645605739343
  13:     0x55b8388ae384 - sys_common::unwind::try::try_fn::h11935924224408508601
  14:     0x55b838963abb - __rust_try
  15:     0x55b8389616fd - sys_common::unwind::inner_try::h4a24c2847e3d9a74xsu
  16:     0x55b8388ae52a - boxed::F.FnBox<A>::call_box::h9605662001311154786
  17:     0x55b8389660f9 - sys::thread::Thread::new::thread_start::h486bc7814d54d94ellz
  18:     0x7fc45768f423 - start_thread
  19:     0x7fc4571b8cbc - clone
  20:                0x0 - <unknown>
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Any', ../src/libcore/result.rs:746
stack backtrace:
   1:     0x55b8389646c0 - sys::backtrace::tracing::imp::write::h3e252ef592ef6f37cHv
   2:     0x55b83896757b - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.44999
   3:     0x55b8389671e8 - panicking::default_handler::h5a98c984225a759d1nA
   4:     0x55b838958bbc - sys_common::unwind::begin_unwind_inner::ha2071187f9cf0076vvu
   5:     0x55b838959008 - sys_common::unwind::begin_unwind_fmt::h65e28ed738ec1ab9Buu
   6:     0x55b838963b31 - rust_begin_unwind
   7:     0x55b83899e48f - panicking::panic_fmt::h98dcb863ad76e04b7mM
   8:     0x55b8388fd08a - result::unwrap_failed::h15670906751293521885
   9:     0x55b8388fce35 - scoped::JoinState::join::h13c7fea341a406c773a
  10:     0x55b8388ae938 - F.FnBox::call_box::h14351671975044799388
  11:     0x55b8388fd30b - scoped::Scope<'a>::drop_all::h06cdcd63e6265a66u5a
  12:     0x55b8388a3a82 - cobalt::build::he1a9e9c26970c869Uaa
  13:     0x55b838894e40 - main::h2e962ad0501d7c94Raa
  14:     0x55b838966e44 - sys_common::unwind::try::try_fn::h5354436054083437191
  15:     0x55b838963abb - __rust_try
  16:     0x55b8389668db - rt::lang_start::h673f33b817ea5ba77fA
  17:     0x7fc4570f170f - __libc_start_main
  18:     0x55b838891da8 - _start
  19:                0x0 - <unknown>
@johannhof
Copy link
Contributor

As mentioned before, markdown.rs has been a rather experimental project of mine and definitely has some stability/completeness issues.

We should just switch to pulldown-cmark if people are starting to have troubles because of it.

Thanks for looking into it!

@ebkalderon
Copy link
Author

@johannhof I'd like to migrate This Week in Amethyst away from WordPress over to cobalt, but so far it can't process all of the articles in Markdown. Whatever it takes to get it working, I'll support it!

@johannhof
Copy link
Contributor

Yeah I saw that, very nice! You should know that although I'd like to get to a stable release very soon, Cobalt and the Liquid template language (which is the even bigger effort) are still WIP and as you noticed there should be bugs all over the place.

My biggest problem right now is that our current file structure is neither consistent nor flexible (e.g. what's the point of _posts if we don't support Jekyll-like url customization) and I'm drafting up an idea of how it could work better.

With that said, I would obviously love more people to get their hands dirty with this and will support you in any way I can if you still want to got for it. I'll be on vacation until Wednesday though and will then look into all issues and PRs that have piled up. :)

@johannhof johannhof added the bug Not as expected label Mar 14, 2016
@LucioFranco
Copy link
Contributor

@johannhof would it be possible to have a way to use different markdown engines? While markdown.rs matures, we can use pulldown-cmark?

@johannhof
Copy link
Contributor

@LucioFranco

#58 (comment)

We should just switch to pulldown-cmark if people are starting to have troubles because of it.

😉

@tak1n
Copy link
Member

tak1n commented Mar 23, 2016

Fixed by #64

@tak1n tak1n closed this as completed Mar 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not as expected
Projects
None yet
Development

No branches or pull requests

4 participants