What is a coder’s worst nightmare?

Answer by Mick Stute:

This was mine:

Was hired by a psychologist to fix a program that seemed to have "strange output" written by one of his ex-grad students. It was a program that reads a data files, asks about 50 questions, does some calculations, and comes up with some score based on this PhD's research. It's on a research 3B2 at the university. He demonstrates the program and sure enough there seemed to be strange flashing words on the screen when it moves from question to question and they don't seem nice. I agree to do it, should be pretty straight forward, so he'll pay me by the hour to determine how big the fix is and then we'll agree to a fee.

Day 1
I sit down at the 3B2 and login to the ex-grad students account that has been given to me. This is where the code resides. I examine the C code. It is written to be hard to read. All the code is squished on one line. It's spread over 15 files with about 3 functions per file — all on one line. All variable names are just three, seemingly random, letters. I talk to the guy and agree to go with hourly on this (great decision). I untangle all the code and format it nicely so I can see it.

 It was done on purpose. It used the curses library to move to a point on the screen print a question and the answers and wait for a response. But it first went to the first line of the question, printed some white supremacy message, waited 1/2 a second, and then over wrote it with the question. This ought to be simple. There's only about  5 places it output anything and all of them had this subliminal flash of a message. Each one was hard coded. No problem. Delete the offending mvpwintw() and all is well. Or should be. I compile thinking I'm done. But when I ran it, there it is again — the subliminal messages. This time with different text still the same subject, just different messages.

I check my code and believe it or not it's back to the initial state I found it. 15 files, mangled, 3-letter variables — the whole thing right back where I started. I want shoot myself for not making a copy of my code. I unmangle again this time putting it in three files, named differently. I make a copy of the whole directory and I mark the files readable only. I compiled it. All looks good. I run the program. There's now a copy of the original 15 files in the directory along with mine and the subliminal messages are back.

Okay so some where on the disk is the source code necessary to keep doing this and he's set the program up to pull in that code when you compile it. I do a full disk search in the include areas (/usr/include) and since this is a research version we have source for just about everything but the kernel itself. That's a lot of header files and this takes some time on the 3B2 so that's day 1.

Day 2
The disk search showed up nothing. The strings were apparently either encrypted or they are buried in a library somewhere. Because I don't have check sums of all the original executable objects I decide to search all libraries for the text. This is even longer than before, so day two is over.

Day 3
No results. The strings are encrypted. That means I'm going to have to follow all the header files from each #include and each one they #include to find where this is. And that will, take some time. We do alert the campus computing department that we believe someone has gained root level access to Dr. Phelps research computer which is just a shared lab computer in the science building. They're understandably not convinced.

I start unwinding the #include files. I do that, no where do I find the code. So now I know it's compiled in a library. No problem at all. Why not just recompile all those libraries, we do have the source after all.

Days 4-6
The hardest part, convincing the campus nerds they have an issue. But we finally do and Mark, the Unix admin who was hired because he married the Dean's daughter, gets busy learning how to do this. In the end, he agrees to allow me to handle it because he just doesn't really know how to get all that stuff compiled. End of Day 6, all standard libraries are recompiled. Who hoo!

I whip out my modified, cleaned up source and start the compile. All looks good. I run it. O M G. It did it again. 15 messed up source files and the subliminal messages are back. This is suddenly like magic. I investigate very very carefully though I am stumped. This code doesn't exist in source code. I think I might be beaten. Dr. Phelps isn't happy with the hours involved and thinks maybe we ought to just rewrite the program from scratch. "Sure", I say staring at the terminal like a lost puppy too deep in my thoughts to put out of my thinking mode, "I think you're right. That will be quicker." "Good," he says, "we can start tomorrow."

Day 7
To hell with that. This guy isn't beating me. We are compiling it from his stinking code or not at all! "You don't have to pay me anymore, Dr. Phelps, I just want lab time." This is nerd war.

Days 8-14
I get smart, I'm thinking he somehow modified the curses library. I compile the curses code to assembly and though I don't know 3B2 assembly (yet!) I start learning.  I read manuals for 6 days, piecing together that assembly code. Waste of time, nothing seems unusual.

Day 15
I suddenly realize it's in the compiler. It was the compiler. And every time you compile the original code and run it puts in the subliminal message code into the source code. I'd heard of this before.

Ah ah! I've got him!!!! We have the source code for the compiler as well. I search through it looking for a reference. Lo and behold, I find it. Indeed. There is source code in the compiler/linker that does this:
1) it examines any call to fopen(), searches the file opened looking for Dr. Phelp's questions; if it finds them then
2) it rewrites the 15 files to the current directory when compiling that specific program.
3) It then compiles Dr. Phelps program using the 15 files and outputs to the -o name in the link phase.

The compiler was modified to put that code in Dr. Phelps program as written by the man that modified the compiler.

Several days later, an AT&T tech shows up with a disk and loads the proper compile and linker source and we recompile the compiler from the source. That solves it. All the bad source in the compiler is gone and we've got a new clean copy of the compiler.

Except it didn't. Because the compiler was poisoned with other source code that we didn't have. And that source code, that now existed only in the executable compiler, put those changes back into the compiler source before it compiled it. But this time it didn't modify the /usr/src copy, it copied it to a hidden directory, modified the compiler source, compiled itself from there, and deleted the hidden directory. It took an AT&T tech to find this. The ex-grad student had poisoned the compiler to poison itself when it was recompiled. We had to put a new binary version of the compiler on disk from another 3B2 running the same revision before the problem went away.

We also found that if /sbin/login is compiled it puts in a backdoor allowing anyone who uses a specific password to login in as the root user. This computer is accessible by modem and Tymnet. Finally this gets the computing center's attention.

Genius! But put to a horrible cause.

What is a coder's worst nightmare?

Advertisements

Who was the laziest person in the history of mankind?

Answer by Hamish Kelly:

From: http://www.abovetopsecret.com/forum/thread995013/pg1

I was once on a US military ship, having breakfast in the wardroom when the Operations Officer (OPS) walks in. This guy was the definition of NOT a morning person; he's half asleep, bleary eyed … basically a zombie with a bagel. He sits down across from me to eat his bagel and is just barely conscious. My back is to the outboard of the ship, and the morning sun is blazing in one of the portholes putting a big bright-ass circle of light right on his barely conscious face. He's squinting and chewing and basically just remembering how to be alive for today. It's painful to watch.

But then zombie-OPS stops chewing, slowly picks up the phone and dials the bridge. In his well-known-I'm-totally-asleep voice he says, "Heyyyy. It's OPS. Could you … shift our BAFPAT … yeah, one-six-five. Thanks." And puts the phone down. And he just sits there. Squinting. Waiting.

And then, ever so slowly, I realize that that big blazing spot of sun has begun to slide off the zombie's face and onto the wall behind him. After a moment it clears his face and he blinks slowly a few times and the brilliant beauty of what I've just witnessed begins to overwhelm me. By ordering the bridge to adjust the ship's back and forth patrol by about 15 degrees, he's changed our course just enough to reposition the sun off of his face. He's literally just redirected thousands of tons of steel and hundreds of people so that he could get the sun out of his eyes while he eats his bagel. I am in awe.

He slowly picks up his bagel and for a moment I am terrified at the thought that his own genius may escape him, that he may never appreciate the epic brilliance of his laziness (since he's not going to wake up for another hour). But, between his next bites he pauses, looks at me, and gives me the faintest sly grin, before returning to gnaw slowly on his zombie bagel.

Who was the laziest person in the history of mankind?

X-MUN HSC Day 1 report

Pre- script: This is a report of the Xavier’s MUN, 2014, Historic Security Council. Agenda: Discussing the Suez Canal Crisis of 1956. The Press played the role of the BBC- The “Baseless Broadcasting Corporation”. Hence, some British terms are used.

This report was written by my fellow press member (Roshan Zoha) and I.

The delegates of the HSC clearly embody the principles of the three monkeys of The Half-Naked Fakir– not to hear or talk (or see). With an uncanny resemblance to corpses in a graveyard and the unique ability to slumber through the most volatile updates, the delegates have distinguished themselves through their repetitive arguments, rhetoric, misplaced puns, and extensive “lobbying skills”.

After various motions to open debate, set the (pre-determined) agenda, and other exhaustive MUNning procedures, the delegate of Iraq began with a 90 second , heavily accented speech that few (if any) could comprehend. The next impact came from the delegate of USSR.They started off by classifying hypocrisy as having two forms: one, the general form,and the second as that exhibited by the ‘glorious’ United States of America.

The delegates of Belgium, in attempting to justify Egypt’s actions, displayed their amazing ability to foretell the future,by predicting the construction of the Aswan Dam even before the Egyptian delegates themselves came to know of its proposed existence. This trend was continued by the Australian delegate, who declared the yet-to-occur WW III concluded. Among our various “bhavishwavanis”, the most prominent were the delegates of the USSR, who predicted the advent of Saddam Hussain in between respiratory reflexes, and the delegates of UK who foresaw surrogacy.

A foreign policy-defying Update introduced by a drowsy chair made little impact on a bunch of equally drowsy delegates. The next half hour, spent discussing trivial matters having little to do with the matter at hand, sent most of the non-delegates, along with some active participants, to dreamland; the simultaneous debarment of the delegates of France and USA being the most interesting event at that time. The next Update, discussing CIA interceptions and military mobilization surprisingly hinted at a possible US-USSR alliance. Response to this Update was as limited as before, with the delegates of Egypt hogging the limelight again- they accused the CIA of falsifying the Update.

It has come to the attention of the Press that the chairs are apparently very uncomfortable- the delegates of Jordan and France clearly had greater affinity for the Chairs than for their own chairs. The hard plastic seats also had an effect on a delegate of Syria, who suffered since-birth-memory-loss, calling his own country “Iraq”. Also affected were the delegates of Egypt, who tried to convince the Chairs that HMUN procedures could be applied in the XMUN, alongside trying to pass off the Committee Study Guide as a legal document. The Egyptians themselves were victims of plastic-chair-induced-brain-scrambling, when the delegates of USSR declared Egypt to be the “breeding grounds of the world”.

Unmoderated caucuses displayed the delegates’ excellent “lobbying skills”. In fact, the delegates of Yugoslavia even began lobbying with the members of the Press (NOT an accident). A modification of this complex also affected the delegate of Jordan, who (accidentally) asked the Press if they would be signatories to his Draft Resolution. The delegates’ exemplary communication skills were further highlighted by the mass astonishment at being informed that there would be Draft Resolutions. One of the Chinese delegates stirred up quite the house jam with rapper like hand movements worthy enough to give the Chair of the committee an inferiority complex- though the chair’s inferiority complex had already been highlighted earlier, when some delegates beat him at his own forte; i.e, rhetoric.

Fractured International Diplomacy is a pleasure to watch. While the first Update forced Jordan, Iran, Iraq and Turkey to change their stance on Egypt, the second and third Updates saw the fracturing of relations between USA, UK and France. USA violated the NATO treaty and issued economic sanctions against its fellow NATO members, simultaneously siding itself with Egypt (and thus with the USSR). The delegates of Egypt, seeing a golden opportunity, tried to play God by obtaining the support of both the USSR and the USA. To their dismay, the USSR delegates claimed that they weren’t against USA; but they didn’t want to be on the same side as them either.

The day ended with deliberations on the various Draft Resolutions. The delegates, having finally come alive after a can of Red Bull, apparently decided to spread their wings and disrupt committee, for in the next one-and-a-half hours, the delegates ensured that 90% of the motions raised (there were lots of them) failed. Two delegates of USA and UK decided to go further; the chair had to order the UK delegates to shift places. Draft Resolution names were also quite innovative- the most ‘outstanding’ being “Oi-shek your Boo-tay 01”. Mr. Oishik Ganguly, member of the Executive Board, took offence to this 

The X-MUN HSC: Day 1 was everything one could have asked for, though the lack of an Entertainment Motion was definitely regrettable. However, on a day when USA and USSR can be allies on a military issue, some rules can definitely be thrown to the wind.