Run the following code in the custom invocation tab with pypy3.6
import random
print('Hello world!')
This gives the following verdict:
Runtime error: exit code is 13131313
=====
Used: 373 ms, 10900 KB
Any ideas why? This also happens with pypy2.7, but not when using the CPython interpreters.
This has been an issue on codeforces for a long time. Know I messaged mike about this issue 7 months ago. For as long as I've been on codeforces, importing random on PyPy3 has never worked. Importing random on PyPy2 used to work, but the last update also broke PyPy2.
I've done some testing and I found that the issue comes from random importing the module hashlib which in turn imports the built in module _hashlib which causes the RTE. Since _hashlib is built in (not python code) I haven't been able to exactly pin point what causes the RTE. I have however come up with a work around.
Random only imports hashlib for one reason, and that is to allow random.seed to take in a string. So if you just don't care about seeding with strings, you could just make PyPy think that hashlib has already been imported, which avoids the crash.
It was an interesting issue to debug way back then. It's good that a simple workaround exists, but actually fixing the issue would be better.
I'll fix it in 2-3 days.
It turns out that in recent versions
_hashlib
is not builtin anymore. So digging deeper you find that importing_cffi_ssl._stdssl.utility
is what causes the crash.What's really interesting is that including the module from file manually like
makes everything work. Not sure why this is, but I think this gets to the bottom of the issue.