This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Restore compat. with mainnet-beta#12166
Closed
ryoqun wants to merge 2 commits intosolana-labs:masterfrom
Closed
Conversation
ryoqun
commented
Sep 10, 2020
| ($t:ty, $vm_addr:expr, $regions:expr) => {{ | ||
| if ($vm_addr as u64 as *mut $t).align_offset(align_of::<$t>()) != 0 { | ||
| if false && ($vm_addr as u64 as *mut $t).align_offset(align_of::<$t>()) != 0 { | ||
| Err(SyscallError::UnalignedPointer.into()) |
Contributor
Author
There was a problem hiding this comment.
@jackcmay It seems that some of mainnet-beta's programs executes Ok on v1.2, but fails with UnalignedPointer on master.
Contributor
Author
There was a problem hiding this comment.
bank] result: 673XSffuWqYJ6TQeSYZrWXjRZmQqqGxbreUP75jo7TtJ1tk58JiHRCuNCsrEMr8vH1qB19UxQdkgzzetVSUrJRfp => Ok(())
-bank] result: 8vNyVCumvrNzdHrbRNgQkpDG1syXELCxqF9SCd5ukexhr4RgENxbZAJkbeFvWdPoEK9RzFDLJrVyf8QPN2pkroj => Ok(())
+bank] result: 8vNyVCumvrNzdHrbRNgQkpDG1syXELCxqF9SCd5ukexhr4RgENxbZAJkbeFvWdPoEK9RzFDLJrVyf8QPN2pkroj => Err(InstructionError(1, Custom(194969602)))
bank] result: 97Teou5Ef3TZ2PiPm11ftvFqfgWpynhuMEGcCxmmHbf7wXGFbY9qdgdZUm6LpXAAL9gD8W6c1wbGXYcD6CrpBvL => Ok(())
$ printf "%016x\n" 194969602
000000000b9f0002
$ git grep -C1 b9f_0002
programs/bpf/rust/invoke/src/lib.rs- invoke(&invoked_instruction, accounts),
programs/bpf/rust/invoke/src/lib.rs: Err(ProgramError::Custom(0x0b9f_0002))
programs/bpf/rust/invoke/src/lib.rs- );
--
programs/bpf/rust/invoke/src/lib.rs- invoke(&invoked_instruction, accounts),
programs/bpf/rust/invoke/src/lib.rs: Err(ProgramError::Custom(0x0b9f_0002))
programs/bpf/rust/invoke/src/lib.rs- );
--
programs/bpf_loader/src/lib.rs- #[error("virtual machine failed to run the program to completion")]
programs/bpf_loader/src/lib.rs: VirtualMachineFailedToRunProgram = 0x0b9f_0002,
programs/bpf_loader/src/lib.rs-}
[2020-09-10T07:29:17.868465223Z INFO solana_runtime::message_processor] BPF program 4ckmDgGdxQoPDLUkDT3vHgSAkzA3QRdNq5ywwY4sUSJn failed: Unaligned pointer
Contributor
|
Hmm, we want to enforce aligned pointers, probably need to gate this with the new loader |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After long bisecting, I've finally tracked down what causing master to be incompatibile with mainnet-beta (v1.2).
Summary of Changes
After spotting this, I couldn't fix this easily. So, I'm just sharing what I found...
Obviously, this is rather work-around, needs proper fix.. But, this restores compatibility at least...
Fixes #