You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/04/13 08:19:25 UTC

svn commit: r1091663 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr/error.h include/acr/jniapi.h os/unix/init.c shared/memory.c

Author: mturk
Date: Wed Apr 13 06:19:25 2011
New Revision: 1091663

URL: http://svn.apache.org/viewvc?rev=1091663&view=rev
Log:
Completely axe SIGSEGV handling. If ever, some other mechanism will be needed

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h
    commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c
    commons/sandbox/runtime/trunk/src/main/native/shared/memory.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h?rev=1091663&r1=1091662&r2=1091663&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/error.h Wed Apr 13 06:19:25 2011
@@ -1608,7 +1608,6 @@ ACR_INLINE(DWORD) AcrNetOsError()
 #define ACR_THROW_OS_ERROR(CL)  AcrThrowException(env, (CL), ACR_GET_OS_ERROR())
 #endif
 #define ACR_THROW_MSG(CL, MS)   AcrThrow(env, (CL), MS)
-#define ACR_THROW_EXCEPTION(CL) AcrThrow(env, (CL), AcrExceptionDescription())
 
 #ifdef __cplusplus
 extern "C" {

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h?rev=1091663&r1=1091662&r2=1091663&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h Wed Apr 13 06:19:25 2011
@@ -20,18 +20,6 @@
 #include "acr/jnitypes.h"
 #include "acr/ring.h"
 
-/* Per-thread exception info
- */
-typedef struct acr_exc_t
-{
-    const char* file;
-    const char* func;
-    const char* desc;
-    int         line;
-    int         code;
-    int         init;
-} acr_exc_t;
-
 /**
  * The prototype for any ACR thread local storage destructor function.
  */
@@ -46,40 +34,11 @@ typedef struct acr_tlsd_t  {
     acr_tls_destructor_t        dtor;
 } acr_tlsd_t;
 
-#if defined(WINDOWS)
-extern ACR_THREAD acr_exc_t     acr_exception_frame;
-/* Use Microsoft Structured Exception Handling wrapper
- * The _set_se_translator is used to call the AcrExceptionHandler.
- * This requires the /EHa exception model to be used
- */
-#define __SEH_TRY                                                           \
-    acr_exception_frame.file = __FILE__;                                    \
-    acr_exception_frame.line = __LINE__;                                    \
-    acr_exception_frame.func = __REAL_FUNCSIG__;                            \
-    acr_exception_frame.desc = 0;                                           \
-    acr_exception_frame.code = 0;                                           \
-    acr_exception_frame.init = 1;                                           \
-    try
-
-#define __SEH_CATCH                                                         \
-   catch(...)
-
-#else /* HAVE_THREAD_LOCAL */
-#define __SEH_TRY
-#define __SEH_CATCH     if (0)
-#endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* Called by a signal handler */
-#if defined(WINDOWS)
-void AcrExceptionHandler(unsigned int, struct _EXCEPTION_POINTERS *);
-#endif
-const char *
-AcrExceptionDescription(void);
-
 JNIEnv *
 AcrGetJNIEnv(void);
 

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c?rev=1091663&r1=1091662&r2=1091663&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c Wed Apr 13 06:19:25 2011
@@ -145,12 +145,6 @@ AcrGetJNIEnv()
     return tlsd->env;
 }
 
-const char *
-AcrExceptionDescription()
-{
-    return 0;
-}
-
 #if defined(__GNUC__) || defined(__SUNPRO_C)
 void __attribute__ ((constructor))
 AcrLibraryAttach(void)

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/memory.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/memory.c?rev=1091663&r1=1091662&r2=1091663&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/memory.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/memory.c Wed Apr 13 06:19:25 2011
@@ -313,29 +313,12 @@ ACR_JNI_EXPORT(jlong, Memory, realloc0)(
 
 ACR_JNI_EXPORT(jint, Memory, peek0)(JNI_STDARGS, jlong a)
 {
-    jint rv = -1;
-
-    __SEH_TRY
-    {
-        rv = *(J2P(a, unsigned char *));
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
-    return rv;
+    return *(J2P(a, unsigned char *));
 }
 
 ACR_JNI_EXPORT(void, Memory, poke0)(JNI_STDARGS, jlong a, jint v)
 {
-    __SEH_TRY
-    {
-        *(J2P(a, unsigned char *)) = (unsigned char)(v & 0xFF);
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
+    *(J2P(a, unsigned char *)) = (unsigned char)(v & 0xFF);
 }
 
 ACR_JNI_EXPORT(jobject, Memory, slice0)(JNI_STDARGS,
@@ -375,16 +358,8 @@ ACR_JNI_EXPORT(jobject, Memory, dup0)(JN
         ACR_THROW(ACR_EX_ENOMEM, 0);
         return 0;
     }
-    /* Copy the original content */
-    __SEH_TRY
-    {
-        memcpy(dp, sp, ss);
-        po = AcrNewHeapPointer(env, dp, ss);
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
+    memcpy(dp, sp, ss);
+    po = AcrNewHeapPointer(env, dp, ss);
     if (po == 0) {
         /* Destroy the the memory we failed to attach
          * to the new Pointer object.
@@ -401,15 +376,7 @@ ACR_JNI_EXPORT(void, Memory, copy0)(JNI_
     char    *d = J2P(dst, char *);
     char    *s = J2P(src, char *);
 
-    /* Do a memcpy */
-    __SEH_TRY
-    {
-        memcpy(d, s, cs);
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
+    memcpy(d, s, cs);
 }
 
 ACR_JNI_EXPORT(void, Memory, move0)(JNI_STDARGS, jlong src,
@@ -419,15 +386,7 @@ ACR_JNI_EXPORT(void, Memory, move0)(JNI_
     char    *d = J2P(dst, char *);
     char    *s = J2P(src, char *);
 
-    /* Do a memmove */
-    __SEH_TRY
-    {
-        memmove(d, s, cs);
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
+    memmove(d, s, cs);
 }
 
 ACR_JNI_EXPORT(void, Memory, clear0)(JNI_STDARGS, jlong  dst, jlong size)
@@ -435,15 +394,7 @@ ACR_JNI_EXPORT(void, Memory, clear0)(JNI
     size_t  cs = (size_t)size;
     char    *d = J2P(dst, char *);
 
-    /* Do a memset */
-    __SEH_TRY
-    {
-        memset(d, 0, cs);
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
+    memset(d, 0, cs);
 }
 
 ACR_JNI_EXPORT(void, Memory, cleanse0)(JNI_STDARGS, jlong  dst, jlong size)
@@ -452,14 +403,7 @@ ACR_JNI_EXPORT(void, Memory, cleanse0)(J
     char    *d = J2P(dst, char *);
 
     /* Do a memset */
-    __SEH_TRY
-    {
-        AcrMemCleanse(d, cs);
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
+    AcrMemCleanse(d, cs);
 }
 
 ACR_JNI_EXPORT(void, Memory, set0)(JNI_STDARGS, jlong dst,
@@ -468,15 +412,7 @@ ACR_JNI_EXPORT(void, Memory, set0)(JNI_S
     size_t  cs = (size_t)size;
     char    *d = J2P(dst, char *);
 
-    /* Do a memset */
-    __SEH_TRY
-    {
-        memset(d, c, cs);
-    }
-    __SEH_CATCH
-    {
-        ACR_THROW_EXCEPTION(ACR_EX_ERUNTIME);
-    }
+    memset(d, c, cs);
 }
 
 #define TO_SCALAR_ARRAY(Type, Name)   \