On Thu, 2008-08-14 at 23:07 -0400, Jason Tackaberry wrote:
> issue and I've narrowed it down to this bit of code in
> clutter/__init__.py:
> 
>         # fixes weird linker bugs on nvidia
>         try:
>             import dl
>         #    sys.setdlopenflags(dl.RTLD_LAZY|dl.RTLD_GLOBAL)
>         except ImportError:
>             pass

Er, that commented call to sys.setdlopenflags() shouldn't actually be
commented. :)

See the attached patch, which seems to solve both problems: the "failed
to bind GLXGetProcAddress" error is still suppressed, and my memory
corruption problem goes way.

The idea is to restore the dl flags after importing clutter.  It may not
be the prettiest code. :)

Thanks,
Jason.
Index: __init__.py
===================================================================
--- __init__.py	(revision 3220)
+++ __init__.py	(working copy)
@@ -8,13 +8,6 @@
 
 import sys
 
-# fixes weird linker bugs on nvidia
-try:
-    import dl
-    sys.setdlopenflags(dl.RTLD_LAZY|dl.RTLD_GLOBAL)
-except ImportError:
-    pass
-
 # For broken embedded programs which forgot to call Sys_SetArgv
 if not hasattr(sys, 'argv'):
     sys.argv = []
@@ -29,7 +22,15 @@
 if 'clutter._clutter' in sys.modules:
     _clutter = sys.modules['clutter._clutter']
 else:
-    from clutter import _clutter
+    try:
+        # fixes weird linker bugs on nvidia
+        import dl
+        flags = sys.getdlopenflags()
+        sys.setdlopenflags(dl.RTLD_LAZY|dl.RTLD_GLOBAL)
+        from clutter import _clutter
+        sys.setdlopenflags(flags)
+    except ImportError:
+        from clutter import _clutter
 
 import cogl
 

Reply via email to