From 53285acbd3e480837b7544bd217767cf9dbfa530 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Fri, 4 Jul 2014 02:54:06 +0200 Subject: Stop registering a custom exception handler --- README.md | 9 +++ apps/uscxml-browser.cpp | 2 + apps/uscxml-transform.cpp | 73 ---------------------- .../datamodel/ecmascript/v8/V8DataModel.cpp | 10 +-- test/src/test-w3c.cpp | 3 + 5 files changed, 19 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index 0296163..144296b 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,15 @@ uSCXML still fails the following ecmascript tests: + + + + + + diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index 7efacf5..50b3202 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -56,6 +56,7 @@ void printBacktrace(void** array, int size) { } #ifdef HAS_DLFCN_H +#if 0 // deactivated as we use exceptions to signal errors now // see https://gist.github.com/nkuln/2020860 typedef void (*cxa_throw_type)(void *, void *, void (*) (void *)); cxa_throw_type orig_cxa_throw = 0; @@ -77,6 +78,7 @@ void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) { } #endif #endif +#endif // see http://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c diff --git a/apps/uscxml-transform.cpp b/apps/uscxml-transform.cpp index 3ee1f50..d0c3524 100644 --- a/apps/uscxml-transform.cpp +++ b/apps/uscxml-transform.cpp @@ -47,75 +47,6 @@ class VerboseMonitor : public uscxml::InterpreterMonitor { } }; -#ifdef CMAKE_BUILD_TYPE_DEBUG - -#ifdef HAS_EXECINFO_H -void printBacktrace(void** array, int size) { - char** messages = backtrace_symbols(array, size); - for (int i = 0; i < size && messages != NULL; ++i) { - std::cerr << "\t" << messages[i] << std::endl; - } - std::cerr << std::endl; - free(messages); -} - -#ifdef HAS_DLFCN_H -// see https://gist.github.com/nkuln/2020860 -typedef void (*cxa_throw_type)(void *, void *, void (*) (void *)); -cxa_throw_type orig_cxa_throw = 0; - -void load_orig_throw_code() { - orig_cxa_throw = (cxa_throw_type) dlsym(RTLD_NEXT, "__cxa_throw"); -} - -extern "C" -void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) { - std::cerr << __FUNCTION__ << " will throw exception from " << std::endl; - if (orig_cxa_throw == 0) - load_orig_throw_code(); - - void *array[50]; - size_t size = backtrace(array, 50); - printBacktrace(array, size); - orig_cxa_throw(thrown_exception, pvtinfo, dest); -} -#endif -#endif - - -// see http://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c -void customTerminate() { - static bool tried_throw = false; - - try { - // try once to re-throw currently active exception - if (!tried_throw) { - tried_throw = true; - throw; - } else { - tried_throw = false; - } - } catch (const std::exception &e) { - std::cerr << __FUNCTION__ << " caught unhandled exception. what(): " - << e.what() << std::endl; - } catch (const uscxml::Event &e) { - std::cerr << __FUNCTION__ << " caught unhandled exception. Event: " - << e << std::endl; - } catch (...) { - std::cerr << __FUNCTION__ << " caught unknown/unhandled exception." - << std::endl; - } - -#ifdef HAS_EXECINFO_H - void * array[50]; - int size = backtrace(array, 50); - - printBacktrace(array, size); -#endif - abort(); -} -#endif - void printUsageAndExit(const char* progName) { // remove path from program name std::string progStr(progName); @@ -157,10 +88,6 @@ int main(int argc, char** argv) { signal(SIGPIPE, SIG_IGN); #endif -#ifdef CMAKE_BUILD_TYPE_DEBUG - std::set_terminate(customTerminate); -#endif - // setup logging google::LogToStderr(); google::InitGoogleLogging(argv[0]); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index a995ec2..51a2167 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -618,15 +618,15 @@ void V8DataModel::assign(const Element& assignElem, throw Event("error.execution", Event::PLATFORM); if (key.compare("_sessionid") == 0) // test 322 - throw Event("error.execution", Event::PLATFORM); + ERROR_EXECUTION_THROW("Cannot assign to _sessionId"); if (key.compare("_name") == 0) - throw Event("error.execution", Event::PLATFORM); + ERROR_EXECUTION_THROW("Cannot assign to _name"); if (key.compare("_ioprocessors") == 0) // test 326 - throw Event("error.execution", Event::PLATFORM); + ERROR_EXECUTION_THROW("Cannot assign to _ioprocessors"); if (key.compare("_invokers") == 0) - throw Event("error.execution", Event::PLATFORM); + ERROR_EXECUTION_THROW("Cannot assign to _invokers"); if (key.compare("_event") == 0) - throw Event("error.execution", Event::PLATFORM); + ERROR_EXECUTION_THROW("Cannot assign to _event"); if (HAS_ATTR(assignElem, "expr")) { evalAsValue(key + " = " + ATTR(assignElem, "expr")); diff --git a/test/src/test-w3c.cpp b/test/src/test-w3c.cpp index 4d866c0..39862f4 100644 --- a/test/src/test-w3c.cpp +++ b/test/src/test-w3c.cpp @@ -39,6 +39,7 @@ void printBacktrace(void** array, int size) { } #ifdef HAS_DLFCN_H +#if 0 // deactivated as we use exceptions to signal errors now // see https://gist.github.com/nkuln/2020860 typedef void (*cxa_throw_type)(void *, void *, void (*) (void *)); cxa_throw_type orig_cxa_throw = 0; @@ -47,6 +48,7 @@ void load_orig_throw_code() { orig_cxa_throw = (cxa_throw_type) dlsym(RTLD_NEXT, "__cxa_throw"); } +#if 0 extern "C" void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) { std::cerr << __FUNCTION__ << " will throw exception from " << std::endl; @@ -60,6 +62,7 @@ void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) { } #endif #endif +#endif // see http://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c -- cgit v0.12
Test#StatusDescriptionComment
+ 326 / + 329 + Failed for v8"test that _ioprocessors stays bound till the session ends" / "test that none of the system variables can be modified"The v8 implementation will return a new _ioprocessor object for each access.
579 Failed "Before the parent state has been visited for the first time, if a transition is executed that takes the history state as its target, the SCXML processor MUST execute any executable content in the transition after the parent state's onentry content and any content in a possible initial transition."