Skip to content

Instantly share code, notes, and snippets.

@jberkel
Created December 14, 2019 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jberkel/edec30d87df49c62b260bf8f086377e6 to your computer and use it in GitHub Desktop.
Save jberkel/edec30d87df49c62b260bf8f086377e6 to your computer and use it in GitHub Desktop.
[:/Volumes/tbaplus/projects/enwikt-dump-rs] 86dfd01* ± rust-lldb ./target/debug/wiktionary_dump2 -- dump_parsed_templates --input enwiktionary-20191201-pages-articles-multistream.xml --format cbor --templates templates --namespaces template
error: module importing failed: Missing parentheses in call to 'print'. Did you mean print('Whoops! You are missing the <' + arg.argName + '> argument.')? (fblldb.py, line 98)
File "temp.py", line 1, in <module>
(lldb) command script import "/usr/local/Cellar/rust/1.39.0/lib/rustlib/etc/lldb_rust_formatters.py"
(lldb) type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
(lldb) type category enable Rust
(lldb) target create "./target/debug/wiktionary_dump2"
Current executable set to './target/debug/wiktionary_dump2' (x86_64).
(lldb) settings set -- target.run-args "dump_parsed_templates" "--input" "enwiktionary-20191201-pages-articles-multistream.xml" "--format" "cbor" "--templates" "templates" "--namespaces" "template"
(lldb) b rust_panic
Breakpoint 1: where = wiktionary_dump2`rust_panic, address = 0x0000000100b8deb0
(lldb) r
Process 5146 launched: '/Volumes/tbaplus/projects/enwikt-dump-rs/target/debug/wiktionary_dump2' (x86_64)
thread 'main' panicked at 'index 458 out of range for slice of length 256', src/libcore/slice/mod.rs:2585:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
Process 5146 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100b8deb0 wiktionary_dump2`rust_panic
wiktionary_dump2`rust_panic:
-> 0x100b8deb0 <+0>: pushq %rbp
0x100b8deb1 <+1>: movq %rsp, %rbp
0x100b8deb4 <+4>: subq $0x60, %rsp
0x100b8deb8 <+8>: movq %rdi, -0x18(%rbp)
Target 0: (wiktionary_dump2) stopped.
(lldb) bt
Traceback (most recent call last):
File "/usr/local/Cellar/rust/1.39.0/lib/rustlib/etc/lldb_rust_formatters.py", line 89, in print_val
is_tuple_like = False)
File "/usr/local/Cellar/rust/1.39.0/lib/rustlib/etc/lldb_rust_formatters.py", line 210, in print_struct_val
body = separator.join([render_child(idx) for idx in range(field_start_index, len(fields))])
File "/usr/local/Cellar/rust/1.39.0/lib/rustlib/etc/lldb_rust_formatters.py", line 210, in <listcomp>
body = separator.join([render_child(idx) for idx in range(field_start_index, len(fields))])
File "/usr/local/Cellar/rust/1.39.0/lib/rustlib/etc/lldb_rust_formatters.py", line 203, in render_child
return this + print_val(field_val.get_wrapped_value(), internal_dict)
TypeError: can only concatenate str (not "NoneType") to str
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
* frame #0: 0x0000000100b8deb0 wiktionary_dump2`rust_panic
frame #1: 0x0000000100b8dde3 wiktionary_dump2`std::panicking::rust_panic_with_hook::h1cc1b91b6800db27 + 627
frame #2: 0x0000000100b8d84d wiktionary_dump2`std::panicking::continue_panic_fmt::h851031a5cf31ba4c + 157
frame #3: 0x0000000100b8d7a9 wiktionary_dump2`rust_begin_unwind + 9
frame #4: 0x0000000100bbd2ff wiktionary_dump2`core::panicking::panic_fmt::hf9d97a028b885d64 + 63
frame #5: 0x0000000100bbd7aa wiktionary_dump2`core::slice::slice_index_len_fail::ha48c10339f46fc25 + 106
frame #6: 0x00000001003090df wiktionary_dump2`_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$::index_mut::h676e8263c1460655(self=Range<unsigned long> {
start: 0,
end: 458
}, slice=&['\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0']) at mod.rs:2780:12
frame #7: 0x000000010030557d wiktionary_dump2`core::slice::_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$::index_mut::hd8180068eda60278(self=&['\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'], index=Range<unsigned long> {
start: 0,
end: 458
}) at mod.rs:2578:8
frame #8: 0x00000001000eda50 wiktionary_dump2`template_dumper::normalize_template_name::h2935e69efb045f75(name="ucfirst:<!--
-->{{{pr|}}}{{{case|}}} <!--
-->{{{pl|}}} <!--
-->{{{mood|}}} {{{tense|}}} <!--
-->{{#ifeq:{{{2|}}}|-||form of}} <!--
-->{{m|fi|{{{1}}}}}<!--
-->{{#if:{{{suffix|}}}<!--
-->|<!--
--><nowiki/> + the suffix {{m|fi|{{{suffix}}}}}<!--
-->{{#if:{{{suffix2|}}}|<nowiki/> + {{m|fi|{{{suffix2}}}}}}}<!--
-->{{#if:{{{suffix3|}}}|<nowiki/> + {{m|fi|{{{suffix3}}}}}}}<!--
-->}}<!--
-->{{#ifeq:{{{nodot|}}}|1||.}}<!--
-->", name_buffer=&['\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0']) at lib.rs:228:35
frame #9: 0x0000000100040bf6 wiktionary_dump2`wiktionary_dump2::dump_parsed_templates::_$u7b$$u7b$closure$u7d$$u7d$::he27748b8bf01a676(template=TemplateBorrowed @ 0x00007ffeefbfc6b8, template_node=&0x103002120) at main.rs:179:32
frame #10: 0x0000000100063eb6 wiktionary_dump2`template_iter::TemplateVisitor::visit::h1748c5d79211b027(self=&0x7ffeefbfd408, nodes=&0x7ffeefbfd3c0, func=&0x7ffeefbfd418) at lib.rs:144:20
frame #11: 0x00000001000288a2 wiktionary_dump2`wiktionary_dump2::dump_parsed_templates::hac6f91720d002bb3(opts=<unavailable>, main_start=Instant(Instant {
t: 4732424855424
}), verbose=false, format=CBOR) at main.rs:177:8
frame #12: 0x0000000100029855 wiktionary_dump2`wiktionary_dump2::main::h50ad235fbfc6cf1b at main.rs:238:12
frame #13: 0x000000010005cdc2 wiktionary_dump2`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h8096578952f7ef0c at rt.rs:64:33
frame #14: 0x0000000100b8d738 wiktionary_dump2`std::panicking::try::do_call::h3aa3549642d783df (.llvm.10335054858058840487) + 24
frame #15: 0x0000000100b9c50f wiktionary_dump2`__rust_maybe_catch_panic + 31
frame #16: 0x0000000100b92703 wiktionary_dump2`std::rt::lang_start_internal::h6a69b9e068efe0c5 + 179
frame #17: 0x000000010005cda2 wiktionary_dump2`std::rt::lang_start::h87daf2cfc73a7904(main=&0x100029220, argc=10, argv=&0x7ffeefbfef80) at rt.rs:64:4
frame #18: 0x000000010002b502 wiktionary_dump2`main + 34
frame #19: 0x00007fff655182e5 libdyld.dylib`start + 1
(lldb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment