Commits

Amaury Forgeot d'Arc committed 17c0b57

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.

Comments (0)

Files changed (2)

pypy/config/pypyoption.py

 
 # Here is the list of modules known to not work yet
 for name in ["cpyext",
-             "_hashlib", "_md5",
              ]:
     del working_modules[name]
 

pypy/module/_hashlib/interp_hashlib.py

 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
 
         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