A bug's life

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
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

A bug's life

Post by Pype.Clicker »

gwaah.

I spent at least one week of clicking-time tracking a weird bug in the new "action log" subsystem of clicker ... It first appeared as a "loop" in a bidirectionnal list of buffers. Of course i immediately thought of a buffer overflow but all the checks i could imagine were guaranteeing that buffer limits were respected.

Then i went into more and more "invariant" checks, making sure the list was correct and reporting the actual number of entries, making sure that all the entries were allocated where they were supposed to be, etc. no much more success.

But at least, i managed to track down the bug to some deterministic point where the list was broken ... and since no operation were performed with the list between the last time it was seen correct and the first time it was seen wrong, i thought of an overflow again.

After a whole evening of "x /16xw 0x3e0000" or "x /64cb 0x3e0000" analysis using QEMU, it revealed that there was indeed an overflow ... because the initial size of the array was wrongly defined :P

"and it feeeels liiiike i'm seventeeen agaaaain" ::)
Kemp

Re:A bug's life

Post by Kemp »

Lol, Pype showing us that no matter how experienced you are you can still make mistakes.

We should gather a collection of stories like this and compile them together on the Wiki. Might help keep people's spirits up to know they're not alone in making mistakes.
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:A bug's life

Post by kataklinger »

Well, I think I'm spending more time debugging my code then actually programming ;)
Kemp

Re:A bug's life

Post by Kemp »

Yeah, it is unfortunately the way.

Coding : 1 hour
Debugging : The rest of your week
Finally nailing something that damn bug : Priceless
Some bugs you can't fix, for everything else there's breakpoints
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:A bug's life

Post by Pype.Clicker »

Kemp wrote: Lol, Pype showing us that no matter how experienced you are you can still make mistakes.
Very certainly ... One of the reasons that makes me able to quickly pinpoint other people's errors by inspecting internals of obscure error messages is that i made the error myself previously.

The main reason that makes me *not* posting "help. clicker's not working" on this board is that i know clicker has become too large for anybody else to help with the microkernel ...
Kemp

Re:A bug's life

Post by Kemp »

Yeah, I'd imagine that becomes rather a large problem as the OS (or indeed any project) becomes larger, only the original team know enough to be effective debuggers. Not wanting to go off-topic too much, but I know there have been more than a few companies that have had real problems because of that issue. I guess we in the hobby OS deving business are fortunate in that if we decide to walk away then we don't leave a huge mess behind us (unless if course you happen to be one of the few that found a group that held together long enough to do more than rip off a boatloader :P ).
NotTheCHEAT

Re:A bug's life

Post by NotTheCHEAT »

lol that sounds like a mistake I would make.

@Kemp: One of the biggest reasons that happens is poor (or no) commenting. If people would comment well, then it would first of all be easier to track down bugs, and second of all be easier for outsiders to see what's wrong. Of course, when the project gets really big comments don't help much...

Bugs are hard to find when you have a really big project, but it really sucks when you find out that all the time you spent looking for this bug was a waste due to the bug being so stupid and obvious that you should have noticed it right away in the beginning. I don't know how many times I've experienced that...
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:A bug's life

Post by Pype.Clicker »

i just had a talk with Ken L. Calvert (Kentucky) this morning about a bug i reported them in their Ephemeral State Processing router ... And when i said "Well, if you have no bugs, it means you have no software" ... to what he replied "if you have no bugs, it means you have no end-users"

and that's so true ^_^
0Scoder
Member
Member
Posts: 53
Joined: Sat Nov 11, 2006 8:02 am

Re:A bug's life

Post by 0Scoder »

About a month ago I went through a period of time when almost everything worked first time! It went back to weeks of de-bugging pretty quicly though. It's weird though how it's possible to get bugs that take so long to fix, yet are just simple mistakes.

Is it something in our human nature that makes us too arrogant to excpect we could make such simple errors?
udarkman

Re:A bug's life

Post by udarkman »

The experience is what, the total of mistakes you made.
B.E

Re:A bug's life

Post by B.E »

I've had bugs like that. No matter what you do you can't find what's wrong but when you leave it for a min and the solution to the problem hit you. You think to you self what an *****.
Cjmovie

Re:A bug's life

Post by Cjmovie »

Kind of like when I was adding a higher-level function to my virtual memory manager...I coulnd't figure out why it wasn't working for _hours_ until I noticed I was passing virtual addresses to be used as page table entries :).

Yeah, anyone who's programmed on a non trivial (and then, even some who haven't :P ) application/anything has had an experience like this.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:A bug's life

Post by distantvoices »

what shall I say, eh?

You just build a new sort of control, think ah, all fine and dandy and then the debugging hell starts *rofl*

Fact: No command/operation is short enough for not to include at least 3 typos, eh?

No, honestly, I for one spend more time hunting down the weird bugs than doing coding stuff. That's rather long phases of thinking and short but quick phases of coding. Then comes usually the proof-of-concept and debugging. Usually one has to drop some crazy idea just because it isn't to be incorporated without trashing a whole lot of other functionality - which has been carefully debugged beforehand.

Oh, well. It's not like this with osdeving. It's at business quite the same: build some function/database query - afterwards comes the bug finding, which is most work. Try to fix why your superduper singleton select doesn't work out if power builder sql spy doesn't give the values inside the where clause, eh? Damnit. Well, thiss one is easy. DisableBind and all the values are visible. Finding out is the interresting part.

STay safe. :-) & happy debugging.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Post Reply