Re: [pypy-dev] PyPy JIT & C extensions

Hi Folks:
A few days ago, I floated this idea in the #pypy IRC channel. Why can't we take a JITed pypy, install the greenlet package, run it and see what happens? After all, greenlet is a C extension module. Hopefully this would provide a base line for work to be required? I am trying this but I am having a few hiccups getting setup.py to do the right thing. Since I am a newbie, I would like to know what is wrong with this line of reasoning? Cheers, Andrew

On 25 October 2010 14:12, Andrew Francis <andrewfr_ice@yahoo.com> wrote:
A few days ago, I floated this idea in the #pypy IRC channel. Why can't we take a JITed pypy, install the greenlet package, run it and see what happens? After all, greenlet is a C extension module. Hopefully this would provide a base line for work to be required? I am trying this but I am having a few hiccups getting setup.py to do the right thing. Since I am a newbie, I would like to know what is wrong with this line of reasoning?
PyPy's internal representation of frames differs from that of CPython. How does greenlet determine how much of the stack to copy? -- William Leslie

Hi, On Mon, Oct 25, 2010 at 5:12 AM, Andrew Francis <andrewfr_ice@yahoo.com> wrote:
A few days ago, I floated this idea in the #pypy IRC channel. Why can't we take a JITed pypy, install the greenlet package, run it and see what happens?
You will just get strange segfaults and no way to understand from outside where they come from. I can give some more details about them, but I guess it would not be too helpful. In summary, C extension modules have a chance to work with PyPy as long as they don't play strange tricks. A bientôt, Armin.

On Mon, Oct 25, 2010 at 2:08 PM, Armin Rigo <arigo@tunes.org> wrote:
Hey. I had a private email exchange with Andrew and I think what he wants to achieve is a working greenlet module for PyPy. Is a current C version a good start, or something else would be a good start? Cheers, fijal

Hi, On Mon, Oct 25, 2010 at 4:37 PM, Maciej Fijalkowski <fijall@gmail.com> wrote:
Sorry, I guess I should repeat here the argument I made on IRC. It would not work, because the GC will not find its roots. With --gcrootfinder=shadowstack, I think it will get confused by the switches -- maybe I am wrong and it works anyway; but then I know for sure that with --gcrootfinder=asmgcc it will definitely not work at all. (For reference, the JIT requires --gcrootfinder=asmgcc.) Armin

Hi Folks: --- On Mon, 10/25/10, Maciej Fijalkowski <fijall@gmail.com> wrote:
Yes this is exactly what I wish to achieve. I thought starting with the current greenlet module would be a good start. Maybe we will get lucky and not need to re-invent the wheel. I would learn the terminology (i.e., shadowstacks), see how differently the stacks are laid out, get familiar with the code base and debugging techniques. Already I see interesting questions being asked. Cheers, Andrew

On 25 October 2010 14:12, Andrew Francis <andrewfr_ice@yahoo.com> wrote:
A few days ago, I floated this idea in the #pypy IRC channel. Why can't we take a JITed pypy, install the greenlet package, run it and see what happens? After all, greenlet is a C extension module. Hopefully this would provide a base line for work to be required? I am trying this but I am having a few hiccups getting setup.py to do the right thing. Since I am a newbie, I would like to know what is wrong with this line of reasoning?
PyPy's internal representation of frames differs from that of CPython. How does greenlet determine how much of the stack to copy? -- William Leslie

Hi, On Mon, Oct 25, 2010 at 5:12 AM, Andrew Francis <andrewfr_ice@yahoo.com> wrote:
A few days ago, I floated this idea in the #pypy IRC channel. Why can't we take a JITed pypy, install the greenlet package, run it and see what happens?
You will just get strange segfaults and no way to understand from outside where they come from. I can give some more details about them, but I guess it would not be too helpful. In summary, C extension modules have a chance to work with PyPy as long as they don't play strange tricks. A bientôt, Armin.

On Mon, Oct 25, 2010 at 2:08 PM, Armin Rigo <arigo@tunes.org> wrote:
Hey. I had a private email exchange with Andrew and I think what he wants to achieve is a working greenlet module for PyPy. Is a current C version a good start, or something else would be a good start? Cheers, fijal

Hi, On Mon, Oct 25, 2010 at 4:37 PM, Maciej Fijalkowski <fijall@gmail.com> wrote:
Sorry, I guess I should repeat here the argument I made on IRC. It would not work, because the GC will not find its roots. With --gcrootfinder=shadowstack, I think it will get confused by the switches -- maybe I am wrong and it works anyway; but then I know for sure that with --gcrootfinder=asmgcc it will definitely not work at all. (For reference, the JIT requires --gcrootfinder=asmgcc.) Armin

Hi Folks: --- On Mon, 10/25/10, Maciej Fijalkowski <fijall@gmail.com> wrote:
Yes this is exactly what I wish to achieve. I thought starting with the current greenlet module would be a good start. Maybe we will get lucky and not need to re-invent the wheel. I would learn the terminology (i.e., shadowstacks), see how differently the stacks are laid out, get familiar with the code base and debugging techniques. Already I see interesting questions being asked. Cheers, Andrew
participants (4)
-
Andrew Francis
-
Armin Rigo
-
Maciej Fijalkowski
-
William Leslie