Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 673
    • Issues 673
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPy
  • pypypypy
  • Issues
  • #3556
Closed
Open
Created Sep 17, 2021 by tapika@tapika

pypy / stackless bug(s)

I have added demo repository in here:

https://github.com/tapika/test_stackless

With instructions if you're using Windows and Visual studio 2019. If you're not - I can maybe help to port under your environment.

There are couple issues with this sample project:

  1. Hang in stackless.run()

Open pypytest_runner.cpp -

comment out runTaskUntilFinishes and taskletKill call - - uncomment stackless_run call. uncomment pypy_setup_home call - application hangs after that in stackless.run().

  1. Constantly growing scheduler queue

Open cffiplugin.py, in taskletCreate - uncomment line #print(stackless._squeue) - run application.

Like you see - tasklet queue is constantly increasing, and ending tasklets are not removed from scheduler queue. If this a bug in test application (I can bugfix demo app if it's so) or in stackless.py ?

pypytest_runner.cpp should be using runTaskUntilFinishes / taskletKill calls.

  1. Initialization order matters ?

Change pypytest_runner.cpp initialization order to:

int main(int argc, char **argv) {

    rpython_startup_code();
    pypy_init_threads();

    int r;

    pypy_setup_home(pythonPath, 1);
    
    r = initCffiModule();
    if (r == -1)
    {
        PyErr_Print();
        return 0;
    }
    ...

Following error occurs:

Exception ignored initialization of 'cffiplugin'
pypy3 version: 7.3.7
sys.path: ['C:\\PrototypingQuick\\Python_8_2021\\pypy-nightly\\lib_pypy\\__extensions__', 'C:\\PrototypingQuick\\Python_8_2021\\pypy-nightly\\lib_pypy', 'C:\\PrototypingQuick\\Python_8_2021\\pypy-nightly\\lib-python\\3']
Error in cpyext, CPython compatibility layer:
The function PyErr_Print was not supposed to fail
Fatal error in cpyext, CPython compatibility layer, calling PyErr_Print
Either report a bug or consider not using this particular extension
<SystemError object at 0x7ffa6a5ae910>
RPython traceback:
  File "pypy_module_cpyext.c", line 12206, in wrapper_second_level__star_0_1
  File "pypy_module_cpyext_1.c", line 38236, in not_supposed_to_fail

Why initialization order matters and what is the problem behind this error ?

If you think there are multiple issues in this ticket, I can create multiple issues as well - let me know if this is needed.

Edited Sep 17, 2021 by tapika
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking