Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes intermittently on some instructions parsed (encoding=jsonParsed) #98

Open
EugeneButusov opened this issue May 13, 2024 · 3 comments
Assignees

Comments

@EugeneButusov
Copy link

Problem

When doing a call of getBlock with encoding set to jsonParsed for, for example, block 258768009, application crashes with the following trace:

thread '<unnamed>' panicked at src/lib.rs:62:60:
called `Result::unwrap()` on an `Err` value: short buffer: required 32 bytes, but only 4 bytes available
stack backtrace:
   0: rust_begin_unwind
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/result.rs:1649:5
   3: parse_instruction
   4: _cgo_3af86e38bd62_Cfunc_parse_instruction
             at /tmp/go-build/cgo-gcc-prolog:67:11
   5: runtime.asmcgocall
             at /usr/local/go/src/runtime/asm_amd64.s:918
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
SIGABRT: abort
PC=0x78acfb6969fc m=20 sigcode=18446744073709551610
signal arrived during cgo execution

After adding some more extra logs, it seems it crashes when trying to decode ExtendLookupTable instruction.

Due to the extended logs, we can get for the instruction which fails the following confusing line:

[rust] static_account_keys_len: 196

however, it has only four accounts required for this operation. Here is unparsed instruction:

{
  "accounts":[
    1,
    0,
    0,
    2
  ],
 
 "data":"3HZrKkPNSUj99xoS7QLmCjhA5iMdWYdSVXLeXZc9AH19faRmpeNrwWiYSKw4e27YTnmZmw7r9bJNv3cg9tWvCc9vvEDnt4LpVpqc9n6sw5VW6GGaDxs6FNfqAJc5kjwKxSTAAj7PKyygtxfoKgwWw2CWrjbNbC1s9ZvFRBhSVpx2iHD1CoErDJ4XBb61AWn4fxkUJm4TnXEAQLScF23GKVWn7TBwChqN6PamXHQy7MYy46bLXqFpbTA3YDJJaJvYkKfL1VujLp5MhrP1kkik2h6XfEfRsbnpottL5uj5A8bE8W6aQ5NgLu5p5J1uxTuE5wJTHG7xBHCNXqGn9qRwwKvHE46sodEzkuEgCGj5WC3ZoMxT69dojjdqm3VUso9tqy1y15GHcnEh8q7QXkDY5NXDrA3dwtW4EqbYLbbXbLcPBQZAV5UpXG8gyzfN5hzMD46YW",
  "programIdIndex":3,
  "stackHeight":null
}

The transaction signature from that block is 61KrK26PQohM8Qt1GR6WBRUXkLoWvFhUSnm3Q14EEMMHPsAo4iTrkx8EwZt2y7tQXVsgHyMmjzJiMncTjfE85LMa.

This is not the only case, sometimes it crashes on another blocks, this is only as an example. Possibly, for some instructions layout is read not correctly.

@gagliardetto
Copy link
Collaborator

hi @EugeneButusov

thanks for the bug report! I'll take a look

@gagliardetto gagliardetto self-assigned this May 14, 2024
@gagliardetto
Copy link
Collaborator

There was an issue with length encoding when going between golang and rust.

Will be fixed in the next release.

@anjor
Copy link
Contributor

anjor commented Dec 12, 2024

@gagliardetto can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants