OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Oct 20, 2021 11:29 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Same old mistakes...
PostPosted: Mon Oct 04, 2021 3:41 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2641
Location: Devon, UK
Hi all,

I'm posting this essentially for therapeutic purposes. I've come back to a bit of OS Dev after pretty much a 10 year hiatus. I needed something to allow myself to "tune out" of the world, due to a lot of rubbish going on.

Anyway - wrote my PFE handler and all seemed well until the GPF on IRETQ. I used cli/hlt debugging and the stack seemed to be in the right place...hmmm.

The upshot is that at the end of my handler macro I was doing the following:

Code:
  add      $0x16,   %rsp
  iretq
  .endm


Now I'm sure that everyone on here has seen the mistake straight away - and I should have too. This debug should not have taken me a couple of hours :roll:

Cheers,
Adam


Top
 Profile  
 
 Post subject: Re: Same old mistakes...
PostPosted: Mon Oct 04, 2021 5:30 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7546
Location: Germany
You see that signature below?

The original version of that was my Technical Project Manager back at the time, telling me (after I did spend almost two weeks hunting down a bug that should have been extremely simple to spot):

"Every bug is obvious. Once you've found it."

Don't fret, we've all been there.

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Same old mistakes...
PostPosted: Tue Oct 05, 2021 10:38 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1108
My employer just spent six man-weeks searching for a bug and fielding a couple of rather irritated calls from the customer. Because of a forgotten break statement between two cases in a switch. It happens.

_________________
Thou hast outraged, not insulted me, sir; but for that I ask thee not to beware of Starbuck; thou wouldst but laugh; but let Ahab beware of Ahab; beware of thyself, old man.


Top
 Profile  
 
 Post subject: Re: Same old mistakes...
PostPosted: Tue Oct 05, 2021 12:35 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 866
I had GCC's AddressSanitizer absolutely losing its mind a few weeks ago. Why, you ask? It was a simple off-by-a few error in a C string function


Top
 Profile  
 
 Post subject: Re: Same old mistakes...
PostPosted: Tue Oct 05, 2021 8:50 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 442
Location: North Dakota, United States
I've been trying to debug this triple fault in my kernel when it tries to initialize its heap involving its page tables for months now. GSoC and college have gotten in the way and I (still) haven't figured out precisely what causes the bug, even though I've inserted debug print calls. I have a good theory but its one that doesn't make sense, especially since nobody else that I know of is experiencing it. I'm sure that when I finally figure it out I'll go "well how did I miss that?".


Top
 Profile  
 
 Post subject: Re: Same old mistakes...
PostPosted: Fri Oct 08, 2021 4:03 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7546
Location: Germany
Ref. Six Stages of Debugging

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Same old mistakes...
PostPosted: Wed Oct 13, 2021 10:49 am 
Offline
Member
Member
User avatar

Joined: Sun Feb 18, 2007 7:28 pm
Posts: 1518
Hi,

If its any consideration, the amount of times I cant figure out why something doesnt work just to lead the way back to a TODO or FIXME comment...just happened again not too long ago. What starts out as "Why doesn't this work? There isn't a reason why this shouldn't work" leading back to "oh yeah...".

_________________
OS Development Series | Project Neptune | Repository | Wiki
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: YaCy [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group