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:
- 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()
.
- 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.
- 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.