paritytech / polkadot

Polkadot Node Implementation
GNU General Public License v3.0
7.12k stars 1.58k forks source link

regalloc.rs errors on startup for polkadot release-v0.9.2 #3100

Open nepoche opened 3 years ago

nepoche commented 3 years ago

While trying to start a polkadot node off branch release-v0.9.2, with the command: ./target/release/polkadot --chain rococo-local.json -d /tmp/relay/alice --alice --validator --port 50555, I hit the following errors on startup.


2021-05-25 10:11:47  with options: checker: false, algorithm: backtracking (block annotations: false)
2021-05-25 10:11:47  using RealRegUniverse:
2021-05-25 10:11:47    class I32(J) at [32 .. 56]: x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x19* x20 x22 x23 x24 x25 x26 x27 x28
2021-05-25 10:11:47    class V128(V) at [0 .. 31]: v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28 v29 v30 v31*
2021-05-25 10:11:47    not allocable at [58 .. 64]: x16 x17 x18 fp lr xzr sp
2021-05-25 10:11:47  run_analysis: begin
2021-05-25 10:11:47    run_analysis: 1 blocks, 14 insns
2021-05-25 10:11:47    run_analysis: begin control flow analysis
2021-05-25 10:11:47      CFGInfo::create: begin
2021-05-25 10:11:47        calc_preds_and_succs: begin
2021-05-25 10:11:47        calc_preds_and_succs: end
2021-05-25 10:11:47        calc_preord_and_postord: begin
2021-05-25 10:11:47        calc_preord_and_postord: end.  1 blocks
2021-05-25 10:11:47        calc_loop_depths: begin
2021-05-25 10:11:47          calc_dom_tree: begin
2021-05-25 10:11:47          calc_dom_tree: end
2021-05-25 10:11:47        calc_loop_depths: end
2021-05-25 10:11:47      CFGInfo::create: end
2021-05-25 10:11:47    run_analysis: end control flow analysis
2021-05-25 10:11:47    run_analysis: begin data flow analysis
2021-05-25 10:11:47      calc_def_and_use: begin
2021-05-25 10:11:47      calc_def_and_use: end
2021-05-25 10:11:47      calc_livein_and_liveout: begin
2021-05-25 10:11:47      calc_livein_and_liveout:   1 blocks, 1 evals (1.00 per block)
2021-05-25 10:11:47      calc_livein_and_liveout: end
2021-05-25 10:11:47    run_analysis: end data flow analysis
2021-05-25 10:11:47    run_analysis: begin liveness analysis
2021-05-25 10:11:47      get_range_frags: begin
2021-05-25 10:11:47      get_range_frags: end
2021-05-25 10:11:47      merge_range_frags: begin
2021-05-25 10:11:47        in: 18 in frag_env
2021-05-25 10:11:47        in: 55 regs containing in total 64 frags
2021-05-25 10:11:47        in: 50 single groups
2021-05-25 10:11:47        in: 10 local frags in multi groups
2021-05-25 10:11:47        in: 5 small multi groups, 4 small multi group total size
2021-05-25 10:11:47        in: 0 large multi groups, 0 large multi group total size
2021-05-25 10:11:47        out: 7 VLRs, 57 RLRs
2021-05-25 10:11:47        compress vfrags: in 7, out 7
2021-05-25 10:11:47      merge_range_frags: end
2021-05-25 10:11:47    run_analysis: end liveness analysis
2021-05-25 10:11:47  run_analysis: end
2021-05-25 10:11:47
2021-05-25 10:11:47  do_coalescing_analysis: begin
2021-05-25 10:11:47  do_coalescing_analysis: end
2021-05-25 10:11:47
2021-05-25 10:11:47  alloc_main: begin
2021-05-25 10:11:47  alloc_main:   in: 14 insns in 1 blocks
2021-05-25 10:11:47  alloc_main:   in: 7 VLRs, 57 RLRs
2021-05-25 10:11:47  alloc_main:   main allocation loop: begin
2021-05-25 10:11:47  alloc_main:   main allocation loop: end
2021-05-25 10:11:47  alloc_main:   create spills_n_reloads for MOVE insns
2021-05-25 10:11:47  alloc_main:   create spills_n_reloads for other insns
2021-05-25 10:11:47  alloc_main:   create frag_map
2021-05-25 10:11:47  alloc_main:   edit_inst_stream
2021-05-25 10:11:47  alloc_main:   out: VLRs: 7 initially, 8 processed
2021-05-25 10:11:47  alloc_main:   out: VLRs: 1 evicted, 0 spilled
2021-05-25 10:11:47  alloc_main:   out: insns: 14 total, 0 spills, 0 reloads, 0 nopzs
2021-05-25 10:11:47  alloc_main:   out: spill slots: 0 used
2021-05-25 10:11:47  alloc_main:   creating RegAllocResult
2021-05-25 10:11:47  alloc_main: end
2021-05-25 10:11:47  ================ regalloc.rs: END function ================```
bkchr commented 3 years ago

How did you build the binary?

nepoche commented 3 years ago

I needed to upgrade librocksdb-sys to 6.17.3 for m1 compatibility, so I issue an cargo update -p librocksdb-sys before a cargo build --release. This causes my cargo.lock file to change in the following ways:

[[package]]
name = "bindgen"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d"
dependencies = [
 "bitflags",
 "cexpr",
 "clang-sys",
 "lazy_static",
 "lazycell",
 "peeking_take_while",
 "proc-macro2",
 "quote",
 "regex",
 "rustc-hash",
 "shlex",
]
[[package]]
name = "clang-sys"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c"
dependencies = [
 "glob",
 "libc",
 "libloading 0.7.0",
]
[[package]]
name = "fs-swap"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5"
dependencies = [
 "lazy_static",
 "libc",
 "libloading 0.5.2",
 "winapi 0.3.9",
]
[[package]]
name = "libloading"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a"
dependencies = [
 "cfg-if 1.0.0",
 "winapi 0.3.9",
]
[[package]]
name = "librocksdb-sys"
version = "6.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5da125e1c0f22c7cae785982115523a0738728498547f415c9054cb17c7e89f9"
dependencies = [
 "bindgen",
 "cc",
 "glob",
 "libc",
]
[[package]]
name = "prost-build"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3"
dependencies = [
 "bytes 1.0.1",
 "heck",
 "itertools 0.9.0",
 "log",
 "multimap",
 "petgraph",
 "prost",
 "prost-types",
 "tempfile",
 "which",
]

removed:

[[package]]
name = "which"
version = "3.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724"
dependencies = [
 "libc",
]
bkchr commented 3 years ago

What is printed are no errors.

This is something related to wasmtime.

nepoche commented 3 years ago

Thanks for the insight. The relay node appear to be operating properly after spitting out those logs; however, I also see the same logs after a parachain node is registered roughly every 5 blocks. (The logs do not appear if only two relay nodes are running). Do you know how I can further assist with the issue / gather any other logs which may be helpful?

bkchr commented 3 years ago

@pepyakin any idea why wasmtime is printing this?

pepyakin commented 3 years ago

This is a good question! Seems like regalloc.rs just spews out info!. regalloc.rs is used by default in the new backend and that is required for aarch64 / m1.

Now, the problem is, we may get this logging if we land https://github.com/paritytech/substrate/pull/8913

bkchr commented 3 years ago

Seems like regalloc.rs just spews out info!

Yeah I had seen this. I was wondering why we don't see it currently, but you explained it now :D

pepyakin commented 3 years ago

Can confirm we see this.