-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Restore compat. with mainnet-beta #12166
Conversation
@@ -169,7 +169,7 @@ macro_rules! translate { | |||
#[macro_export] | |||
macro_rules! translate_type_mut { | |||
($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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackcmay It seems that some of mainnet-beta's programs executes Ok
on v1.2, but fails with UnalignedPointer
on master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Hmm, we want to enforce aligned pointers, probably need to gate this with the new loader |
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 #