Bugzilla – Bug 391
lli Doesn't Handle Exceptions From Bytecode Reader
Last modified: 2004-07-07 16:08:04
You need to log in before you can comment on or make changes to this bug.
While testing my bytecode reader changes, I ran the regression tests and all the tests involving lli failed. The reason was that the bytecode reader was throwing an exception that lli was not handling so an abort occurred as the result of unhandled_exception(). While the bytecode reader was erroneously throwing exceptions, it is not inconceivable that it could do so. A disk I/O error could cause a mis-read which would almost certainly cause it to fail. The exception thrown contains a std::string& that has the error message. lli should be improved to catch std::string& from bytecode reader and terminate gracefully with the error message.
It doesn't? The place I see that could throw an exception is in JIT.cpp:117, which does catch it. What am I missing? -Chris
Wish I'd pasted the stack trace in here now. I'll try to recreate this (hard to do) and let you know the details.
thx :)
any luck? -Chris
If I get the bytecode doc done before bedtime, I'll look at reproducing this tonight, otherwise tomorrow night.
Created an attachment (id=152) [details] Proposed patch to make exception handling around calls into bcreader more robust. Its difficult to tell if this fixes the reported problem. In order to replicate the problem, it is necessary to hand modify a bc file in such a way that a function definition causes the bcreader to throw an exception. Several attempts to do this failed. The patch is the result of using llvmgrep to find all the uses of "materialize" and augment the exception handling accordingly.
I bet FunctionPassManager::run is the one that you ran into before. The patch looks good with the addition of an 'abort' call in the second hunk. With that change, please apply. :) Thanks Reid! -Chris
Yeah, that's pretty much what I was thinking.
Resolved. Patches here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040705/015804.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040705/015805.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040705/015806.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040705/015807.html