Skip to content

Post-CPI data access causes program exit code 0xf00000000 #42

Description

@andyjsbell

Summary

After fixing the CallerAccount corruption issue in #38, the test_account_data test now successfully completes the CPI operation but fails with exit code 0xf00000000 instead of the expected 0x0.

Current Status

✅ Fixed Issues:

  • CallerAccount lamports corruption resolved
  • CPI account validation working correctly
  • System program CPI succeeds ("Account created successfully")
  • Account creation and fund transfer complete successfully

❌ New Issue:
Program exits with 0xf00000000 instead of 0x0, causing test to fail

Root Cause Analysis

The account_data_program flow:

  1. ✅ CPI Step: Creates account via system program - SUCCEEDS
  2. ❌ Data Write Step: Serializes AddressInfo to new account - FAILS

The issue occurs in create.rs line 42:

address_info.serialize(&mut &mut address_info_account.data.borrow_mut()[..])?;

Technical Details

Exit Code: 0xf00000000 (suspiciously large, possibly memory address)

Log Evidence:

vm: Account created successfully
vm: System program instruction executed successfully  
vm: sol_invoke_signed_rust: CPI succeeded
vm: VM execution succeeded, program exit code: 0xf00000000

The program completes all CPI operations successfully but fails when trying to write data to the newly created account's data buffer.

Hypothesis

Post-CPI, the AccountInfo.data field (Rc<RefCell<&mut [u8]>>) is not properly synchronized with the VM's updated account state. The program can't access the account's data buffer after the CPI operation.

Impact

  • CPI functionality works correctly
  • Account creation via system program works
  • Data persistence after CPI fails
  • Programs that only do CPI without data writes would work fine
  • Programs that need to write data after CPI fail

Acceptance Criteria

  • test_account_data passes with exit code 0x0
  • Account data is properly accessible after CPI operations
  • AddressInfo serialization completes successfully
  • No regression in CPI functionality

Related

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions