Skip to content

SBPF UnsupportedInstruction Error (0xf00000000) in Account Data Test #43

Description

@andyjsbell

SBPF UnsupportedInstruction Error in Account Data Test

Problem

The test_account_data test fails with exit code 0xf00000000 which corresponds to SBPF UnsupportedInstruction error. This occurs even though all CPI (Cross-Program Invocation) and AccountInfo synchronization functionality is working correctly.

Current Status

✅ SOLVED: Post-CPI data access functionality is fully working
❌ REMAINING: SBPF version compatibility issue

Evidence of Working CPI Implementation

The logs show all core functionality works perfectly:

  • sol_invoke_signed_rust: CPI succeeded
  • Account created successfully
  • ✅ AccountInfo RefCell update complete: data=0x4000028c0, len=48
  • Real-time sync: Account Pubkey([...]) has 48 bytes of data after CPI

Error Details

  • Exit Code: 0xf00000000
  • Decoded: Discriminant 1 (error) + Error ordinal 15 (0xf) = UnsupportedInstruction
  • Timing: Error occurs at the very end of program execution, after all CPI logic completes
  • SBPF Version: VM detects programs as V0, but may contain newer instructions

Investigation Done

  1. ✅ Enabled SBPF V0-V3 in VM configuration
  2. ✅ Tested with solana-program 1.18 (older version)
  3. ✅ Tested with solana-program 2.2 (newer version)
  4. ✅ Verified CPI implementation is correct
  5. ❌ Still encountering UnsupportedInstruction error

Reproduction

RUST_LOG=debug cargo test test_account_data --lib

Expected Behavior

Test should pass with exit code 0 once SBPF compatibility issue is resolved.

Technical Context

  • VM Configuration: Supports SBPF V0-V3 (enabled_sbpf_versions: V0..=V3)
  • Program Detection: ELF always detected as SBPF V0 regardless of solana-program version
  • Error Location: vm/src/vm.rs handle_error function maps UnsupportedInstruction to 0x1010, but we're seeing 0xf00000000

Impact

  • Core CPI functionality is working correctly
  • Tests fail due to infrastructure/compatibility issue
  • Does not affect the primary goal of post-CPI data access

Next Steps

  1. Investigate why programs compiled with different solana-program versions still trigger UnsupportedInstruction
  2. Determine if SBPF version detection/override logic needs refinement
  3. Potentially examine specific instruction bytes causing the unsupported instruction error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions