Open VocalFan opened 1 month ago
This will be a joy to debug :skull:
And I can't help but feel like Ultima removed the log file being in appdata...
This will be a joy to debug 💀
(bac.3048): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
WinHvPlatform!WHvApi::Hypercall::SetVpRegisters+0x1df:
00007ffc`12d976d7 410f280402 movaps xmm0,xmmword ptr [r10+rax] ds:0000007d`18affb38=0000000000000000ffffffff8240c000
Can you identify which line that cause this error?
@ultimaweapon GOTCHA
fn states(&mut self) -> Result<Self::States<'_>, Self::GetStatesErr> {
let mut values: [WHV_REGISTER_VALUE; REGISTERS] = unsafe { zeroed() };
let status = unsafe {
WHvGetVirtualProcessorRegisters(
self.part,
self.index,
WhpStates::NAMES.as_ptr(),
REGISTERS as _,
values.as_mut_ptr(),
)
};
Here;
WHvGetVirtualProcessorRegisters(
I have no idea what causing segmentation fault here. We probably need someone with Windows to fix this.
Deduction here:
self.part, unless cloned, println!'d, or otherwise affected before being used by WHvGetVirtualProcessorRegisters... Will be free'd before WHvGetVirtualProcessorRegisters can use it, causing a Memory Access Violation.
That makes no sense I think
That makes no sense I think
It's what happens, however... The value is getting dropped for SOME reason unless I use something to make it active in the function before WHvGetVirtualProcessorRegisters uses it...
But that doesn't make sense. You can't 'drop' an int.
But that doesn't make sense. You can't 'drop' an int.
And I find it weird that if I do self.part = self.part.clone()
, it works.
That why we need to figure out why it is crashing because your fix does not make sense.
That why we need to figure out why it is crashing because your fix does not make sense.
Welllll, have fun with Miri https://github.com/rust-lang/miri
@VocalFan you can set a breakpoint on that line and view its assembly once the breakpoint are hit to see how it calls the function?
@VocalFan you can set a breakpoint on that line and view its assembly once the breakpoint are hit to see how it calls the function?
{part:2517404947584, index:0}
This is for self.part and self.index
Error point.
rip: 0x00007FF76F742C27
rsp: 0x000000FED0DFD690
eax: 0xD0DFD470
No idea what wrong here since everything looks okay.
No idea what wrong here since everything looks okay.
Maybe a bug with windows-sys?
Everything here looks correctly so no. Seems like I need to set up a Windows machine to figure out.
Gonna see if this magically got fixed
I mean, it's new.
.next_multiple_of(Ram::VM_PAGE_SIZE)
a very temporary thing of this on p_vaddr, and guess what came back?
Stop reason: Exception 0xc0000005 encountered at address 0x7ffc2bef39c6: Access violation reading location 0xffffffffffffffff
But I think that might be a hint, the unaligned address.
Faulting application name: Obliteration.exe, version: 0.0.1.0, time stamp: 0x66aa766c Faulting module name: WinHvPlatform.dll, version: 10.0.22621.3672, time stamp: 0xb628bb33 Exception code: 0xc0000005 Fault offset: 0x00000000000076d7 Faulting application path: C:\Users\ghost\Downloads\obliteration-win-x64\Obliteration.exe Faulting module path: C:\WINDOWS\SYSTEM32\WinHvPlatform.dll