First Last Prev Next    No search results available
Details
: lli Doesn't Handle Exceptions From Bytecode Reader
Bug#: 391
: libraries
: Target-Independent JIT
Status: RESOLVED
Resolution: FIXED
: All
: All
: trunk
: P2
: normal
: 1.3

:
: crash-on-invalid
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Reid Spencer <rspencer@reidspencer.com>
Assigned To: Reid Spencer <rspencer@reidspencer.com>

Attachments
Proposed patch to make exception handling around calls into bcreader more robust. (2.13 KB, patch)
2004-07-07 15:44, Reid Spencer
Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-06-29 15:49
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.
------- Comment #1 From Chris Lattner 2004-06-30 16:41:51 -------
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
------- Comment #2 From Reid Spencer 2004-06-30 21:34:52 -------
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.
------- Comment #3 From Chris Lattner 2004-06-30 22:42:22 -------
thx :)
------- Comment #4 From Chris Lattner 2004-07-06 21:43:12 -------
any luck?

-Chris
------- Comment #5 From Reid Spencer 2004-07-06 22:36:12 -------
If I get the bytecode doc done before bedtime, I'll look at reproducing this
tonight, otherwise tomorrow night.
------- Comment #6 From Reid Spencer 2004-07-07 15:44:22 -------
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.
------- Comment #7 From Chris Lattner 2004-07-07 15:47:15 -------
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
------- Comment #8 From Reid Spencer 2004-07-07 15:58:27 -------
Yeah, that's pretty much what I was thinking.

First Last Prev Next    No search results available