Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r58869:17c0b573b0f8
Date: 2012-11-14 00:30 +0100
http://bitbucket.org/pypy/pypy/changeset/17c0b573b0f8/

Log:    Finally found why translation of the _hashlib module segfaults with
        pypy: openssl is statically linked, so init_digest() *of the shared
        library* has not been called by the host Python.

diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -39,7 +39,6 @@
 
 # Here is the list of modules known to not work yet
 for name in ["cpyext",
-             "_hashlib", "_md5",
              ]:
     del working_modules[name]
 
diff --git a/pypy/module/_hashlib/interp_hashlib.py 
b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -6,7 +6,7 @@
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi
 from pypy.rlib import rgc, ropenssl
-from pypy.rlib.objectmodel import keepalive_until_here
+from pypy.rlib.objectmodel import keepalive_until_here, we_are_translated
 from pypy.rlib.rstring import StringBuilder
 from pypy.module.thread.os_lock import Lock
 
@@ -45,6 +45,8 @@
         self.generate_method_names(space)
     
     def generate_method_names(self, space):
+        if not we_are_translated():
+            ropenssl.init_digests()
         self.w_error = None
         try:
             global_state[0] = self
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to