Skip to content

Bug: 0.9.0-rc1 causes rust-bitcoin to panic when logging a non-standard script on 32-bit platforms #490

@dematerializer

Description

@dematerializer

Describe the bug
After upgrading to 0.9.0-rc1, reindexing is giving the following error message:

Sep 18 22:41:15 raspberrypi electrs[12714]: thread '<unnamed>' panicked at 'slice index starts at 5 but ends at 4', /home/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bitcoin-0.27.0/src/blockdata/script.rs:531:32
Sep 18 22:41:15 raspberrypi electrs[12714]: [2021-09-18T20:41:15.780Z INFO  electrs::db] closing DB at /mnt/ext/electrs/db/bitcoin
Sep 18 22:41:15 raspberrypi systemd[1]: electrs.service: Main process exited, code=exited, status=101/n/a
Sep 18 22:41:15 raspberrypi systemd[1]: electrs.service: Failed with result 'exit-code'.

Electrs version
0.9.0-rc1

To Reproduce
Steps to reproduce the behavior:

  1. Manually upgrade electrs to latest version (using latest git tag, manually build with cargo build --locked --release and cp binary to destination
  2. sudo systemctl restart electrs
  3. Wait
  4. See error with sudo journalctl -f -u electrs

Expected behavior
Reindexing is supposed to run through.

Configuration
electrs.conf

# Bitcoin Core settings
network = "bitcoin"
daemon_dir= "/mnt/ext/bitcoin"
cookie_file = "/mnt/ext/bitcoin/.cookie"
daemon_rpc_addr = "127.0.0.1:8332"
daemon_p2p_addr = "127.0.0.1:8333"

# Electrs settings
electrum_rpc_addr = "127.0.0.1:50001"
db_dir = "/mnt/ext/electrs/db"
txid_limit = 1000

# Logging
verbose = 4
timestamp = true
rust_backtrace = 1

bitcoin.conf

# Bitcoin daemon
server=1
txindex=1
disablewallet=1
sysperms=1

# Network
listen=1
listenonion=1
proxy=127.0.0.1:9050
bind=127.0.0.1
whitelist=download@127.0.0.1

# Connections
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

# Raspberry Pi optimizations
maxconnections=40
maxuploadtarget=5000

System running electrs

Electrum client
not applicable

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions