Skip to content

ICE: polkavm-linker panics on debug info for a call-heavy function #574

Description

@jubnzv

MRE:

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.29;
interface I { function f(uint256) external; }
contract C {
  function run(I t, uint256 acc) external {
    t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc);
    t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc);
    t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc);
    t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc); t.f(acc);
  }
}

The panic is in the polkavm-linker sanity check gated on cfg!(debug_assertions), so it requires a debug build of resolc (its own test suite is one — the integration harness compiles with debug info at every opt level except -Oz):

$ resolc -g -O3 --bin ice.sol      # debug-built resolc
thread 'main' panicked at polkavm-linker-0.35.0/src/program_from_elf.rs:11099:62:
called `Result::unwrap()` on an `Err` value:
    ProgramParseError(Other("found a line program with too many instructions"))

Git commit: 066c6d2; LLVM 22.1.5

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions