Browse Source

[master] workaround for OSX clang problem

reviewed on jabber
Jelte Jansen 14 years ago
parent
commit
bb22c63e7b
1 changed files with 14 additions and 3 deletions
  1. 14 3
      src/lib/python/isc/log/log.cc

+ 14 - 3
src/lib/python/isc/log/log.cc

@@ -29,6 +29,20 @@ using namespace isc::log;
 using std::string;
 using boost::bind;
 
+// We encountered a strange problem with Clang (clang version 2.8
+// (tags/RELEASE_28 115909)) on OSX, where unwinding the stack
+// segfaults the moment this exception was thrown and caught.
+//
+// Placing it in a named namespace instead of the original
+// unnamed namespace appears to solve this, so as a temporary
+// workaround, we create a local randomly named namespace here
+// to solve this issue.
+namespace clang_unnamed_namespace_workaround {
+    // To propagate python exceptions trough our code
+    class InternalError {};
+}
+using namespace clang_unnamed_namespace_workaround;
+
 namespace {
 
 // This is for testing only. The real module will have it always set as
@@ -361,9 +375,6 @@ Logger_isDebugEnabled(LoggerWrapper* self, PyObject* args) {
     }
 }
 
-// To propagate python exceptions trough our code
-class InternalError {};
-
 string
 objectToStr(PyObject* object, bool convert) {
     PyObject* cleanup(NULL);