AssertionError in rpython_jit_metainterp_resume.c
Hello, I am working on the RSqueak VM (https://bitbucket.org/pypy/lang-smalltalk). Usually I debug assertion errors by executing the VM in interpreted mode. Recently I started getting an error where that doesn't work. See below for the only output on the console. I am working on Windows, so the VM is compiled with Visual Studio. The VM is translated using the pypy commit tagged "release-2.3.1". RPython traceback: File "rpython_jit_metainterp_compile.c", line 379, in ResumeGuardForcedDescr_handle_async_forcing File "rpython_jit_metainterp_resume.c", line 256, in force_from_resumedata File "rpython_jit_metainterp_virtualizable.c", line 426, in write_from_resume_data_partial File "rpython_jit_metainterp_resume.c", line 768, in ResumeDataDirectReader_decode_ref Fatal RPython error: AssertionError Since this seems to be related to virtualizable objects: during translation we get 2 warnings that the "fresh_virtualizable" hints are ignored (there are 2 places where virtualizable frame objects are created. Also, we have one virtualizable list[*] field in our Context class, which should never be resized. I applied the make_sure_not_resized hint on it, but maybe I'm using it wrong... I'm just calling make_sure_not_resized once, after setting the list field. Any ideas? Thanks in advance! Best, Anton
Hi Anton, On 3 August 2014 12:57, Anton Gulenko <anton.gulenko@googlemail.com> wrote:
Since this seems to be related to virtualizable objects: during translation we get 2 warnings that the "fresh_virtualizable" hints are ignored (there are 2 places where virtualizable frame objects are created. Also, we have one virtualizable list[*] field in our Context class, which should never be resized. I applied the make_sure_not_resized hint on it, but maybe I'm using it wrong... I'm just calling make_sure_not_resized once, after setting the list field.
It's not enough to not resize the list: you need to make sure that a given virtualizable object's list attribute is never re-assigned with a list of different size. Is that true? A bientôt, Armin.
Salut Armin, I checked the code and indeed, it seems like the list field in the Context class _can_ be reassigned. However, it should only happen very soon after the constructor is finished, and the size of the list should not change. To be sure, I'll try to refactor this and make it impossible for the list to be reassigned after the constructor is finished. That would satisfy the requirements right? Is it illegal to reassign the list field at all, or is it just the size of the list that matters? Also, is it possible to have two different list fields in a virtualizable object (provided both are never reassigned after the constructor)? Merci bien at a bientôt, Anton 2014-08-03 14:26 GMT+02:00 Armin Rigo <arigo@tunes.org>:
Hi Anton,
Since this seems to be related to virtualizable objects: during
On 3 August 2014 12:57, Anton Gulenko <anton.gulenko@googlemail.com> wrote: translation
we get 2 warnings that the "fresh_virtualizable" hints are ignored (there are 2 places where virtualizable frame objects are created. Also, we have one virtualizable list[*] field in our Context class, which should never be resized. I applied the make_sure_not_resized hint on it, but maybe I'm using it wrong... I'm just calling make_sure_not_resized once, after setting the list field.
It's not enough to not resize the list: you need to make sure that a given virtualizable object's list attribute is never re-assigned with a list of different size. Is that true?
A bientôt,
Armin.
Hi Anton, On 4 August 2014 14:36, Anton Gulenko <anton.gulenko@googlemail.com> wrote:
To be sure, I'll try to refactor this and make it impossible for the list to be reassigned after the constructor is finished. That would satisfy the requirements right?
Yes, at least this one... To be able to help you more if needed, please provide step-by-step instructions about how to reproduce. Armin
Hi Armin, I made a refactoring that makes sure that the virtualizable list is only assigned once, but the issue still persists. To reproduce this you'd have to build the Vm... Fortunately that's way faster than Pypy ;) The repo: https://bitbucket.org/pypy/lang-smalltalk The relevant branch is 'storage', current revision 1012, commit hash d007ca0 <https://bitbucket.org/pypy/lang-smalltalk/commits/d007ca0a713795be43171273c5...> . The requirements are to have the pypy repo on PYTHONPATH (to load rpython.rlib and so on), and to have rsdl installed. The target file is targetimageloadingsmalltalk.py, so compiling should be something like: $ pypy ../pypy/rpython/bin/rpython -Ojit targetimageloadingsmalltalk.py I am also compiling with --gc=minimark because I had some issues with the default gc. The virtualizable classes are defined in spyvm/storage_contexts.py. There's the root class ContextPartShadow and two subclasses BlockContextShadow and MethodContextShadow. Both subclasses have a default constructor and static build() methods. It might be enough if you check out the definitions and constructors of those classes?.. Let me know if it doesn't translate or if the code is weird... Thanks for your help! Best, Anton 2014-08-04 16:00 GMT+02:00 Armin Rigo <arigo@tunes.org>:
Hi Anton,
To be sure, I'll try to refactor this and make it impossible for the
On 4 August 2014 14:36, Anton Gulenko <anton.gulenko@googlemail.com> wrote: list to
be reassigned after the constructor is finished. That would satisfy the requirements right?
Yes, at least this one... To be able to help you more if needed, please provide step-by-step instructions about how to reproduce.
Armin
Sorry, I forgot to mention - to actually produce the error you have to run the Squek image: ./rsqueak images/Squeak4.5-noBitBlt.image Best, Anton 2014-08-05 18:24 GMT+02:00 Anton Gulenko <anton.gulenko@googlemail.com>:
Hi Armin,
I made a refactoring that makes sure that the virtualizable list is only assigned once, but the issue still persists.
To reproduce this you'd have to build the Vm... Fortunately that's way faster than Pypy ;) The repo: https://bitbucket.org/pypy/lang-smalltalk The relevant branch is 'storage', current revision 1012, commit hash d007ca0 <https://bitbucket.org/pypy/lang-smalltalk/commits/d007ca0a713795be43171273c5...> . The requirements are to have the pypy repo on PYTHONPATH (to load rpython.rlib and so on), and to have rsdl installed. The target file is targetimageloadingsmalltalk.py, so compiling should be something like: $ pypy ../pypy/rpython/bin/rpython -Ojit targetimageloadingsmalltalk.py I am also compiling with --gc=minimark because I had some issues with the default gc.
The virtualizable classes are defined in spyvm/storage_contexts.py. There's the root class ContextPartShadow and two subclasses BlockContextShadow and MethodContextShadow. Both subclasses have a default constructor and static build() methods. It might be enough if you check out the definitions and constructors of those classes?..
Let me know if it doesn't translate or if the code is weird... Thanks for your help! Best, Anton
2014-08-04 16:00 GMT+02:00 Armin Rigo <arigo@tunes.org>:
Hi Anton,
To be sure, I'll try to refactor this and make it impossible for the
On 4 August 2014 14:36, Anton Gulenko <anton.gulenko@googlemail.com> wrote: list to
be reassigned after the constructor is finished. That would satisfy the requirements right?
Yes, at least this one... To be able to help you more if needed, please provide step-by-step instructions about how to reproduce.
Armin
Hi Armin, just wanted to bump this... Do you maybe have any hints for me to debug this issue? Thanks and best regards, Anton 2014-08-05 18:32 GMT+02:00 Anton Gulenko <anton.gulenko@googlemail.com>:
Sorry, I forgot to mention - to actually produce the error you have to run the Squek image: ./rsqueak images/Squeak4.5-noBitBlt.image
Best, Anton
2014-08-05 18:24 GMT+02:00 Anton Gulenko <anton.gulenko@googlemail.com>:
Hi Armin,
I made a refactoring that makes sure that the virtualizable list is only assigned once, but the issue still persists.
To reproduce this you'd have to build the Vm... Fortunately that's way faster than Pypy ;) The repo: https://bitbucket.org/pypy/lang-smalltalk The relevant branch is 'storage', current revision 1012, commit hash d007ca0 <https://bitbucket.org/pypy/lang-smalltalk/commits/d007ca0a713795be43171273c5...> . The requirements are to have the pypy repo on PYTHONPATH (to load rpython.rlib and so on), and to have rsdl installed. The target file is targetimageloadingsmalltalk.py, so compiling should be something like: $ pypy ../pypy/rpython/bin/rpython -Ojit targetimageloadingsmalltalk.py I am also compiling with --gc=minimark because I had some issues with the default gc.
The virtualizable classes are defined in spyvm/storage_contexts.py. There's the root class ContextPartShadow and two subclasses BlockContextShadow and MethodContextShadow. Both subclasses have a default constructor and static build() methods. It might be enough if you check out the definitions and constructors of those classes?..
Let me know if it doesn't translate or if the code is weird... Thanks for your help! Best, Anton
2014-08-04 16:00 GMT+02:00 Armin Rigo <arigo@tunes.org>:
Hi Anton,
To be sure, I'll try to refactor this and make it impossible for the
On 4 August 2014 14:36, Anton Gulenko <anton.gulenko@googlemail.com> wrote: list to
be reassigned after the constructor is finished. That would satisfy the requirements right?
Yes, at least this one... To be able to help you more if needed, please provide step-by-step instructions about how to reproduce.
Armin
Hi Anton, On 17 August 2014 19:04, Anton Gulenko <anton.gulenko@googlemail.com> wrote:
just wanted to bump this... Do you maybe have any hints for me to debug this issue?
Sorry, I've exhausted my hint supply. The next thing to do is to debug, and I've not had much time to do that recently. Can you tell me precisely which PyPy revision you're using, too? We're busy changing a lot of things in the stmgc-c7 branch. A bientôt, Armin.
participants (2)
-
Anton Gulenko
-
Armin Rigo