<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - MCJIT/lli doesn't handle exceptions if something from STL is included."
   href="http://llvm.org/bugs/show_bug.cgi?id=17080">17080</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MCJIT/lli doesn't handle exceptions if something from STL is included.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>MC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>aist11@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It seems exceptions can't be caught in MCJIT/lli if something from STL is used
or even included. At the same time glibc stuff (stdio) works well.

// test.cpp
#include <iostream>

int main() {
  try {
    throw 1;
  }
  cacth (int i) {
    std::cout<<"Exception: <<i<<std::endl;
    return 0;
  }
}


$clang++ -emit-llvm -c test.cpp -o test.bc -fno-use-cxa-atexit

$lli -use-mcjit test.bc

terminate called after throwing an instance of 'int'
0  lli             0x0000000000c62232 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  lli             0x0000000000c62099
2  libpthread.so.0 0x00000038f200efa0
3  libc.so.6       0x00000038f1c35a19 gsignal + 57
4  libc.so.6       0x00000038f1c37128 abort + 328
5  libstdc++.so.6  0x00000038f5460545 __gnu_cxx::__verbose_terminate_handler()
+ 341
6  libstdc++.so.6  0x00000038f545e6a6
7  libstdc++.so.6  0x00000038f545e6d3
8  libstdc++.so.6  0x00000038f545e8ff
9  libstdc++.so.6  0x00007f343166a0e1
Stack dump:
0.    Program arguments: lli -use-mcjit test.bc
Aborted</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>