[Stackless] 2.5 porting issue

Richard richard at ccpgames.com
Wed Jul 5 14:23:44 CEST 2006


Hi,

I am having trouble tracking down a bug in Stackless for
Python 2.5b1.  If anyone has any experience in debugging the
Python virtual machine I would appreciate the help.  In fact
if anyone wants to get the latest source code and have a
go at fixing any broken tests, it would be very helpful.

This problem is reproduced in the Python regression test,
test_calendar, and involves generator expressions.  It can
be reproduced with the following command:

  PCBuild\python_d.exe Lib\test\test_calendar.py

The same problem should be present in any other platform
Stackless runs on.

It crashes within a generator expression because the virtual
machine goes to discard a local in the current frame
and finds there are no references to it.. dereferencing
Py_None when no-one holds a reference to it is a fatal error.

Perhaps I need to be adding a reference to Py_None somewhere.

Anyone with more experience care to take a look into this?
The latest from SVN is the place to fetch the code from:
http://svn.python.org/projects/stackless/trunk/

Even handy tips on how to track down where locals are
initially set in the virtual machine, would be helpful.

On a different note, the port is looking a little better.
All but two stackless unittests pass.

Thanks,
Richard.

A call stack, which hopefully Outlook does not butcher:

>	python25_d.dll!Py_FatalError(const char * msg=0x1e2b8d74)  Line 1541	C
 	python25_d.dll!none_dealloc(_object * ignore=0x1e2b8f9c)  Line 1821 + 0xa	C
 	python25_d.dll!_Py_Dealloc(_object * op=0x1e2b8f9c)  Line 1945 + 0x7	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea6da8, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 1138 + 0x1e	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea6da8, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!slp_frame_dispatch(_frame * f=0x01ea6da8, _frame * stopframe=0x01ea6bf0, int exc=0, _object * retval=0x1e2b8f9c)  Line 610 + 0x12	C
 	python25_d.dll!slp_gen_send_ex(PyGenObject * ob=0x02025bb8, _object * arg=0x00000000, int exc=0)  Line 494 + 0x15	C
 	python25_d.dll!gen_iternext(PyGenObject * gen=0x02025bb8)  Line 286 + 0xd	C
 	python25_d.dll!listextend(PyListObject * self=0x01e9b738, _object * b=0x02025bb8)  Line 808 + 0x7	C
 	python25_d.dll!_PyList_Extend(PyListObject * self=0x01e9b738, _object * b=0x02025bb8)  Line 846 + 0xd	C
 	python25_d.dll!PySequence_List(_object * v=0x02025bb8)  Line 1519 + 0xd	C
 	python25_d.dll!PySequence_Fast(_object * v=0x02025bb8, const char * m=0x1e2f8e15)  Line 1548 + 0x9	C
 	python25_d.dll!string_join(PyStringObject * self=0x01dcf840, _object * orig=0x02025bb8)  Line 1737 + 0xe	C
 	python25_d.dll!call_function(_object * * * pp_stack=0x002177c8, int oparg=31258688)  Line 3865 + 0xcf	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea6bf0, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2482	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea6bf0, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea4ca0, int throwflag=0, _object * retval=0x0201d6a0)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea4ca0, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea4af8, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea4af8, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea3be0, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea3be0, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea3a30, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea3a30, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea3880, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea3880, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea36d0, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea36d0, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea3520, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea3520, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea3370, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea3370, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea2c88, int throwflag=0, _object * retval=0x02019e70)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea2c88, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ea2ac8, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ea2ac8, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01e5f080, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01e5f080, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01ebb790, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01ebb790, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!PyEval_EvalFrame_value(_frame * f=0x01e21e08, int throwflag=0, _object * retval=0x01e9a818)  Line 2850	C
 	python25_d.dll!PyEval_EvalFrameEx_slp(_frame * f=0x01e21e08, int throwflag=0, _object * retval=0x1e2b8f9c)  Line 782 + 0x15	C
 	python25_d.dll!slp_frame_dispatch_top(_object * retval=0x1e2b8f9c)  Line 637 + 0x10	C
 	python25_d.dll!slp_run_tasklet()  Line 1155 + 0x9	C
 	python25_d.dll!slp_eval_frame(_frame * f=0x01e21e08)  Line 281 + 0x5	C
 	python25_d.dll!climb_stack_and_eval_frame(_frame * f=0x01e21e08)  Line 248 + 0x9	C
 	python25_d.dll!slp_eval_frame(_frame * f=0x01e21e08)  Line 276 + 0x9	C
 	python25_d.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x01e947a8, _object * globals=0x01e21e08, _object * locals=0x01d89d58, _object * * args=0x00000000, int argcount=0, _object * * kws=0x00000000, int kwcount=0, _object * * defs=0x00000000, int defcount=0, _object * closure=0x00000000)  Line 3123 + 0x6	C
 	python25_d.dll!PyEval_EvalCode(PyCodeObject * co=0x01e947a8, _object * globals=0x01d89d58, _object * locals=0x01d89d58)  Line 501 + 0x1f	C
 	python25_d.dll!run_mod(_mod * mod=0x01f29f20, const char * filename=0x01d42507, _object * globals=0x01d89d58, _object * locals=0x01d89d58, PyCompilerFlags * flags=0x0021ff2c, _arena * arena=0x01e24ea0)  Line 1260 + 0x11	C
 	python25_d.dll!PyRun_FileExFlags(_iobuf * fp=0x1027c898, const char * filename=0x01d42507, int start=257, _object * globals=0x01d89d58, _object * locals=0x01d89d58, int closeit=1, PyCompilerFlags * flags=0x0021ff2c)  Line 1244 + 0x1d	C
 	python25_d.dll!PyRun_SimpleFileExFlags(_iobuf * fp=0x1027c898, const char * filename=0x01d42507, int closeit=1, PyCompilerFlags * flags=0x0021ff2c)  Line 874 + 0x22	C
 	python25_d.dll!PyRun_AnyFileExFlags(_iobuf * fp=0x1027c898, const char * filename=0x01d42507, int closeit=1, PyCompilerFlags * flags=0x0021ff2c)  Line 697 + 0x15	C
 	python25_d.dll!Py_Main(int argc=2, char * * argv=0x01d424c8)  Line 498 + 0x30	C
 	python_d.exe!main(int argc=2, char * * argv=0x01d424c8)  Line 23 + 0xe	C
 	python_d.exe!mainCRTStartup()  Line 398 + 0x11	C

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list