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 'index out of bounds: the len is 4978 but the index is 4978', src/densemap.rs:25:10 #44
Comments
Wow thanks for the extremely detailed bug report! Also rr is the coolest! I don't have my Linux computer handy at the moment so I can't reproduce, but from the panic and trace: I think this is crashing when generating an error message, and the error message is saying that a given output file is already being built by something else. Looking at your Ninja log there's similarly a warning about possibly the same issue. Maybe there's something in the build files you could diagnose here? (I will endeavor to fix the panic as well, of course) |
Possibly: one of these files like |
I tried commenting enough out of CMakeLists.txt to get it to generate something on this Mac, but I could not reproduce this problem. Could you paste your build.ninja file somewhere? |
This was closed by that PR but I am still interested in the answers to the above questions! |
Thanks a lot for reviewing so swiftly. I installed the most recent version of n2 and it now gives a similar warning to ninja, however it still fails to build (with a new error this time). I can create a new issue with the new error, if you want install most recent n2 (sadly n2 doesn't have a version cli flag to print this easily)~/Coding/rr $ n2 --version
n2: error: Unrecognized option: 'version' in the rr directory (checked out at the same commit), clean the build dir and tell cmake to generate build.ninja again.rm -rf build && mkdir build && cd build && cmake -G Ninja ../ && cd ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test SUPPORTS_CXX14
-- Performing Test SUPPORTS_CXX14 - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'capnp'
-- Found capnp, version 0.6.1
-- Checking for module 'zlib'
-- Found zlib, version 1.2.11
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.12", minimum required is "3")
You have called ADD_LIBRARY for library rrpage without any source files. This typically indicates a problem with your CMakeLists.txt file
You have called ADD_LIBRARY for library rrpreload without any source files. This typically indicates a problem with your CMakeLists.txt file
You have called ADD_LIBRARY for library rraudit without any source files. This typically indicates a problem with your CMakeLists.txt file
You have called ADD_LIBRARY for library rrpage_32 without any source files. This typically indicates a problem with your CMakeLists.txt file
You have called ADD_LIBRARY for library rrpreload_32 without any source files. This typically indicates a problem with your CMakeLists.txt file
You have called ADD_LIBRARY for library rraudit_32 without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Configuring done
-- Generating done
-- Build files have been written to: /home/petr_tik/Coding/rr/build Fail to build with n2 but this time with warnings and a new error~/Coding/rr $ RUST_BACKTRACE=full n2 -v -C build/
n2: warn: build.ninja:44074: "../src/preload/preload_interface.h" is repeated in output list
n2: warn: build.ninja:44074: "../src/preload/raw_syscall.S" is repeated in output list
n2: warn: build.ninja:44074: "../src/preload/rrcalls.h" is repeated in output list
thread 'main' panicked at 'expected no file state for ../src/preload/preload_interface.h', src/work.rs:575:17
stack backtrace:
0: 0x561288ee083a - std::backtrace_rs::backtrace::libunwind::trace::h91c465e73bf6c785
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x561288ee083a - std::backtrace_rs::backtrace::trace_unsynchronized::hae9da36f5d58b5f3
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x561288ee083a - std::sys_common::backtrace::_print_fmt::h7f499fa126a7effb
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys_common/backtrace.rs:67:5
3: 0x561288ee083a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3e2b509ce2ce6007
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys_common/backtrace.rs:46:22
4: 0x561288e8101c - core::fmt::write::h753c7571fa063ecb
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/fmt/mod.rs:1168:17
5: 0x561288eb6eef - std::io::Write::write_fmt::h2815c0519c99ba09
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/io/mod.rs:1660:15
6: 0x561288ee18d2 - std::sys_common::backtrace::_print::h64941a6fc8b0ed9b
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys_common/backtrace.rs:49:5
7: 0x561288ee18d2 - std::sys_common::backtrace::print::hcf25e43e1a9b0766
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys_common/backtrace.rs:36:9
8: 0x561288ee18d2 - std::panicking::default_hook::{{closure}}::h78d3e6cf97fc623d
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:211:50
9: 0x561288ee26be - std::panicking::default_hook::hda898f8d3ad1a5ae
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:228:9
10: 0x561288ee26be - std::panicking::rust_panic_with_hook::h1a5ea2d6c23051aa
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:606:17
11: 0x561288ee21a8 - std::panicking::begin_panic_handler::{{closure}}::h07f549390938b73f
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:502:13
12: 0x561288ee2126 - std::sys_common::backtrace::__rust_end_short_backtrace::h5ec3758a92cfb00d
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys_common/backtrace.rs:139:18
13: 0x561288ee20e2 - rust_begin_unwind
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
14: 0x561288e79380 - core::panicking::panic_fmt::h3a79a6a99affe1d5
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
15: 0x561288e9b606 - n2::work::Work::check_build_files_missing::hf6446c2d294e5e8f
16: 0x561288e9b606 - n2::work::Work::check_build_dirty::he52af68592e746be
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/work.rs:590:28
17: 0x561288e9b606 - n2::work::Work::run_without_cleanup::h19d1906faad45644
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/work.rs:671:21
18: 0x561288e953d5 - n2::work::Work::run::h249428d76b2080e1
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/work.rs:741:22
19: 0x561288e953d5 - n2::run::build::{{closure}}::h2daab0ddc1bd4e0c
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/run.rs:49:47
20: 0x561288e953d5 - n2::trace::scope::h2bf8a771a111bd3b
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/trace.rs:116:21
21: 0x561288e953d5 - n2::run::build::h6dc9ded841a12ecc
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/run.rs:49:19
22: 0x561288e91d71 - n2::run::run_impl::h0bb597f9f5680885
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/run.rs:209:22
23: 0x561288e7e3d0 - n2::run::run::hd21211266b0e6a0b
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/run.rs:234:15
24: 0x561288e7e3d0 - n2::main::h4c022cd59e4f0615
at /home/petr_tik/.cargo/git/checkouts/n2-e6f499fa596a8a82/df0a27b/src/main.rs:4:27
25: 0x561288e7e6f3 - core::ops::function::FnOnce::call_once::h25e67c454c9b4a24
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/ops/function.rs:227:5
26: 0x561288e7e6f3 - std::sys_common::backtrace::__rust_begin_short_backtrace::he1b68df33ad7ec41
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/sys_common/backtrace.rs:123:18
27: 0x561288e7ead9 - main
28: 0x7f30d8b8cc87 - __libc_start_main
at /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:310
29: 0x561288e7e2da - _start
30: 0x0 - <unknown> Start the build with ninja with same warnings!~/Coding/rr $ ninja -C build/
ninja: Entering directory `build/'
ninja: warning: multiple rules generate ../src/preload/preload_interface.h. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate ../src/preload/raw_syscall.S. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate ../src/preload/rrcalls.h. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
[1/2405] Linking C executable bin/shared_map_32
[2/2405] Linking C executable bin/strict_priorities_32
[3/2405] Linking C executable bin/segfault_32
ninja: build stopped: interrupted by user. |
Is there anything I can do to minimise this and then open a PR with the failing minimal test case? |
I think my test case reproduced the problem. I was more curious why CMake generated files like this. |
Hey, thanks for the awesome project.
A friend/coworker of mine contributed recently and I wanted to try n2 on a decent-sized cpp project -
https://github.com/rr-debugger/rr/
Here is my repro for the bug in the issue title
Install n2 from git
Change to the dir with rr
Cd (or git clone from git clone https://github.com/rr-debugger/rr.git) and follow the build instructions from
https://github.com/rr-debugger/rr/wiki/Building-And-Installing#project-building
Tell cmake to generate build.ninja in the build dir
Check build.ninja and try building with n2
Check the number of lines in the build.ninja file and start a build with n2 until you get an error
rerun n2 and get the full backtrace
Start a build with ninja to smoke test that the build.ninja is valid enough to start building
Hope this helps! Let me know if you need anything else.
The text was updated successfully, but these errors were encountered: