Bugs item #1201456, was opened at 2005-05-13 11:43 Message generated for change (Settings changed) made by tjreedy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1201456&group_id=5470
Category: Python Interpreter Core Group: Python 2.4 Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Vladimir Yu. Stepanov (vys) Assigned to: Nobody/Anonymous (nobody) Summary: Problem with recursion in dict (crash with core dump) Initial Comment: Please see example code. ---------------------------------------------------------------------- Comment By: Vladimir Yu. Stepanov (vys) Date: 2005-05-18 09:05 Message: Logged In: YES user_id=384980 sys.getrecursionlimit() returns 1000. I set sys.setrecursionlimit() to 500 and problem was resolved :) Thank you very much ! PS. Is it possible to add some checks in Py_SetRecursionLimit to reject overflow values ? ---------------------------------------------------------------------- Comment By: Nick Coghlan (ncoghlan) Date: 2005-05-18 08:15 Message: Logged In: YES user_id=1038590 What does sys.getrecursionlimit() return? Does the buggy code generate the expected exception if you use sys.setrecursionlimit() to make the value smaller (e.g. 500)? FreeBSD has a history of not playing well with CPython's ability to detect inifinite recursion. . . ---------------------------------------------------------------------- Comment By: Vladimir Yu. Stepanov (vys) Date: 2005-05-13 12:06 Message: Logged In: YES user_id=384980 This is output from `uname -a`: FreeBSD fox.renet.ru 5.3-RELEASE FreeBSD 5.3-RELEASE #1: Fri Apr 15 10:38:49 MSD 2005 [EMAIL PROTECTED]:/M/safedir/src/sys/i386/compile/FOX i386 I get some others with this code: Python 2.4.1 (#2, Apr 26 2005, 14:16:31) [GCC 3.4.2 [FreeBSD] 20040728] on freebsd5 Type "help", "copyright", "credits" or "license" for more information. >>> d = {} >>> >>> class test: ... def __hash__(self): ... d[self] = None ... >>> d[test()] = None Bus error (core dumped) fox:vys!~ > gdb python python.core GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)... Core was generated by `python'. Program terminated with signal 10, Bus error. <skip> (gdb) where #0 0x2828b3b1 in ldexp () from /lib/libc.so.5 #1 0x2828b618 in malloc () from /lib/libc.so.5 #2 0x080bdca1 in _PyObject_GC_Malloc () #3 0x080bdd4a in _PyObject_GC_New () #4 0x0805f556 in PyMethod_New () #5 0x0805c1a6 in PyInstance_NewRaw () #6 0x0805c66a in PyInstance_New () #7 0x0805cca1 in _PyInstance_Lookup () #8 0x080703e6 in PyDict_SetItem () #9 0x0809bb0e in PyEval_EvalFrame () #10 0x0809fc20 in PyEval_EvalCodeEx () #11 0x080d4d66 in PyFunction_SetClosure () #12 0x0805a38c in PyObject_Call () #13 0x0805fbe2 in PyMethod_New () #14 0x0805a38c in PyObject_Call () #15 0x08099f1b in PyEval_CallObjectWithKeywords () #16 0x0805ccb9 in _PyInstance_Lookup () #17 0x080703e6 in PyDict_SetItem () #18 0x0809bb0e in PyEval_EvalFrame () #19 0x0809fc20 in PyEval_EvalCodeEx () #20 0x080d4d66 in PyFunction_SetClosure () #21 0x0805a38c in PyObject_Call () #22 0x0805fbe2 in PyMethod_New () <and so on> ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2005-05-13 11:55 Message: Logged In: YES user_id=80475 I get the expected behavior: RuntimeError: maximum recursion depth exceeded ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2005-05-13 11:55 Message: Logged In: YES user_id=6656 I get an infinite recursion runtime error. What platform are you on? ---------------------------------------------------------------------- Comment By: Vladimir Yu. Stepanov (vys) Date: 2005-05-13 11:46 Message: Logged In: YES user_id=384980 d = {} class test: def __hash__(self): d[self] = None d[test()] = None ---------------------------------------------------------------------- Comment By: Michael Hudson (mwh) Date: 2005-05-13 11:46 Message: Logged In: YES user_id=6656 I see no code. SF can be a pain with this... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1201456&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com