santoshn / softboundcets-34

SoftBoundCETS for LLVM+Clang version 34
BSD 3-Clause "New" or "Revised" License
56 stars 17 forks source link

C++ Exceptions #7

Open edmcman opened 8 years ago

edmcman commented 8 years ago

It seems like any code containing C++ exceptions will cause a compilation error.

class MyException
{
 public:
  MyException() { }
  ~MyException() { }
};

void my_throwing_function(bool throwit)
{
  if (throwit)
    throw MyException();
}

void another_function();
void log(unsigned count);

void my_catching_function()
{
  log(0);
    try
      {
        log(1);
        another_function();
        log(2);
      }
    catch (const MyException& e)
      {
        log(3);
      }
    log(4);
}
fuzz@ubufuzz64:~/exception$ /data/softboundcets-34/softboundcets-llvm-clang34/Debug+Asserts/bin/clang++ -O0 -fsoftboundcets -fno-vectorize -c test.cpp
clang: SoftBoundCETS.cpp:4167: void SoftBoundCETSPass::handleExtractValue(llvm::ExtractValueInst*): Assertion `0 && "ExtractValue is returning a pointer, possibly some vectorization going on, not handled, try run
ning with O0 or O1 or O2"' failed.
0  clang           0x00000000033d0ac7 llvm::sys::PrintStackTrace(_IO_FILE*) + 38
1  clang           0x00000000033d0d4e
2  clang           0x00000000033d0792
3  libpthread.so.0 0x00007ffff7bcccb0
4  libc.so.6       0x00007ffff6e110d5 gsignal + 53
5  libc.so.6       0x00007ffff6e1483b abort + 379
6  libc.so.6       0x00007ffff6e09d9e
7  libc.so.6       0x00007ffff6e09e42
8  clang           0x000000000220473b SoftBoundCETSPass::handleExtractValue(llvm::ExtractValueInst*) + 79
9  clang           0x0000000002206275 SoftBoundCETSPass::gatherBaseBoundPass1(llvm::Function*) + 2587
10 clang           0x0000000002208430 SoftBoundCETSPass::runOnModule(llvm::Module&) + 952
11 clang           0x0000000003348817
santoshn commented 8 years ago

softboundcets does not handle C++ code yet.

edmcman commented 8 years ago

Good to know! Luckily the C++ code that was failing was a C++ interface that was not actually related to the code I was testing.

OleksiiOleksenko commented 8 years ago

Hi,

softboundcets does not handle C++ code yet

is this still valid?

Thanks