Debugging in Plain English?
sameerdesai writes "CNN is carrying a story about Researchers from Carnegie Melon: Myers and a graduate student, Andrew Ko, have developed a debugging program that lets users ask questions about computer errors in plain English: Why didn't a program behave as expected? I guess with recent exploits and bugs that were found this will soon be a hot research topic or tool in the market." We recently did a story about revolutionary debugging techniques; the researchers' website has some papers and other information.
"Because you can't code worth a damn."
Mr. Debugger, I'm running a multithreaded perl app using perl 5.8.3's ithreads. I am using DBD::mysql to talk to a local mysql database. At the program start I spawn a child thread that waits for a thread::queue to be filled with data. Once the child thread receives data it spawns several children of its own to process the data. Each grandchild forms its own dbd connection and successfully processes the data, then gracefully closes the connection and waits to be joined.
The problem arises when the controlling child thread begins to join the grandchildren. Despite the mention of global destruction, the entire program is not exiting - just the grandchildren are being joined. When the grandchildren join, perl dies with the following error:
Attempt to dereference null pointer during global destruction.
When performing the same style operation without using DBD (and thus not actually doing anything useful) the error does not occur. Initially, this appears to be a thread-safety issue with DBD however when isolating the child and grandchildren in their own test program (so the controlling child is the main program and the grandchildren are spawned worker children) the error does not appear.
Help me O great plain English debugger. You are my only hope!
Karma: SELECT `karma` FROM `users` WHERE `userid`=138474;
printf, System.out.println, warn, print, etc.
Oh ... this will be wonderful for security the world over. If it works ...
Microsoft Programmer: "Why does our software suck?"
*computer hangs, then bursts into flames from the load*
In soviet russia, You ask not what country do for you, but what you do for country!
Oh wait...
Because I debug in plain english anyway, I'm always saying "Why the hell won't you work you piece of shit?!" and "Listen here you piece of shit if you insist on seg faulting again then I'll show you where you can put those damn indices!"...
So... now the computer can actually respond to my threats and questions. Excellent!
Mike.
(Yes, I did RTFA.)
Mmmm......sacrelicious.
Untill I can have a full conversation with a computer (a la the Turing effect, not the limited versions that Alice et. al. can accomplish) I'll be happy with source code, thank you very much. It's just another layer blocking me from the code anyway (read In the Beginning... lately?).
[...] "Forty-two," said Deep Thought, with infinite majesty and calm.
It was a long time before anyone spoke. Out of the corner of his eye Phouchg could see the sea of tense expectant faces down in the square outside.
"We're going to get lynched aren't we?" he whispered.
"It was a tough assignment," said Deep Thought mildly.
"Forty-two!" yelled Loonquawl. "Is that all you've got to show for seven and a half million years' work?"
"I checked it very thoroughly," said the computer [...]
www.kitchengeek.com -- Nosh for
WHERE THE FUCK DID MY THESIS GO??? ...if it can bring calm to these situations, we may have a contender for the Nobel Peace Prize.
Know what I like about atheists? I've yet to meet one that believes God is on their side.
"Whyline, has been used only to debug programs in Alice, an academic programming language with a limited vocabulary of commands to make interactive 3-D worlds, like video games."
"Adding Whyline to a different language, like Java, which is 10 times as complex, could limit how much Whyline can help. So Whyline is a very long way from getting incorporated into the world's most widespread software, Microsoft Corp.'s Windows operating system. (When asked about its own debugging efforts, Microsoft didn't comment.)"
Which means at the moment its all speculation, and only works for very simple (hello world) applications. By the time this program is useful, we'll have robots (like Millenium man), who will do all the debugging...
That's great, but does it understand expletives?
All these talks of "revolutionary" debugging techniques bother me a little. There's only one debugging technique, and that's the debugger's skill and experience. Debuggers, traces, logs and other printf()s and LEDs flashing are just tools.
Andrew Ko's invention is just another tool. It won't do the debugging for you. Just like modern cars have diagnostic computers, but somehow it appears you still have to fork off $30/hr for the workmanship to get it fixed...
"A door is what a dog is perpetually on the wrong side of" - Ogden Nash
Article says adding Whyline to java makes it 10x more complex. Seems to me like just another example of Computer Science grad students trying to justify their existence.
Plain english or not, make it easy for someone to debug and I'll be out of a job. I like finding other people's mistakes and being the one to say "Uh, dude, this is where you screwed up, but I fixed it for you".
Where's the fun if I can't point out someone's shortcomings?
So when is the Hawkeye movie coming out?
Why didn't a program behave as expected?
Is it because didn't a program behave as expected that you came to me?
A couple years ago I was chatting to someone who developed a program where specs could be written in plain English. Specifically, Rational already has a spec language called controlled English that is simple enough for PHBs to _read_ (but not write, kinda the opposite of APL and perl ;-)
Anyways, while PHBs cannot write controlled English, they can write English, so this guy treated the problem as human-assisted machine translation. However, it never seemed to take off. *shrug*
I think I'll stick to yelling at the machine when I'm trying to run "make" when a dependency gets left out of the ./configure script and it errors out after 5 minutes of compiling.
"What the fuck is libmonkey1316-3.so??!!"
Finding whole RPMs with the name of one known file you need is always fun. On second thought, maybe asking the computer what the hell that file is could help.
It would be cool if it didn't suck.
Hello SeanTobin(138474)!
I am Surest K. Padebugtel of Mrdebugger.com
I understand that you are having a problem with I'm running a multithreaded perl app using perl 5.8.3's ithreads. I am using DBD::mysql to talk to a local mysql database. At the program start I spawn a child thread that waits for a thread::queue to be filled with data. Once the child thread receives data it spawns several children of its own to process the data. Each grandchild forms its own dbd connection and successfully processes the data, then gracefully closes the connection and waits to be joined.
Please to reboot your system.
Has this helped your problem? (Click "Reply" to this trouble ticket if you feel you need further assistance with I'm running a multithreaded perl app using perl 5.8.3's ithreads. I am using DBD::mysql to talk to a local mysql database. At the program start I spawn a child thread that waits for a thread::queue to be filled with data. Once the child thread receives data it spawns several children of its own to process the data. Each grandchild forms its own dbd connection and successfully processes the data, then gracefully closes the connection and waits to be joined.)
Thank you for your interest in Mrdebugger.com!
Sincerely,
Suresh K. Padebugtel
What'll be interesting, if a long way off, is when they get plain English development.
...then again I wonder if it would be fun to make a shell that used something like Infocom's "INFORM" parser...actually, wire that up to some speech recognition, and you'd have something interesting. Not neccesarily super-useful or more effecient than the tried-and-true-UIs, but interesting.
Now, there's a lot of reasons why this is a tough problem; English is tremendously less precise than a computer language, and a computer would need a GREAT deal of common sense before being able to make good sense of our high level spoken descriptions.
But still...so many programming tasks are really 95% "lather, rinse, repeat", and we're striving to get Design Patterns in place for much of the rest. It really makes me wonder...
For the history buffs, I think COBOL was one attempt to bridge spoken "Businessese" and computer code. I don't know a ton about it but I think it might ultimately be an underrated attempt... (for a while, all computers were financial (base 10 for its math, usually) or scientific (binary)...over time, the scientific approach 'won out', probably because it was easier for the scientific side to emulate the business side than vice versa, or maybe because the attention span of geeks is more important than who's writing big checks. Anyway, today's Unix culture is firmly from that scientific tradition, dot com boom not withstanding...
Thus endeth the less-than-full-assed history lesson and speculation about where this stuff will end up...
SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
How useful will this be when it responds to a simple question with a simple answer?
me: why did the program leak 1GB of memory then segfault?
computer: because you don't know how to program, you idiot!
I don't think it'll make as much of an impact in the real world (e.g. replacing "general protection fault" etc) as the article implies. First it seems more to trace a set of known possibilities that happened or not, rather than to catch really unexpected occurances. If a fence post error caused a count to trigger some action an iteration too early that would be a very hard thing to see at an object level even if you were the programmer who could interpret such things. If you were the user whose binaries had been stripped of most debugging info to reduce chances of reverse engineering then you'd have an obtuse error message that probably has no way to recover from the error.
It's a neat idea, but this doesn't sound like an end user sort of innovation (or anything close to it) as the article portrays.
There seems to be a fundamental logic problem with this kind of debugger. It seems to be more of an 'interpretive debugger' in which it would need to know what you're trying to do in the first place. Thus, it would have to know what the code -should- look like in order to tell you what the problem is.
In essence, for there to be a "English debugger" (one that speaks more english than current debuggers, that is), it would essentially need to know how to program itself on top of being able to follow the flow of code and find where it breaks, so as to be able to tell you precisely what the problem is.
Sounds a bit fictional to me.
~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
Hey moderators, this is NOT FUNNY! I've been wresteling with this problem off and on for nearly 3 months now. (I've come up with several varried solutions, but none of them are the way I want it to be done)
Karma: SELECT `karma` FROM `users` WHERE `userid`=138474;
C
Sharp
Eww, I can't believe I just said that. I need a shower. I was kidding. Kidding. I use C# for text processing as much as I drive through New Jersey on purpose.
Never.
From the pdf on whyline, it seems to work with the Alice language. Alice seems to be very rigid in its design, allowing English lookups (rather like naming variable in English-word format like 'pac_resize').
This is a more user-friendly version of tools like grep and awk.
This type of debugger would seem difficult to make in the lower-level program tools without rigid naming conventions. Or else the searching would be on high-level concepts like graphic resizing that would be searched on the language functions that perform the resizing (regardless of data-var name).
I do have to disagree with their definition of a programmer: "If you've created a spreadsheet, made macros in Excel or Word or used a Web application to fetch news about your hobby or favorite celebrity, you've programmed". Although technically usable in definition, a Word/Excel macroist does not a programmer make.
debug> Why did my web server crash?
reply> slashdotting
So this whole article is about the UPS Debugger. Just One More Hack, and then he'll put it on the 'net...
MP3 version available at: Just One More Hack - Mark WheadonWhen I think about some of the bugs I have found (and coded), the Whyline approach seems very far-fetched. The degree of self-awareness (introspection) required by something like this makes it seem like the program would be able to avoid the trap in the first place. It would require the "analyst" or "observer" module to observe not only a stack trace and PC trail, but also would require the module to understand what is supposed to occur.
I don't expect this early research tool to catch all of these, but I'd like to hear the researchers' response on how their system might (after years of development) answer questions about some of these bugs:
- Why did the Mars Pathfinder software deadlock (priority inversion)
- Why did the Mars Polar Lander crash (improper state management)
- Why did the Ariane 5 blow up (arithmetic overflow in a register)
- Why did the Patriot missiles miss in the 1991 Gulf War (accumulated time error)
- Why did a radiation therapy machine zap patients with the wrong doses (inconsistent state between GUI display and internal software state)
I'm sure there are some others on comp.risks and elsewhere.
Another point: this approach is still "just" a testing tool. In other words, it can only find errors on paths that have actually been taken in tests, which means the testing program must cover enough cases to generate the runtime errors in the first place. In all of the above cases, it was the testing program that permitted the bugs to be fielded.
In the area of error messages, we need a better balance between "understandable" and "informative". Today, it's usually one extreme or the other. Either error messages are too "friendly" to the point that they're rather meaningless (as in the notorious "Web site not found"), or on the other extreme, they're so "complicated" that the novice user has no idea what happened (as in "an xxx exception occurred at xxx, here is the stack trace, register states, and many many more confusing numbers").
It would be nice if we (as a society that happens to use computers) could adopt a guide that gives the technically-savvy enough info to go on, but still helps the novices understand what went wrong in terms they can understand too. A balanced approach.
Such an error reporting scheme, if successful, could almost certainly NOT be designed by marketing weenies nor by geeks alone, but through mutual collaboration and willingness to compromise on both sides. Hmm, no wonder it's so challenging.
I'm an animal lover -- they're delicious!
Maybe you should try a mem debugger like valgrind (i386 Linux only). It saved me lots of debugging time.
You could ask InterScope questions like "Who calls FOO?" or "What function called by BAR stores into ZOT?". It answered by referring to a pre-computed database. Naturally, this kind of thing was made easier by the fact that LISP programs are represented as LISP data structures.
One really has to ask whether there's anything really new in The Whyline apart from a pretty interface.
Melon is a fruit..
This reminds me of back in approx 1985 or so, someone "invented" a human language programming environment called "The Last One" or something like that. This would supposedly make it simple to write programs without having to learn C etc. Some programmers quaked in their boots. However the real issue with programming is learning the contructs, not the language (ie. if you understand what a linked list is, then writing one in C vs Pascal is pretty simple). Anyone that thinks that programming in English is easier is seriously misunderstanding programming. The ultimate test is to look at the languages that have survived: The more "human readable" languages like COBOL have not survived, but the more cryptic ones like C have. The big "killer app" for making programming simple for the non-programmer was the spreadsheet and that's hardly a natural language.
Now debugging is pretty much the same deal. Verbose English debugging interfaces might make it simple to learn to do very basic debugging, but once you get into things a bit deeper (and get more experienced), English becomes a huge liability and you'll be wishing for more concise and expressive languages.
Engineering is the art of compromise.
Buddha is a debugger for Haskell that displays, in a heirarchical fashion, every function call in your program, then lets you declare every function application and result as "Correct, Erroneous, Inadmissible, or Unknown". It can thus track down the error to a particular application of a prticular function.
Why is it called Buddha? Because otherwise debugging Haskell means just staring at your code until you achieve enlightenment!
> My program crashed.
What does that suggest to you?
> There is a bug somewhere.
Does it make you happy to know there is a bug somewhere?
> No.
Why are you so negative?
> Are you going to help me fix this bug?
We were discussing you, not me.
With these "natural language" languages, I always wonder- is English the only natural language out there? Doesn't look like it from the world around me.
Then why all those "natural language" thins are in English?
Seems to me that is easier to learn a programming language then to learn English for a non-native English speaker: much less ambivalence.
xslf.com
He also said that there were no silver bullets, and he said so over twenty years ago. It seems that every few years a generation arises who haven't read him. Put natural language debugging on the pile with case and all the others.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
I was going to write up a cardboardprogrammer.com site with a flowchart with 20 questions to ask about a bug to clarify your thoughts. [I suppose both linux and windows can have a REBOOT as the first directive and what was the difference between now and when it was last working as the second, are you using the latest version of the code as the third has anyone else been working on these files the fourth.. well you get the idea, [it is like shooting fish in a barrel, but I have never seen it the full flowchart] that was in the dotcom era, when even a tiny good small idea like this was in someones mind a possible next big thing].
Be Free: Free Software Tuition
Alice is used by the students of Building Virtual Worlds to create 3D VR environments. The students are CMU undergrads in every department from Computer Science to humanities to fine arts.
I wouldn't consider Alice a "language for children," since 20-something-year-old college students learn it and use it extensively. If you learned C++ in middle school, would you call it a language for children?
You call CNN "Bad Bad journalism," yet you leap to the wrong conclusion about a language you know nothing about. You mustn't be new here.
For more information, click here.
When I lived in South Africa I could speak pidgin Zulu and Xhosa and studied Xhosa at university. If I recall, Xhosa had 16 noun groups and seven tenses. This means that Xhosa is far less ambiguous as to the relationship between things. Verbs are spoken with the subject and object noun group prefixes attached. Thus the verb for "hit" is different when applied to a dog as opposed to a tree. This potentially helps remove a lot of the confusion in human/machine natural language interfaces. Problem though is finding enough Xhosa programmers and Xhosa people wanting to buy your product.
Engineering is the art of compromise.
In the products I'm involved with I often get stupid reports from the field of the form "framing error causes unit to reset". When I get one of these, first thing I do is get back to the user and figure out exactly what they saw and what heppened withouth them trying to figure out the symptoms. In the "framing error" problem, what was really happening was that a power glitch was being caused when the RS232 cable was attched (because of bad grounding). This caused a reset. However, the user was a "super user" who knew bad things happen to serial data when you plug/unplug cables. One of the buzzwords he knew about was a framing error. So he "half solved" the problem by saying that a framing error caused the problem.
There is a big difference between observing and fixing problems. QA is about observing, not fixing, problems. It is better to provide a good way for users to make accurate error reports (eg. backtrace/log/whatever) than try have them try explain what went wrong.
Engineering is the art of compromise.
To go from 1 to 2 is the hard part. But, you can use tools to instrument the problem and determine where the problem may be.
Fight Spammers!
"It looks like you're trying to dereference a null pointer during global destruction. Would you like to start the debugger?"
Well, this is a snippet from a response, but it really gets the core of the issue. Global destruction is a very stressful time to do just about anything. I'm by no means a programmer, and I have no idea what you're talking about, but don't you have better things to do when the end of the world comes? I'm even more alarmed if your 'threads' are actually causing global destruction. I beg of you, please stop programming!
My Blog