diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-08-24 05:48:10 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-08-24 05:48:10 +0000 |
commit | 2a2ad453e3a6a80b9f7ba45644b2620b90a4e993 (patch) | |
tree | 886d14079a1f85442eac1c3ba38d6b4c31c34496 /Modules | |
parent | a445210fc2e2f8c3ae36c73bf335e01c6d121fef (diff) | |
download | cpython-2a2ad453e3a6a80b9f7ba45644b2620b90a4e993.tar.gz |
Merged revisions 66006 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
TESTED=./python -E -tt ./Lib/test/regrtest.py -uall (both debug and opt modes)
........
r66006 | neal.norwitz | 2008-08-23 22:04:52 -0700 (Sat, 23 Aug 2008) | 25 lines
Fix:
* crashes on memory allocation failure found with failmalloc
* memory leaks found with valgrind
* compiler warnings in opt mode which would lead to invalid memory reads
* problem using wrong name in decimal module reported by pychecker
Update the valgrind suppressions file with new leaks that are small/one-time
leaks we don't care about (ie, they are too hard to fix).
TBR=barry
TESTED=./python -E -tt ./Lib/test/regrtest.py -uall (both debug and opt modes)
in opt mode:
valgrind -q --leak-check=yes --suppressions=Misc/valgrind-python.supp \
./python -E -tt ./Lib/test/regrtest.py -uall,-bsddb,-compiler \
-x test_logging test_ssl test_multiprocessing
valgrind -q --leak-check=yes --suppressions=Misc/valgrind-python.supp \
./python -E -tt ./Lib/test/regrtest.py test_multiprocessing
for i in `seq 1 4000` ; do
LD_PRELOAD=~/local/lib/libfailmalloc.so FAILMALLOC_INTERVAL=$i \
./python -c pass
done
At least some of these fixes should probably be backported to 2.5.
........
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/stgdict.c | 3 | ||||
-rw-r--r-- | Modules/_fileio.c | 1 | ||||
-rw-r--r-- | Modules/signalmodule.c | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c index aac073f9a1..7db3e0faa2 100644 --- a/Modules/_ctypes/stgdict.c +++ b/Modules/_ctypes/stgdict.c @@ -408,6 +408,7 @@ StructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct) ffi_ofs = 0; } + assert(stgdict->format == NULL); if (isStruct && !isPacked) { stgdict->format = alloc_format_string(NULL, "T{"); } else { @@ -527,7 +528,9 @@ StructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct) #undef realdict if (isStruct && !isPacked) { + char *ptr = stgdict->format; stgdict->format = alloc_format_string(stgdict->format, "}"); + PyMem_Free(ptr); if (stgdict->format == NULL) return -1; } diff --git a/Modules/_fileio.c b/Modules/_fileio.c index f0c8fedc33..ec123e891e 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -278,6 +278,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) ret = -1; done: + PyMem_Free(name); return ret; } diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index e1904296aa..8860b3951e 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -796,7 +796,8 @@ PyInit_signal(void) #if defined (HAVE_SETITIMER) || defined (HAVE_GETITIMER) ItimerError = PyErr_NewException("signal.ItimerError", PyExc_IOError, NULL); - PyDict_SetItemString(d, "ItimerError", ItimerError); + if (ItimerError != NULL) + PyDict_SetItemString(d, "ItimerError", ItimerError); #endif if (PyErr_Occurred()) { |