Scheduler randomly crashes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Scheduler randomly crashes

Post by nexos »

Hello,
In my operating system, the scheduler will crash randomly sometimes, leading to a triple fault or page fault. It happens mainly on multiple CPUs, or after a couple of hours. Does anybody have suggestions on what the problem is and how to debug these crashes?
Thanks,
nexos
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: Scheduler randomly crashes

Post by Octacone »

Your stack is probably getting corrupted. What tasks are you running exactly? Do you just run your OS and leave it be, then after an hour it crashes?
Also if I were you I'd ditch all the GOTOs, they make your code look ugly and they are a nightmare to debug.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Scheduler randomly crashes

Post by nexos »

I found a problem, and now it runs perfectly well on 1, 2, or 3 CPUs, but more then that and problem happen. The reason the GOTO is there is because it was the best solution to fix a bug in the idle thread calling code. I will probably remove it sooner or later.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Post Reply