I have this weird bug/issue/thing thats really annoying me.
When I add something to my task structure (the struct for a process {eip, pid, etc}), many times forking will not work, as in I have it fork a new process and it triple faults.
Is this a common problem, something that my tired brain is overlooking or am I just being slow?
And...of course...is there a way to fix it?
(Any more info you need, I'll provide)
-JL
Forking causes triple fault occasionally
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Forking causes triple fault occasionally
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: Forking causes triple fault occasionally
You say "occasionally," does this mean that one time you will run the kernel and it will triple fault but you run it again without any changes and it works fine? Usually that is a sign that there is a race condition somewhere.
Also, where exactly does it fault? Is it actually in fork() or is it in something like switch_task() that runs after fork()?
Also, where exactly does it fault? Is it actually in fork() or is it in something like switch_task() that runs after fork()?
~[Fluidium]~
Re: Forking causes triple fault occasionally
First thing I'd check is your Makefile dependencies - when you change the process header, does all the process code actually get rebuilt? If not, try a make clean.
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: Forking causes triple fault occasionally
I do a make clean...every time I update a header. The problem persists.
The triple fault occurs every time I run it with the added thing. When I remove it, it runs fine.
By occasionally, I mean some new additions are fine, some make it angry. I'll spend like, an hour debugging it and I don't find anything, so I remove all the debugging stuff and sometimes it works fine, and sometimes it doesn't.
-JL
The triple fault occurs every time I run it with the added thing. When I remove it, it runs fine.
By occasionally, I mean some new additions are fine, some make it angry. I'll spend like, an hour debugging it and I don't find anything, so I remove all the debugging stuff and sometimes it works fine, and sometimes it doesn't.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: Forking causes triple fault occasionally
piranha, give us an example of one or two of the bugs that came up. Besides, stuff like this happens (alot). Its probably the result of a weird linker(or compiler) bug.
OS-LUX V0.0
Working on...
Memory management: the Pool
Working on...
Memory management: the Pool
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: Forking causes triple fault occasionally
Well, I added a 'u32int *wait' to the structure that blocks the task from being scheduled if it so requests. The pointer gets set to a variable. Once the variable becomes true, it unblocks the process.
The test wasn't even using the new feature, and I called 'fork' and it died...
Are there any ways to get around such a compiler bug if thats the problem?
-JL
The test wasn't even using the new feature, and I called 'fork' and it died...
Are there any ways to get around such a compiler bug if thats the problem?
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: Forking causes triple fault occasionally
Could you turn off optimization? This might help...
OS-LUX V0.0
Working on...
Memory management: the Pool
Working on...
Memory management: the Pool
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: Forking causes triple fault occasionally
Well, unfortunately, it's temperamental, so it's difficult to test. I tried to add some new things to the struct, and it seemed fine...
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io