[pypy-dev] Generating pypy-cli and pypy-jvm fails under Win32

Dmitry Jemerov intelliyole at gmail.com
Sat Jun 6 10:19:32 CEST 2009


Hello everyone,

I'm trying to get my head around PyPy (hoping maybe to participate in the
PyPy sprint at EuroPython), and following the getting-started guide on the
Web site. Translating pypy with the C backend worked with no problems on my
machine, but neither the JVM nor CLI backends work. (I tried both the
pypy-dist version and the SVN trunk.)

The stacktrace for the error is:
 Traceback (most recent call last):
   File "translate.py", line 273, in main
    drv.proceed(goals)
   File "C:\Src\pypy\pypy\translator\driver.py", line 704, in proceed
    return self._execute(goals, task_skip = self._maybe_skip())
   File "C:\Src\pypy\pypy\translator\tool\taskengine.py", line 116, in
_execute
    res = self._do(goal, taskcallable, *args, **kwds)
   File "C:\Src\pypy\pypy\translator\driver.py", line 267, in _do
    res = func()
   File "C:\Src\pypy\pypy\translator\driver.py", line 395, in
task_backendopt_ootype
    backend_optimizations(self.translator)
   File "C:\Src\pypy\pypy\translator\backendopt\all.py", line 80, in
backend_optimizations
    inline_heuristic=heuristic)
   File "C:\Src\pypy\pypy\translator\backendopt\all.py", line 156, in
inline_malloc_removal_phase
    call_count_pred=call_count_pred)
   File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 779, in
auto_inline_graphs
    call_count_pred=call_count_pred)
   File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 750, in
auto_inlining
    call_count_pred, cleanup=False)
   File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 108, in
inline_function
    return inliner.inline_all()
   File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 217, in
inline_all
    self.inline_once(block, index_operation)
   File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 244, in
inline_once
    self.translator, self.raise_analyzer):
   File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 160, in
any_call_to_raising_graphs
    if does_raise_directly(graph_or_something, raise_analyzer):
   File "C:\Src\pypy\pypy\translator\backendopt\inline.py", line 153, in
does_raise_directly
    if raise_analyzer.can_raise(op):
   File "C:\Src\pypy\pypy\translator\backendopt\canraise.py", line 33, in
can_raise
    return self.analyze(op, seen)
   File "C:\Src\pypy\pypy\translator\backendopt\graphanalyze.py", line 38,
in analyze
    return self.analyze_external_call(op)
   File "C:\Src\pypy\pypy\translator\backendopt\canraise.py", line 21, in
analyze_external_call
    fnobj = deref(op.args[0].value)
   File "C:\Src\pypy\pypy\rpython\typesystem.py", line 153, in deref
    assert isinstance(ootype.typeOf(obj), ootype.OOType)
 AssertionError

When I evaluate 'obj' with the pdb, I get:
(Pdb+) p obj
<* fn CryptGenRandom>

As far as I understand, the problem happens because the 'posix' module under
Win32 implements 'urandom' by calling the native CryptGetRandom function
through rffi, but there is no mapping for this call under the JVM and CLI
backends.

What would be the proper way to fix this problem? (Or maybe I'm doing
something that's not supposed to work at all at this stage of the project?)

(Looks like my question should be at least partly answered by the "OO
backends" section of the document at
http://codespeak.net/pypy/dist/pypy/doc/rffi.html but unfortunately all it
says is "XXX to be written".)

Thanks in advance for your help!

Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20090606/05926b53/attachment.html>


More information about the Pypy-dev mailing list