Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When I was a fresh junior programmer (a few years before the book was written), making my first independently designed and significant change to the system I worked on, I tripped over a "select is broken" kind of bug - specifically, mmap() was broken on AIX 3.2.5, in certain cases. It was weird and wonderful, because my code worked in the test environment, but not the production environment.

The response of the senior engineers was "What's really wrong with your code?" Ultimately, I was able to prove an OS bug with IBM, but it required extraordinary proof.

And you know what? If some smart junior programmer came to me and said "I think there's a bug with a low-level OS call", my response would be "What's really wrong with your code?" As it should be. Heck, if a lead engineer said that, I'd have the same response. If I said it, that would be my response to myself.

That's because select is very rarely broken. The exceptions just prove the rule.



I ran across a bug in the JDK when I was an intern and spent 2 weeks documenting and demonstrating that it was in fact a bug in Java not in my code. :D funniest thing was I got to pull an I told you so on my professor who claimed we would NEVER run into a bug in the JDK and to just try to figure out what we did wrong.


Yep. And if an intern of yours came to you and said "I think I found a bug in the JDK", you'd probably say "What's really wrong with your code?", wouldn't you?


But if you're smart, you'd ask him to show you the bug.


If she thinks she found a "select is broken", she needs to write a test to exercise the behavior, independently of our existing code base. That's how I chased down the mmap() bug - I wrote a program that showed the bug on the prod servers but not the test servers, and sent the C code and the executable I compiled off to IBM for analysis. (It was a charming bug, btw... it would randomly overwrite pages of memory with nulls, maybe 10% of the time)


Yep -- minimal demonstrative code. That's the ticket.


"I never make exceptions. An exception disproves the rule."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: