Ошибка в коде с обработкой исключений в Mac-версии VMP v.3
Posted: Tue Dec 01, 2015 9:25 am
Мы хотим купить последнюю версию VmProtect v3, но при просмотре версии v.3.0.6 build 537 Demo мы столкнулись с ошибкой.
В проблемном куске кода(см.ниже) приведены тестовые ситуации, которые мы попробовали. Вместо ожидаемых результатов в catch-блоках мы получаем ошибку 'Illegal instruction'.
Информация о OS X:
В проблемном куске кода(см.ниже) приведены тестовые ситуации, которые мы попробовали. Вместо ожидаемых результатов в catch-блоках мы получаем ошибку 'Illegal instruction'.
Code: Select all
#include <stdio.h>
#include "VMProtectSDK.h"
#include <exception>
#pragma GCC push_optimize
#pragma GCC optimize("O0")
void testFunction( int n )
{
// trying to write complex code to avoid inlining
for( int i = 0; i < n; ++i )
{
if( i < 1000 )
{
throw 1;
}
i = ( ++i ^ 15 ) * 42;
}
}
int main( int argc, char** argv )
{
printf( "Test started\n" );
try
{
VMProtectBeginVirtualization( "" );
testFunction( argc );
//throw 1;
//throw std::exception();
VMProtectEnd();
}
catch( int )
{
printf( "OK - catch( int ) exception correctly!\n" );
}
catch( const std::exception& )
{
printf( "OK - catch( std::exception ) exception correctly!\n" );
}
printf( "Test finished\n" );
return 0;
}
#pragma GCC pop_optimize
и GCC:Darwin Tests-Mac.local 15.0.0 Darwin Kernel Version 15.0.0: Wed Aug 26 16:57:32 PDT 2015; root:xnu-3247.1.106~1/RELEASE_X86_64 x86_64
vmp-файл:Using built-in specs.
COLLECT_GCC=/usr/local/Cellar/gcc49/4.9.3/bin/gcc-4.9
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc49/4.9.3/libexec/gcc/x86_64-apple-darwin15.0.0/4.9.3/lto-wrapper
Target: x86_64-apple-darwin15.0.0
Configured with: ../configure --build=x86_64-apple-darwin15.0.0 --prefix=/usr/local/Cellar/gcc49/4.9.3 --libdir=/usr/local/Cellar/gcc49/4.9.3/lib/gcc/4.9 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.9 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --with-build-config=bootstrap-debug --disable-werror --with-pkgversion='Homebrew gcc49 4.9.3' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.9.3 (Homebrew gcc49 4.9.3)
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<Protection
InputFileName="a4.out"
Options="0"
CheckKernelModeDebugger="false"
CompressionMode="0"
VMCodeSectionName=".vmp"
VMExecutorCount="1"
OutputFileName=""
>
<Messages
/>
<Folders
/>
<Procedures
/>
</Protection>
<Script
/>
</Document>