Translating pypy-1.7 with -O0
Hi, I'm trying to translate pypy-1.7 with optimisations at level 0. I get the following error: # /usr/local/bin/pypy translate.py --source --gcrootfinder=shadowstack -- thread -O0 targetpypystandalone.py <snip/> [translation:ERROR] Error: [translation:ERROR] Traceback (most recent call last): [translation:ERROR] File "translate.py", line 308, in main [translation:ERROR] drv.proceed(goals) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/driver.py", line 809, in proceed [translation:ERROR] return self._execute(goals, task_skip = self._maybe_skip()) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/tool/taskengine.py", line 116, in _execute [translation:ERROR] res = self._do(goal, taskcallable, *args, **kwds) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/driver.py", line 286, in _do [translation:ERROR] res = func() [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/driver.py", line 505, in task_database_c [translation:ERROR] database = cbuilder.build_database() [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/c/genc.py", line 143, in build_database [translation:ERROR] sandbox=self.config.translation.sandbox) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/c/database.py", line 63, in __init__ [translation:ERROR] self.gctransformer = self.gcpolicy.transformerclass(translator) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/rpython/memory/gctransform/framework.py", line 151, in __init__ [translation:ERROR] GCClass, GC_PARAMS = choose_gc_from_config(translator.config) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/rpython/memory/gc/base.py", line 448, in choose_gc_from_config [translation:ERROR] config.translation.gc,)) [translation:ERROR] ValueError: unknown value for translation.gc: 'ref' Looking at base.py I see that ref and boehm GC are not in the list (and I thought -O0 used the boehm not the ref GC). I saw a previous message about this (re pypy-1.6) but no solution. Also: # file /usr/local/lib/libgc.so.1 /usr/local/lib/libgc.so.1: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, not stripped confirms I have the required library installed. Is there, perhaps, something I am missing? Regards
On Tue, Nov 22, 2011 at 9:39 PM, David Naylor <naylor.b.david@gmail.com> wrote:
Hi,
I'm trying to translate pypy-1.7 with optimisations at level 0. I get the following error:
# /usr/local/bin/pypy translate.py --source --gcrootfinder=shadowstack -- thread -O0 targetpypystandalone.py <snip/> [translation:ERROR] Error: [translation:ERROR] Traceback (most recent call last): [translation:ERROR] File "translate.py", line 308, in main [translation:ERROR] drv.proceed(goals) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/driver.py", line 809, in proceed [translation:ERROR] return self._execute(goals, task_skip = self._maybe_skip()) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/tool/taskengine.py", line 116, in _execute [translation:ERROR] res = self._do(goal, taskcallable, *args, **kwds) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/driver.py", line 286, in _do [translation:ERROR] res = func() [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/driver.py", line 505, in task_database_c [translation:ERROR] database = cbuilder.build_database() [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/c/genc.py", line 143, in build_database [translation:ERROR] sandbox=self.config.translation.sandbox) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/translator/c/database.py", line 63, in __init__ [translation:ERROR] self.gctransformer = self.gcpolicy.transformerclass(translator) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/rpython/memory/gctransform/framework.py", line 151, in __init__ [translation:ERROR] GCClass, GC_PARAMS = choose_gc_from_config(translator.config) [translation:ERROR] File "/tmp/home/DragonSA/ports/pypy/work/pypy-pypy- release-1.7/pypy/rpython/memory/gc/base.py", line 448, in choose_gc_from_config [translation:ERROR] config.translation.gc,)) [translation:ERROR] ValueError: unknown value for translation.gc: 'ref'
Looking at base.py I see that ref and boehm GC are not in the list (and I thought -O0 used the boehm not the ref GC).
I saw a previous message about this (re pypy-1.6) but no solution. Also: # file /usr/local/lib/libgc.so.1 /usr/local/lib/libgc.so.1: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, not stripped
confirms I have the required library installed.
Is there, perhaps, something I am missing?
Regards
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev
Hey First, why are you doing that? -O0 is designed to only check if stuff compiles, not to be used. Second it seems weird it tries to use refcounting. Do you have boehm installed properly? Cheers, fijal
Hi David, You are specifying conflicting options: --gcrootfinder=shadowstack does not make sense with the Boehm GC. I fixed the source to report it properly as an error, rather than getting the strange crash later. It's unclear what you are trying to build and why, so I cannot give you the fixed command line that you mean to use... A bientôt, Armin.
On Wednesday, 23 November 2011 13:23:43 you wrote:
Hi David,
Hi
You are specifying conflicting options: --gcrootfinder=shadowstack does not make sense with the Boehm GC.
Removing --gcrootfinder=shadowstack fixes the problem for me. Thanks.
I fixed the source to report it properly as an error, rather than getting the strange crash later. It's unclear what you are trying to build and why, so I cannot give you the fixed command line that you mean to use...
I am building a port of pypy for FreeBSD so I am busy testing some purmutations, such as various optimisation levels. Boehm has an extra dependency so needs specific testing and since it was easy to change the optimisation level I opted to test translate a -O0 pypy. I needed to patch an assumption about the dl library (which FreeBSD doesn't have) and the translation works. The binary, however, does not work and core dumps when started with: #0 0x00000008010debf8 in GC_FreeBSDGetDataStart () from /usr/local/lib/libgc.so.1 #1 0x00000008010dec69 in GC_register_data_segments () from /usr/local/lib/libgc.so.1 #2 0x00000008010dd815 in GC_init_inner () from /usr/local/lib/libgc.so.1 #3 0x0000000000412949 in pypy_main_function () #4 0x000000000041178e in _start () I'm happy to accept this as a bug in libgc (and ignore it). Regards
Hi David, On Wed, Nov 23, 2011 at 19:53, David Naylor <naylor.b.david@gmail.com> wrote:
The binary, however, does not work and core dumps when started with:
This looks like a misuse of libgc. If you really care, you need to read the docs of Boehm to see if they say anything specific to FreeBSD and to the way the generated code calls it, e.g. maybe we are missing some initialization function that is required on FreeBSD but not on Linux. (But again, I don't think we care about Boehm that much, except for testing.) A bientôt, Armin.
participants (3)
-
Armin Rigo -
David Naylor -
Maciej Fijalkowski