- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
WFAWHACSMFDLT ("What f***ing a**hole would hire a c*** s**king, mother f***ing dipsh*t like this?) Answer: The one who promoted him.
Admin
Reminds me of the source code for the 3d pipes screen saver. It was in the Windows SDK for a long time. If you set the elbow style to mixed, occasionally one of the elbows is a teapot. Well, the source code defines BLUEMOON equal to some three digit number and then at every elbow tests a random number 0-999 to see if it is equal to BLUEMOON. The source code comments even joke "Once in a blue moon". I wish I could find it.
Admin
When I registered my account high horses were the only option. Can't speak for the rest of the people here, though... ;-)
Admin
It's not unusual for people to have a complete copy of their stored proceduces in a set of text files, along with all of the statements for building the schema (tables, views, grants etc). It's called source control...
... I hope that you're not saying that in your org you just hack the code directly into the DB and hope/pray that it will work?
Admin
"Stuart's team poured through the code and identified a number of places where this could be happening, patched them all up, and deployed the changes to production."
Sounds to me like this dba improved their codebase!
Admin
That's definitely the big WTF for me here, using a message that actually looks like a real SQL Server error message.
I can understand why (well, almost anyway) it was done like this, but for the people that tried to find where the deadlocks were, and then find this, their response MUST've been 'WTF???'.
Admin
Why?
Admin
It would have been better to create the fake deadlock exception in a fashion that triggers the right error handler, but is recognizeable to humans too, e.g.<font><font color="#000099"><font color="#990000">
"Transaction (Process ID 123456) was deadlocked on THIS_IS_AN_ARTIFICIAL_ERROR resources </font><font color="#990000">with another process and has been chosen as the deadlock victim."</font><font color="#990000"></font></font></font>
Admin
The really funny part is that "Pearl" and "SQEUEL" are in fact the correct original names of both langauges. The Structured English Query Language had to be renamed over a trademark dispute, and Larry Wall discovered shortly before the official release of Pearl that there was already a language with that name.
Admin
I saw that movie, 'Sqeuel like a pig' ;)
Admin
The purpose I think would be to check that the application properly retried forcibly rolled back transactions.
This does seem an almost sound thing to do (if for no other reason than it's hard to test any other way).
But not in bloody production!
Admin
But the Peter Principle is based on people being promoted until they reach a position in which they are incompetent (mostly because promotion tends to be a reward for competence).
One could safely say this guy was already fairly incompetent prior to his promotion...
Also, but for the promotion, I'd have guessed this was put in by a disgruntled ex-employee. Random, hard to spot, annoying, seemingly inefficient for testing purposes. It looks like the kind of code one might write if one was thinking "mh, how can I mess up the system with minimum effort and detectability?"
Admin
I'd rather word with Paula. There is a reasonable chance she is hot a hot female who is good to talk with, plus she will NEVER insert such hostile code that keeps me working long hours to find.
This guy is just competent enough to get the above code to work. He is not even competent enough to have a 'oh duh' head slapper moment the first time this happens and silently remove the code. Thus forcing everyone else to work late to solve his problems.
Worse, this guy was promoted. He will not be interviewing. Everyone else should get out now - Paula will soon be working there too. (I'd rather work with Paula if the choice is between the two, but working with neither is better that either one)
Admin
You cut it off short. Please allow me to continue.
Me/You: "You are sure? What about <a couple more common exceptions to the rule>?"
They: "No".
Me/You: "Well, it does not seem likely, but if you are sure, then that settles that area. Next, <some other issue>."
They: "... except <exception I/you have been fishing for>."
I have had this happen with almost exactly this wording, and it was not rush-rush. Some people are good at thinking about processes and exceptions (generally us), and some are not. I have come to the conclusion that while many people may know how to do their jobs, they do not know how to describe/teach their jobs. Knowing why is a higher level of awareness than merely doing.
Sincerely,
Gene Wirchenko
Admin
I think you forgot the part where you wrap your two hands around their neck and shake vigorously.
"Its not that I'm a violent person, its that all of the assholes around me make me violent." -Me
Admin
Indeed. This looks like a nice example of the Dilbert Principle IMO...
Admin
That's the only explanation so far as I can see. She must be sex on legs.
Admin
In my story, it didn't happen in a meeting (where people are often in a rush and forget things), but an exchange of emails that went through several days (with a lot of CC recipients). But at least they were lucky, because I'm a stubborn person. When I changed the program, I also created that part where exceptions can be configured. They needed that part _soon_.
</exception></some>
Admin
Ah yes, the OpenGL Pipes screensaver. IIRC, one of the command line options or hacks would actually make it happen a bit more frequently.
Of course, those who have looked at the OpenGL would've probably used GLUT, and there's glutSolidTeapot() and glueWireTeapot calls to generate um... a teapot. Which is probably how it got there in the screensaver...
Admin
WTF? Didn't Stuart's team of crack bug hunting developers notice the transaction process id was always 13? Seems like that would have been a clue...
Admin
Wrong. 13=severity, 10=state.
Admin
The real wtf here is that no one spotted that the deadlock report error number was 50,000. Kind of a giveaway tbh. Oh, and the +'s would break it - so I doubt that it actually looked like that...
Admin
I really think CASTRAND is a better giveaway for the fact that it wasn't EXACTLY written like that ;)
But why would the +'s break it?
Admin
Assuming its sql server... it can't concatenate in the raiserror.
Instead it throws
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '+'.
Take out the string concatenation and you get a nice error. But as its a user thrown error, with no error number specified it comes out as error 50000.
What would have been neater is to call the correct error
raiserror(1205, 13, 10, @@spid)
But you cant raiserror under 13000 ... so he had to write his own.
Admin
WTF? Had no idea RAISERROR choked on string concatenation...
Admin
I'm sorry to say that I once perpetrated code like this. I had to hook database commit and rollback-before-termination operations across an entire (very large) application. So I hacked the toolchain to transform commits and rollbacks into calls to the appropriate routine, and then, well, the routines themselves, ahem...
... so I screwed up a one-line routine, had rollback() do a COMMIT, and then failed to notice for six months. Oddly none of the huge banks on whose sites this thing was running noticed either...
Admin
They didn't need a rollback in all that time, perhaps? They must have been exceptionally lucky, but I guess it can happen...
Admin
Ah, yes, the infamous Teapot... As Steve Baker puts it, it's not just any teapot, it's "The" Teapot. It is steeped in mystery and legend, and little is known about it's past. But it lives on, despite the great mysteries, as a standard rendering model in 3D computer graphics. To find out how it came to infiltrate the OpenGL standard API, and how it came to be a long running in-joke in the computer graphics community, we will journey into the Twilight Zone....