We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I encounter a crash on a x86_64 machine. It looks like the rdx register is dereferenced while being invalid:
rdx
Program received signal SIGSEGV, Segmentation fault 0x000055555558aa2c in _ () (gdb) x/6i $pc-20 0x55555558aa18 <_+56>: rdtsc 0x55555558aa1a <_+58>: shl rdx,0x20 0x55555558aa1e <_+62>: or rax,rdx 0x55555558aa21 <_+65>: mov QWORD PTR [rcx],0x1 0x55555558aa28 <_+72>: mov QWORD PTR [rcx+0x8],rax => 0x55555558aa2c <_+76>: movzx eax,BYTE PTR [rdx+0x14] (gdb) i r $rdx rdx 0x227bd00000000 606642655723520
I guess the reason is rdx is not marked as an out register in start() and stop() functions, and the compiler assumes it isn't modified.
start()
stop()
Suggested fix (untested): add out("rdx") _ to the asm! macros if you don't want to rely on core::arch::x86_64::_rdtsc.
out("rdx") _
asm!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I encounter a crash on a x86_64 machine. It looks like the
rdx
register is dereferenced while being invalid:I guess the reason is
rdx
is not marked as an out register instart()
andstop()
functions, and the compiler assumes it isn't modified.Suggested fix (untested): add
out("rdx") _
to theasm!
macros if you don't want to rely on core::arch::x86_64::_rdtsc.The text was updated successfully, but these errors were encountered: