Weird task switching bug
Weird task switching bug
When I load and change the cr3 register the stack pointer suddenly increases by 0x120. That eventually causes a memory spill and triple fault. Commenting the mov %r11, %cr3 makes it work fine but stack pointer goes to random places when I remove the comment. Any clues what causes this?
Re: Weird task switching bug
This bug has to do with the APIC timer, when setting the timer correct the bug was fixed
Re: Weird task switching bug
Can you elaborate on what you mean by "setting the timer right" ? Might be useful for others in the future.
Be kind.
Re: Weird task switching bug
Ah, my bad... So I was measuring time with TSC but it was giving unaligned values (for example 13241). Instead I aligned the time (for example 13000) and it works perfectly.
-
Octocontrabass
- Member

- Posts: 6249
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Weird task switching bug
How did that change fix the bug? It sounds an awful lot like the bug is still there and you've only made it less likely to occur.
