[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-dev
Subject:    [pypy-dev] "compilemodule.py _demo" fails
From:       Elmo Mäntynen <elmo13 () jippii ! fi>
Date:       2006-05-07 18:20:53
Message-ID: 445E3A85.1070503 () jippii ! fi
[Download RAW message or body]

Attached is the output of "py.test <appropriate tests>". Apart from
that, I'm interested if the few warnings are just irrelevant and will go
away eventually, or are they related.

Thanks for your great effort, I can't wait till you get the app-level
side of this working.

Elmo

["test_compilemodule_out.txt" (text/plain)]

============================= test process starts =============================
testing-mode: inprocess
executable:   /usr/bin/python  (2.3.5-final-0)
using py lib: /home/drayko/Workfolder/Security/Python/cvs/pypy-dist/py <rev 26945>

pypy/rpython/rctypes/tool/test/test_compilemodule.py[1] F
pypy/rpython/rctypes/tool/test/test_ctypes_platform.py[7] .......

_______________________________________________________________________________
- - - - - - - - - - - -  test_demo: recorded stdout - - - - - - - - - - - - -
(pypy.rpython.rctypes.tool.compilemodule:27)__init__: SomeObject -> const SomePBC
(?:1)trampoline: SomeObject, SomeObject -> SomeObject
(?:1)trampoline: SomeObject, SomeObject -> SomeObject
- - - - - - - - - - - -  test_demo: recorded stderr - - - - - - - - - - - - -
[cbuild:execute] cc -O2 -pthread -I/usr/include/python2.3 -c ctypesplatcheck_0.c -o \
ctypesplatcheck_0.o [cbuild:execute] cc -pthread /tmp/usession-6/ctypesplatcheck_0.o \
-lm -lpthread -o /tmp/usession-6/ctypesplatcheck_0 [cbuild:execute] cc -O2 -pthread \
-c ctypesplatcheck_1.c -o ctypesplatcheck_1.o [cbuild:execute] cc -pthread \
/tmp/usession-6/ctypesplatcheck_1.o -lm -lpthread -o \
/tmp/usession-6/ctypesplatcheck_1 [translation:info] Annotating&simplifying...
[translation:info] with policy: pypy.objspace.cpy.ann_policy.CPyAnnotatorPolicy
[flowgraph:start] (pypy.rpython.rctypes.tool.compilemodule:27)__init__
[flowgraph:done] __init__
[flowgraph:start] (pypy.objspace.cpy.objspace:33)wrap
/usr/lib/python2.3/site-packages/ctypes/__init__.py:305: FutureWarning: %u/%o/%x/%X \
of negative int will return a signed string in Python 2.4 and up  return "<%s '%s', \
handle %x at %x>" % \ [flowgraph:done] wrap
[flowgraph:start] (pypy.objspace.cpy.wrappable:53)reraise
[flowgraph:done] reraise
[annrpython] <FunctionGraph of (pypy.objspace.cpy.objspace:33)wrap__str at \
0xb75495cc> -> SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') \
[flowgraph:start] (pypy.interpreter.baseobjspace:551)call_method [flowgraph:done] \
call_method [flowgraph:start] (pypy.objspace.cpy.objspace:79)call_function
[flowgraph:done] call_function
[annrpython] <FunctionGraph of (pypy.objspace.cpy.objspace:79)call_function_star0 at \
0xb756cf0c> -> SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') \
[annrpython] <FunctionGraph of (pypy.interpreter.baseobjspace:551)call_method_star0 \
at 0xb757094c> -> SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') \
[flowgraph:start] (pypy.interpreter.baseobjspace:551)call_method [flowgraph:done] \
call_method [flowgraph:start] (pypy.objspace.cpy.objspace:79)call_function
[flowgraph:done] call_function
[annrpython] <FunctionGraph of (pypy.objspace.cpy.objspace:79)call_function_star1 at \
0xb7571b8c> -> SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') \
[annrpython] <FunctionGraph of (pypy.interpreter.baseobjspace:551)call_method_star1 \
at 0xb75707ac> -> SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') \
[annrpython] <FunctionGraph of (pypy.rpython.rctypes.tool.compilemodule:27)__init__ \
at 0xb761f50c> -> SomePBC(can_be_None=True, const=None) [flowgraph:start] \
(?:1)trampoline [flowgraph:done] trampoline
[flowgraph:start] (?:1)trampoline
[flowgraph:done] trampoline
[flowgraph:start] (pypy.objspace.cpy.ctypes_base:29)rctypes_pyerrchecker
[flowgraph:done] rctypes_pyerrchecker
[annrpython] <FunctionGraph of (pypy.objspace.cpy.ctypes_base:29)rctypes_pyerrchecker \
at 0xb74ff86c> -> SomePBC(can_be_None=True, const=None) [flowgraph:start] \
(pypy.module._demo.demo:39)measuretime [flowgraph:done] measuretime
[flowgraph:start] (pypy.interpreter.error:18)OperationError.__init__
[flowgraph:done] __init__
[flowgraph:start] (pypy.module._demo.demo:34)get
[flowgraph:done] get
[annrpython] <FunctionGraph of \
(pypy.interpreter.error:18)OperationError.OperationError.__init__ at 0xb750e60c> -> \
SomePBC(can_be_None=True, const=None) [flowgraph:start] \
(pypy.objspace.cpy.objspace:30)getbuiltinmodule [flowgraph:done] getbuiltinmodule
[annrpython] <FunctionGraph of (pypy.objspace.cpy.objspace:30)getbuiltinmodule at \
0xb751b82c> -> SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') \
[flowgraph:start] (pypy.objspace.cpy.objspace:33)wrap [flowgraph:done] wrap
[flowgraph:start] (pypy.objspace.cpy.refcount:27)Py_XIncref
[flowgraph:done] Py_XIncref
[annrpython] <FunctionGraph of (pypy.module._demo.demo:34)get at 0xb751360c> -> \
SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') [annrpython] \
<FunctionGraph of (pypy.objspace.cpy.refcount:27)Py_XIncref at 0xb75068ec> -> \
SomePBC(can_be_None=True, const=None) [annrpython] <FunctionGraph of \
(pypy.objspace.cpy.wrappable:53)reraise at 0xb756978c> -> SomePBC(can_be_None=True, \
const=None) [annrpython] <FunctionGraph of (pypy.objspace.cpy.objspace:33)wrap__int \
at 0xb751f26c> -> SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') \
[annrpython] <FunctionGraph of (?:1)trampoline at 0xb755f0cc> -> SomeObject() \
[annrpython:WARNING] <FunctionGraph of (?:1)trampoline at 0xb755f0cc>/ result \
degenerated to SomeObject [annrpython] <FunctionGraph of (?:1)trampoline at \
0xb74fc6ec> -> SomeObject() [annrpython:WARNING] <FunctionGraph of (?:1)trampoline at \
0xb74fc6ec>/ result degenerated to SomeObject [annrpython] <FunctionGraph of \
(pypy.module._demo.demo:39)measuretime at 0xb7504acc> -> \
SomeCTypesObject(knowntype=W_Object, memorystate='OWNSMEMORY') [translation:info] All \
exceptblocks seem sane [translation:info] No lost method defs
[translation:WARNING] -- someobjectness 18% (3 of 16 functions polluted by \
SomeObjects) [translation:info] RTyping...
[flowgraph:start] (pypy.rpython.lltypesystem.rclass:803)ll_runtime_type_info
[flowgraph:done] ll_runtime_type_info
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rclass:803)ll_runtime_type_info__objectPtr at 0xb7402d8c> \
-> SomePtr(ll_ptrtype=<* RuntimeTypeInfo (opaque)>) [flowgraph:start] \
(pypy.rpython.lltypesystem.rrange:42)ll_newrange [flowgraph:done] ll_newrange
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rrange:42)ll_newrange__Signed_Signed at 0xb741b56c> -> \
SomePtr(ll_ptrtype=<* GcStruct range { start: Signed, stop: Signed }>) \
[flowgraph:start] (pypy.rpython.lltypesystem.rrange:64)ll_rangeiter [flowgraph:done] \
ll_rangeiter [annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rrange:64)ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr at \
0xb741efcc> -> SomePtr(ll_ptrtype=<* GcStruct range { next: Signed, stop: Signed }>) \
[flowgraph:start] (pypy.rpython.lltypesystem.rlist:327)ll_fixed_newlist \
[flowgraph:done] ll_fixed_newlist [annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:327)ll_fixed_newlist__GcArray_Ptr_GcStruct_rpy_strin_Signed \
at 0xb74300ec> -> SomePtr(ll_ptrtype=<* GcArray of * GcStruct rpy_string { hash: \
Signed, chars: Array of Char  } >) [flowgraph:start] \
(pypy.rpython.rlist:518)ll_setitem_nonneg [flowgraph:done] ll_setitem_nonneg
[flowgraph:start] (pypy.rpython.lltypesystem.rlist:342)ll_fixed_setitem_fast
[flowgraph:done] ll_fixed_setitem_fast
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:342)ll_fixed_setitem_fast__arrayPtr_Signed_rpy_stringPtr \
at 0xb73b6a0c> -> SomePBC(can_be_None=True, const=None) [annrpython] <FunctionGraph \
of (pypy.rpython.rlist:518)ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_rpy_stringPtr \
at 0xb74335ac> -> SomePBC(can_be_None=True, const=None) [flowgraph:start] \
(pypy.rpython.lltypesystem.rlist:370)ll_listiter [flowgraph:done] ll_listiter
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:370)ll_listiter__Ptr_GcStruct_listiterLlT_arrayPtr \
at 0xb73bacac> -> SomePtr(ll_ptrtype=<* GcStruct listiter { list: * GcArray of * \
GcStruct rpy_string { hash: Signed, chars: Array of Char  } , index: Signed }>) \
[flowgraph:start] (pypy.rpython.lltypesystem.rlist:327)ll_fixed_newlist \
[flowgraph:done] ll_fixed_newlist [annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:327)ll_fixed_newlist__GcArray_VoidLlT_Signed at \
0xb73c180c> -> SomePtr(ll_ptrtype=<* GcArray of Void >) [flowgraph:start] \
(pypy.rpython.rlist:518)ll_setitem_nonneg [flowgraph:done] ll_setitem_nonneg
[flowgraph:start] (pypy.rpython.lltypesystem.rlist:342)ll_fixed_setitem_fast
[flowgraph:done] ll_fixed_setitem_fast
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:342)ll_fixed_setitem_fast__arrayPtr_Signed_NoneConst \
at 0xb73caf4c> -> SomePBC(can_be_None=True, const=None) [annrpython] <FunctionGraph \
of (pypy.rpython.rlist:518)ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_NoneConst \
at 0xb73c7aac> -> SomePBC(can_be_None=True, const=None) [flowgraph:start] \
(pypy.rpython.rrange:158)ll_rangenext_up [flowgraph:done] ll_rangenext_up
[annrpython] <FunctionGraph of \
(pypy.rpython.rrange:158)ll_rangenext_up__rangePtr_Signed at 0xb73cabac> -> \
SomeInteger(knowntype=int, nonneg=False, unsigned=False) [flowgraph:start] \
(pypy.rpython.rstr:635)ll_strlen [flowgraph:done] ll_strlen
[annrpython] <FunctionGraph of (pypy.rpython.rstr:635)ll_strlen__rpy_stringPtr at \
0xb73ba2ec> -> SomeInteger(knowntype=int, nonneg=True, unsigned=False) \
[flowgraph:start] (pypy.rpython.rctypes.rchar_p:142)ll_setstring [flowgraph:done] \
ll_setstring [annrpython] <FunctionGraph of \
(pypy.rpython.rctypes.rchar_p:142)ll_setstring__CtypesBox_c_char_pPtr_rpy_stringPtr \
at 0xb7430d6c> -> SomePBC(can_be_None=True, const=None) [flowgraph:start] \
(pypy.rpython.rctypes.rchar_p:114)ll_str2charp [flowgraph:done] ll_str2charp
[annrpython] <FunctionGraph of \
(pypy.rpython.rctypes.rchar_p:114)ll_str2charp__rpy_stringPtr at 0xb7402f6c> -> \
SomePtr(ll_ptrtype=<* FixedSizeArray of 1 Char >) [flowgraph:start] \
(pypy.rpython.lltypesystem.rlist:376)ll_listnext [flowgraph:done] ll_listnext
[flowgraph:start] (pypy.rpython.lltypesystem.rlist:333)ll_fixed_length
[flowgraph:done] ll_fixed_length
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:333)ll_fixed_length__arrayPtr at 0xb73eb6cc> -> \
SomeInteger(knowntype=int, nonneg=True, unsigned=False) [flowgraph:start] \
(pypy.rpython.lltypesystem.rlist:339)ll_fixed_getitem_fast [flowgraph:done] \
ll_fixed_getitem_fast [annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:339)ll_fixed_getitem_fast__arrayPtr_Signed at \
0xb73edf6c> -> SomePtr(ll_ptrtype=<* GcStruct rpy_string { hash: Signed, chars: Array \
of Char  }>) [annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rlist:376)ll_listnext__listiterPtr at 0xb73b53ec> -> \
SomePtr(ll_ptrtype=<* GcStruct rpy_string { hash: Signed, chars: Array of Char  }>) \
[flowgraph:start] (pypy.rpython.rctypes.rpyobject:42)ll_pyobjbox_is_true \
[flowgraph:done] ll_pyobjbox_is_true [annrpython] <FunctionGraph of \
(pypy.rpython.rctypes.rpyobject:42)ll_pyobjbox_is_true__CtypesBox_W_ObjectPtr at \
0xb7377d2c> -> SomeBool() [rtyper] specializing: 100 / 130 blocks   (76%)
[flowgraph:start] (pypy.rpython.lltypesystem.rclass:779)ll_issubclass
[flowgraph:done] ll_issubclass
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rclass:779)ll_issubclass__object_vtablePtr_object_vtablePtr \
at 0xb737daec> -> SomeBool() [flowgraph:start] \
(pypy.rpython.lltypesystem.rclass:776)ll_type [flowgraph:done] ll_type
[annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.rclass:776)ll_type__objectPtr at 0xb73848ec> -> \
SomePtr(ll_ptrtype=<* Struct object_vtable { parenttypeptr: * Struct object_vtable { \
... }, subclassrange_min: Signed, subclassrange_max: Signed, rtti: * RuntimeTypeInfo \
(opaque), name: * Array of Char , instantiate: * Func (  ) -> * GcStruct object { \
typeptr: * Struct object_vtable { ... } } }>) [flowgraph:start] \
(pypy.rpython.lltypesystem.exceptiondata:108)ll_pyexcclass2exc [flowgraph:done] \
ll_pyexcclass2exc [annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.exceptiondata:108)ll_pyexcclass2exc__PyObjectPtr at \
0xb738dcac> -> SomePtr(ll_ptrtype=<* GcStruct object { typeptr: * Struct \
object_vtable { parenttypeptr: * Struct object_vtable { ... }, subclassrange_min: \
Signed, subclassrange_max: Signed, rtti: * RuntimeTypeInfo (opaque), name: * Array of \
Char , instantiate: * Func (  ) -> * GcStruct object { ... } } }>) [flowgraph:start] \
(pypy.rpython.lltypesystem.exceptiondata:31)ll_raise_OSError [flowgraph:done] \
ll_raise_OSError [annrpython] <FunctionGraph of \
(pypy.rpython.lltypesystem.exceptiondata:31)ll_raise_OSError__Signed at 0xb73a3b2c> \
-> SomeImpossibleValue() [translation:info] Back-end optimisations...
[backendopt:removecasts] removed 2 cast_pointers in rctypes_pyerrchecker
[backendopt:removecasts] removed 2 cast_pointers in measuretime
[backendopt:removecasts] removed 4 cast_pointers in OperationError.__init__
[backendopt:removecasts] removed 2 cast_pointers in ll_rangenext_up__rangePtr_Signed
[backendopt:removecasts] removed 2 cast_pointers in ll_listnext__listiterPtr
[backendopt:removecasts] removed 2 cast_pointers in ll_raise_OSError__Signed
[backendopt:inlining]    2.00 ll_fixed_setitem_fast__arrayPtr_Signed_rpy_stringPtr
[backendopt:inlining]    2.00           ll_fixed_newlist__GcArray_VoidLlT_Signed
[backendopt:inlining]    2.00   ll_fixed_setitem_fast__arrayPtr_Signed_NoneConst
[backendopt:inlining]    2.00                          ll_fixed_length__arrayPtr
[backendopt:inlining]    2.00             ll_fixed_getitem_fast__arrayPtr_Signed
[backendopt:inlining]    2.00 ll_fixed_newlist__GcArray_Ptr_GcStruct_rpy_strin_Signed
[backendopt:inlining]    4.00                           ll_strlen__rpy_stringPtr
[backendopt:inlining]    4.00                        ll_str2charp__rpy_stringPtr
[backendopt:inlining]    8.00     ll_listiter__Ptr_GcStruct_listiterLlT_arrayPtr
[backendopt:inlining]    8.00                         ll_newrange__Signed_Signed
[backendopt:inlining]    8.50         ll_pyobjbox_is_true__CtypesBox_W_ObjectPtr
[backendopt:inlining]    2.00 \
ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_rpy_stringPtr \
[backendopt:inlining]   12.00       ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr \
[backendopt:inlining]   17.00                   ll_rangenext_up__rangePtr_Signed \
[backendopt:inlining]   15.00  ll_setstring__CtypesBox_c_char_pPtr_rpy_stringPtr \
[backendopt:inlining]   24.00                                   getbuiltinmodule \
[backendopt:inlining]   24.10                                         Py_XIncref \
[backendopt:inlining]   28.00                                call_function_star0 \
[backendopt:inlining]   24.50                            OperationError.__init__ \
[backendopt:inlining]   20.50                           ll_listnext__listiterPtr \
[backendopt:malloc] 12 simple mallocs removed in '__init__' [backendopt:malloc] 2 \
simple mallocs removed in '__init__' [backendopt:malloc] 2 simple mallocs removed in \
'wrap__str' [backendopt:malloc] 2 simple mallocs removed in 'wrap__str'
[backendopt:malloc] 1 simple mallocs removed in 'wrap__str'
[backendopt:malloc] 6 simple mallocs removed in 'reraise'
[backendopt:malloc] 3 simple mallocs removed in 'call_method_star0'
[backendopt:malloc] 2 simple mallocs removed in 'call_method_star1'
[backendopt:malloc] 1 simple mallocs removed in 'trampoline'
[backendopt:malloc] 1 simple mallocs removed in 'trampoline'
[backendopt:malloc] 1 simple mallocs removed in 'trampoline'
[backendopt:malloc] 1 simple mallocs removed in 'trampoline'
[backendopt:malloc] 6 simple mallocs removed in 'rctypes_pyerrchecker'
[backendopt:malloc] 3 simple mallocs removed in 'rctypes_pyerrchecker'
[backendopt:malloc] 3 simple mallocs removed in 'rctypes_pyerrchecker'
[backendopt:malloc] 4 simple mallocs removed in 'measuretime'
[backendopt:malloc] 2 simple mallocs removed in 'get'
[backendopt:malloc] 1 simple mallocs removed in 'get'
[backendopt:malloc] 1 simple mallocs removed in 'wrap__int'
[backendopt:malloc] 1 simple mallocs removed in 'wrap__int'
[backendopt:malloc] 1 simple mallocs removed in 'Py_XIncref'
[backendopt:malloc] removed 56 simple mallocs in total
[translation:info] inserting stack checks...
[flowgraph:start] (pypy.rpython.module.ll_stack:11)ll_stack_check
[flowgraph:done] ll_stack_check
[flowgraph:start] (pypy.rpython.module.ll_stack:3)ll_stack_too_big
[flowgraph:done] ll_stack_too_big
[annrpython] <FunctionGraph of (pypy.rpython.module.ll_stack:3)ll_stack_too_big___ at \
0xb750d60c> -> SomeBool() [annrpython] <FunctionGraph of \
(pypy.rpython.module.ll_stack:11)ll_stack_check___ at 0xb73a318c> -> \
SomePBC(can_be_None=True, const=None) [flowgraph:start] \
(pypy.rpython.module.ll_stack:7)ll_stack_unwind [flowgraph:done] ll_stack_unwind
[annrpython] <FunctionGraph of (pypy.rpython.module.ll_stack:7)ll_stack_unwind___ at \
0xb752630c> -> SomePBC(can_be_None=True, const=None) [translation:info] Creating \
database for generating c source... [flowgraph:start] \
(pypy.translator.c.exceptiontransform:52)rpyexc_occured [flowgraph:done] \
rpyexc_occured [flowgraph:start] \
(pypy.translator.c.exceptiontransform:55)rpyexc_fetch_type [flowgraph:done] \
rpyexc_fetch_type [flowgraph:start] \
(pypy.translator.c.exceptiontransform:58)rpyexc_fetch_value [flowgraph:done] \
rpyexc_fetch_value [flowgraph:start] \
(pypy.translator.c.exceptiontransform:61)rpyexc_clear [flowgraph:done] rpyexc_clear
[flowgraph:start] (pypy.translator.c.exceptiontransform:65)rpyexc_raise
[flowgraph:done] rpyexc_raise
[rtyper:WARNING] prebuilt instance <pypy.translator.c.exceptiontransform.ExcData \
object at 0xb7274e6c> has no attribute 'exc_type' [rtyper:WARNING] prebuilt instance \
<pypy.translator.c.exceptiontransform.ExcData object at 0xb7274e6c> has no attribute \
'exc_value' [flowgraph:start] (pypy.rpython.memory.gctransform:386)ll_incref
[flowgraph:done] ll_incref
[flowgraph:start] (pypy.rpython.memory.gctransform:390)ll_decref
[flowgraph:done] ll_decref
[flowgraph:start] (pypy.rpython.memory.gctransform:397)ll_no_pointer_dealloc
[flowgraph:done] ll_no_pointer_dealloc
[flowgraph:start] (pypy.rpython.memory.gctransform:569)ll_dealloc
[flowgraph:done] ll_dealloc
[flowgraph:start] (pypy.translator.c.extfunc:94)RPyString_New
[flowgraph:done] RPyString_New
[annrpython] <FunctionGraph of (pypy.translator.c.extfunc:94)RPyString_New__Signed at \
0xb721f24c> -> SomePtr(ll_ptrtype=<* GcStruct rpy_string { hash: Signed, chars: Array \
of Char  }>) [flowgraph:start] (?:1)ll_deallocator
[flowgraph:done] ll_deallocator
[flowgraph:start] (?:1)ll_deallocator
[flowgraph:done] ll_deallocator
[flowgraph:start] (?:1)ll_deallocator
[flowgraph:done] ll_deallocator
[flowgraph:start] (?:1)ll_deallocator
[flowgraph:done] ll_deallocator
____________________________ entrypoint: test_demo ____________________________

    def test_demo():
> mod = compilemodule('_demo')

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/rpython/rctypes/tool/test/test_compilemodule.py:5]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def compilemodule(modname):
        "Compile a PyPy module for CPython."
        import pypy.rpython.rctypes.implementation
        from pypy.objspace.cpy.objspace import CPyObjSpace
        from pypy.objspace.cpy.wrappable import reraise
        from pypy.objspace.cpy.ann_policy import CPyAnnotatorPolicy
        from pypy.translator.driver import TranslationDriver
        from pypy.interpreter.error import OperationError
    
        space = CPyObjSpace()
        ModuleClass = __import__('pypy.module.%s' % modname,
                                 None, None, ['Module']).Module
        module = ModuleClass(space, space.wrap(modname))
        w_moduledict = module.getdict()
    
        def __init__(mod):
            w_mod = CPyObjSpace.W_Object(mod)
            try:
    ##          space.appexec([w_mod, w_moduledict],
    ##            '''(mod, newdict):
    ##                   old = mod.__dict__.copy()
    ##                   for key in ['__name__', '__doc__', 'RPythonError']:
    ##                       newdict[key] = old[key]
    ##                   newdict['__rpython__'] = old
    ##                   mod.__dict__.clear()
    ##                   mod.__dict__.update(newdict)
    ##            ''')
                # the same at interp-level:
                w_moddict = space.getattr(w_mod, space.wrap('__dict__'))
                w_old = space.call_method(w_moddict, 'copy')
                space.call_method(w_moddict, 'clear')
                space.setitem(w_moddict, space.wrap('__rpython__'), w_old)
                for key in ['__name__', '__doc__', 'RPythonError']:
                    w_key = space.wrap(key)
                    try:
                        w1 = space.getitem(w_old, w_key)
                    except OperationError:
                        pass
                    else:
                        space.setitem(w_moddict, w_key, w1)
                space.call_method(w_moddict, 'update', w_moduledict)
    
            except OperationError, e:
                reraise(e)
    
        __init__.allow_someobjects = True
    
        driver = TranslationDriver(extmod_name=modname)
        driver.setup(__init__, [object], policy=CPyAnnotatorPolicy(space))
> driver.proceed(['compile_c'])

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/rpython/rctypes/tool/compilemodule.py:61]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def proceed(self, goals):
        if not goals:
            if self.default_goal:
                goals = [self.default_goal]
            else:
                self.log.info("nothing to do")
                return
        elif isinstance(goals, str):
            goals = [goals]
        goals = self.backend_select_goals(goals)
> return self._execute(goals, task_skip = self._maybe_skip())

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/driver.py:417]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def _execute(self, goals, *args, **kwds):
        task_skip = kwds.get('task_skip', [])
        res = None
        for goal in self._plan(goals, skip=task_skip):
            taskcallable, _ = self.tasks[goal]
            self._event('pre', goal, taskcallable)
            try:
> res = self._do(goal, taskcallable, *args, **kwds)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/tool/taskengine.py:108]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def _do(self, goal, func, *args, **kwds):
        title = func.task_title
        if goal in self.done:
            self.log.info("already done: %s" % title)
            return
        else:
            self.log.info("%s..." % title)
> res = func()

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/driver.py:143]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def task_database_c(self):
        translator = self.translator
        opt = self.options
        if translator.annotator is not None:
            translator.frozen = True
    
        standalone = self.standalone
        gcpolicy = None
        if opt.gc =='boehm':
            from pypy.translator.c import gc
            gcpolicy = gc.BoehmGcPolicy
        if opt.gc =='exact_boehm':
            from pypy.translator.c import gc
            gcpolicy = gc.MoreExactBoehmGcPolicy
        if opt.gc == 'none':
            from pypy.translator.c import gc
            gcpolicy = gc.NoneGcPolicy
        if opt.gc == 'framework':
            from pypy.translator.c import gc
            gcpolicy = gc.FrameworkGcPolicy
    
        if standalone:
            from pypy.translator.c.genc import CStandaloneBuilder as CBuilder
        else:
            from pypy.translator.c.genc import CExtModuleBuilder as CBuilder
        cbuilder = CBuilder(self.translator, self.entry_point,
                            gcpolicy       = gcpolicy,
                            thread_enabled = getattr(opt, 'thread', False))
        cbuilder.stackless = opt.stackless
        if not standalone:     # xxx more messy
            cbuilder.modulename = self.extmod_name
> database = cbuilder.build_database()

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/driver.py:255]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def build_database(self, exports=[], pyobj_options=None):
        translator = self.translator
        db = LowLevelDatabase(translator, standalone=self.standalone, 
                              gcpolicy=self.gcpolicy, \
thread_enabled=self.thread_enabled)  
        if self.stackless:
            from pypy.translator.c.stackless import StacklessData
            db.stacklessdata = StacklessData(db)
            db.use_stackless_transformation = self.use_stackless_transformation
    
        # pass extra options into pyobjmaker
        if pyobj_options:
            for key, value in pyobj_options.items():
                setattr(db.pyobjmaker, key, value)
    
        # we need a concrete gcpolicy to do this
        self.libraries += db.gcpolicy.gc_libraries()
    
        # give the gc a chance to register interest in the start-up functions it
        # need (we call this for its side-effects of db.get())
        list(db.gcpolicy.gc_startup_code())
    
        # build entrypoint and eventually other things to expose
        pf = self.getentrypointptr()
        pfname = db.get(pf)
        self.exports[self.entrypoint.func_name] = pf
        for obj in exports:
            if type(obj) is tuple:
                objname, obj = obj
            elif hasattr(obj, '__name__'):
                objname = obj.__name__
            else:
                objname = None
            po = self.getentrypointptr(obj)
            poname = db.get(po)
            objname = objname or poname
            if objname in self.exports:
                raise NameError, 'duplicate name in export: %s is %s and %s' % (
                    objname, db.get(self.exports[objname]), poname)
            self.exports[objname] = po
> db.complete()

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/genc.py:77]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def complete(self, show_progress=True):
        assert not self.completed
        if self.translator and self.translator.rtyper:
            do_the_getting(self, self.translator.rtyper)
        def dump():
            lst = ['%s: %d' % keyvalue
                   for keyvalue in self.containerstats.items()]
            lst.sort()
            log.event('%8d nodes  [ %s ]' % (i, '  '.join(lst)))
        i = self.completedcontainers
        if show_progress:
            show_i = (i//1000 + 1) * 1000
        else:
            show_i = -1
        work_to_do = True
        is_later_yet = False
        while work_to_do:
            while True:
                if hasattr(self, 'pyobjmaker'):
> self.pyobjmaker.collect_initcode()

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/database.py:204]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def collect_initcode(self):
        while self.latercode:
            gen, self.debugstack = self.latercode.pop()
            #self.initcode.extend(gen) -- eats TypeError! bad CPython!
> for line in gen:

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:517]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def initdict():
        for k in dic:
            if type(k) is str:
> yield '%s[%r] = %s' % (name, k, self.nameof(dic[k]))

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:474]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def nameof(self, obj, debug=None):
        if debug:
            stackentry = debug, obj
        else:
            stackentry = obj
        self.debugstack = (self.debugstack, stackentry)
        try:
> return self.getvalue(pyobjectptr(obj))

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:52]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def get(self, obj):
        if isinstance(obj, ErrorValue):
            T = obj.TYPE
            if isinstance(T, Primitive):
                return PrimitiveErrorValue[T]
            elif isinstance(T, Ptr):
                return 'NULL'
            else:
                raise Exception("don't know about %r" % (T,))
        else:
            T = typeOf(obj)
            if isinstance(T, Primitive):
                return PrimitiveName[T](obj, self)
            elif isinstance(T, Ptr):
                if obj:   # test if the ptr is non-NULL
                    if isinstance(obj._obj, int):
                        # special case for tagged odd-valued pointers
                        return '((%s) %d)' % (cdecl(self.gettype(T), ''),
                                              obj._obj)
> node = self.getcontainernode(obj._obj)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/database.py:178]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def getcontainernode(self, container):
        try:
            node = self.containernodes[container]
        except KeyError:
            assert not self.completed
            T = typeOf(container)
            if isinstance(T, (lltype.Array, lltype.Struct)):
                if hasattr(self.gctransformer, 'consider_constant'):
                    self.gctransformer.consider_constant(T, container)
            nodefactory = ContainerNodeFactory[T.__class__]
> node = nodefactory(self, T, container)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/database.py:149]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def __init__(self, db, T, obj):
        # obj is a _pyobject here; obj.value is the underlying CPython object
        self.db = db
        self.T = T
        self.obj = obj
> self.name = db.pyobjmaker.computenameof(obj.value)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/node.py:711]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def computenameof(self, obj):
        obj_builtin_base = builtin_base(obj)
        if obj_builtin_base in (object, int, long) and type(obj) is not \
obj_builtin_base:  if isinstance(obj, FunctionGraph):
                return self.nameof_graph(obj)
            # assume it's a user defined thingy
            return self.nameof_instance(obj)
        else:
            for cls in type(obj).__mro__:
                meth = getattr(self,
                               'nameof_' + cls.__name__.replace(' ', ''),
                               None)
                if meth:
                    break
            else:
                raise Exception, "nameof(%r)" % (obj,)
> return meth(obj)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:73]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def nameof_tuple(self, tup):
        name = self.uniquename('g%dtuple' % len(tup))
> args = [self.nameof(x) for x in tup]

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:449]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def nameof(self, obj, debug=None):
        if debug:
            stackentry = debug, obj
        else:
            stackentry = obj
        self.debugstack = (self.debugstack, stackentry)
        try:
> return self.getvalue(pyobjectptr(obj))

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:52]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def get(self, obj):
        if isinstance(obj, ErrorValue):
            T = obj.TYPE
            if isinstance(T, Primitive):
                return PrimitiveErrorValue[T]
            elif isinstance(T, Ptr):
                return 'NULL'
            else:
                raise Exception("don't know about %r" % (T,))
        else:
            T = typeOf(obj)
            if isinstance(T, Primitive):
                return PrimitiveName[T](obj, self)
            elif isinstance(T, Ptr):
                if obj:   # test if the ptr is non-NULL
                    if isinstance(obj._obj, int):
                        # special case for tagged odd-valued pointers
                        return '((%s) %d)' % (cdecl(self.gettype(T), ''),
                                              obj._obj)
> node = self.getcontainernode(obj._obj)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/database.py:178]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def getcontainernode(self, container):
        try:
            node = self.containernodes[container]
        except KeyError:
            assert not self.completed
            T = typeOf(container)
            if isinstance(T, (lltype.Array, lltype.Struct)):
                if hasattr(self.gctransformer, 'consider_constant'):
                    self.gctransformer.consider_constant(T, container)
            nodefactory = ContainerNodeFactory[T.__class__]
> node = nodefactory(self, T, container)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/database.py:149]
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def __init__(self, db, T, obj):
        # obj is a _pyobject here; obj.value is the underlying CPython object
        self.db = db
        self.T = T
        self.obj = obj
> self.name = db.pyobjmaker.computenameof(obj.value)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/node.py:711]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def computenameof(self, obj):
        obj_builtin_base = builtin_base(obj)
        if obj_builtin_base in (object, int, long) and type(obj) is not \
obj_builtin_base:  if isinstance(obj, FunctionGraph):
                return self.nameof_graph(obj)
            # assume it's a user defined thingy
            return self.nameof_instance(obj)
        else:
            for cls in type(obj).__mro__:
                meth = getattr(self,
                               'nameof_' + cls.__name__.replace(' ', ''),
                               None)
                if meth:
                    break
            else:
                raise Exception, "nameof(%r)" % (obj,)
> return meth(obj)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:73]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def nameof_object(self, value):
        if isinstance(object, property):
            return self.nameof_property(value)
        if type(value) is not object:
E           raise Exception, "nameof(%r)" % (value,)
> Exception: nameof(<cell at 0xb7960d94: CPyObjSpace object at 0xb764656c>)

[/home/drayko/Workfolder/Security/Python/cvs/pypy-dist/pypy/translator/c/pyobj.py:87]
============= tests finished: 7 passed, 1 failed in 12.09 seconds =============
inserting into sys.path: /home/drayko/Workfolder/Security/Python/cvs/pypy-dist



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic