Compare commits
13 Commits
Author | SHA1 | Date |
---|---|---|
Miro Hrončok | 6ae2400c18 | |
Miro Hrončok | 6827170b24 | |
Charalampos Stratakis | 4e033a4931 | |
Charalampos Stratakis | 6937b68312 | |
Petr Viktorin | f7d3d35029 | |
Charalampos Stratakis | 50e4bfa0d1 | |
Charalampos Stratakis | 6b23e951bc | |
Tomas Orsava | ef0529a8c3 | |
Iryna Shcherbina | 7940f6d56d | |
Iryna Shcherbina | b8de731942 | |
Iryna Shcherbina | a0dada937f | |
Iryna Shcherbina | d614eca5a8 | |
Charalampos Stratakis | f98e4c1fdb |
|
@ -1,7 +1,8 @@
|
||||||
diff -up Python-3.3.0rc2/configure.ac.systemtap Python-3.3.0rc2/configure.ac
|
diff --git a/configure.ac b/configure.ac
|
||||||
--- Python-3.3.0rc2/configure.ac.systemtap 2012-09-09 05:11:14.000000000 -0400
|
index f50a6c8..b0650a5 100644
|
||||||
+++ Python-3.3.0rc2/configure.ac 2012-09-10 09:17:21.114511781 -0400
|
--- a/configure.ac
|
||||||
@@ -2678,6 +2678,23 @@ if test "$with_valgrind" != no; then
|
+++ b/configure.ac
|
||||||
|
@@ -3288,6 +3288,23 @@ if test "$with_valgrind" != no; then
|
||||||
OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
|
OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -25,10 +26,11 @@ diff -up Python-3.3.0rc2/configure.ac.systemtap Python-3.3.0rc2/configure.ac
|
||||||
# -I${DLINCLDIR} is added to the compile rule for importdl.o
|
# -I${DLINCLDIR} is added to the compile rule for importdl.o
|
||||||
AC_SUBST(DLINCLDIR)
|
AC_SUBST(DLINCLDIR)
|
||||||
DLINCLDIR=.
|
DLINCLDIR=.
|
||||||
diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure
|
diff --git a/configure b/configure
|
||||||
--- Python-3.3.0rc2/configure.systemtap 2012-09-09 05:11:14.000000000 -0400
|
index 0906ae0..4acd1cd 100755
|
||||||
+++ Python-3.3.0rc2/configure 2012-09-10 09:17:21.116511780 -0400
|
--- a/configure
|
||||||
@@ -618,6 +618,8 @@ TRUE
|
+++ b/configure
|
||||||
|
@@ -642,6 +642,8 @@ TRUE
|
||||||
MACHDEP_OBJS
|
MACHDEP_OBJS
|
||||||
DYNLOADFILE
|
DYNLOADFILE
|
||||||
DLINCLDIR
|
DLINCLDIR
|
||||||
|
@ -37,7 +39,7 @@ diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure
|
||||||
THREADOBJ
|
THREADOBJ
|
||||||
LDLAST
|
LDLAST
|
||||||
USE_THREAD_MODULE
|
USE_THREAD_MODULE
|
||||||
@@ -779,6 +781,7 @@ with_doc_strings
|
@@ -834,6 +836,7 @@ with_doc_strings
|
||||||
with_tsc
|
with_tsc
|
||||||
with_pymalloc
|
with_pymalloc
|
||||||
with_valgrind
|
with_valgrind
|
||||||
|
@ -45,7 +47,7 @@ diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure
|
||||||
with_fpectl
|
with_fpectl
|
||||||
with_libm
|
with_libm
|
||||||
with_libc
|
with_libc
|
||||||
@@ -1456,6 +1459,7 @@ Optional Packages:
|
@@ -1528,6 +1531,7 @@ Optional Packages:
|
||||||
--with(out)-tsc enable/disable timestamp counter profile
|
--with(out)-tsc enable/disable timestamp counter profile
|
||||||
--with(out)-pymalloc disable/enable specialized mallocs
|
--with(out)-pymalloc disable/enable specialized mallocs
|
||||||
--with-valgrind Enable Valgrind support
|
--with-valgrind Enable Valgrind support
|
||||||
|
@ -53,7 +55,7 @@ diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure
|
||||||
--with-fpectl enable SIGFPE catching
|
--with-fpectl enable SIGFPE catching
|
||||||
--with-libm=STRING math library
|
--with-libm=STRING math library
|
||||||
--with-libc=STRING C library
|
--with-libc=STRING C library
|
||||||
@@ -10065,6 +10069,31 @@ fi
|
@@ -11180,6 +11184,31 @@ fi
|
||||||
OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
|
OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -85,18 +87,21 @@ diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure
|
||||||
# -I${DLINCLDIR} is added to the compile rule for importdl.o
|
# -I${DLINCLDIR} is added to the compile rule for importdl.o
|
||||||
|
|
||||||
DLINCLDIR=.
|
DLINCLDIR=.
|
||||||
diff -up Python-3.3.0rc2/Doc/howto/index.rst.systemtap Python-3.3.0rc2/Doc/howto/index.rst
|
diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst
|
||||||
--- Python-3.3.0rc2/Doc/howto/index.rst.systemtap 2012-09-09 05:10:51.000000000 -0400
|
index de65950..593341c 100644
|
||||||
+++ Python-3.3.0rc2/Doc/howto/index.rst 2012-09-10 09:17:21.117511779 -0400
|
--- a/Doc/howto/index.rst
|
||||||
@@ -29,4 +29,5 @@ Currently, the HOWTOs are:
|
+++ b/Doc/howto/index.rst
|
||||||
|
@@ -28,4 +28,5 @@ Currently, the HOWTOs are:
|
||||||
argparse.rst
|
argparse.rst
|
||||||
ipaddress.rst
|
ipaddress.rst
|
||||||
clinic.rst
|
clinic.rst
|
||||||
+ instrumentation.rst
|
+ instrumentation.rst
|
||||||
|
|
||||||
diff -up Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc2/Doc/howto/instrumentation.rst
|
diff --git a/Doc/howto/instrumentation.rst b/Doc/howto/instrumentation.rst
|
||||||
--- Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap 2012-09-10 09:17:21.117511779 -0400
|
new file mode 100644
|
||||||
+++ Python-3.3.0rc2/Doc/howto/instrumentation.rst 2012-09-10 09:17:21.117511779 -0400
|
index 0000000..b6924e1
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/Doc/howto/instrumentation.rst
|
||||||
@@ -0,0 +1,295 @@
|
@@ -0,0 +1,295 @@
|
||||||
+.. _instrumentation:
|
+.. _instrumentation:
|
||||||
+
|
+
|
||||||
|
@ -393,9 +398,11 @@ diff -up Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc2
|
||||||
+ delete fn_calls;
|
+ delete fn_calls;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
diff -up Python-3.3.0rc2/Lib/test/test_systemtap.py.systemtap Python-3.3.0rc2/Lib/test/test_systemtap.py
|
diff --git a/Lib/test/test_systemtap.py b/Lib/test/test_systemtap.py
|
||||||
--- Python-3.3.0rc2/Lib/test/test_systemtap.py.systemtap 2012-09-10 09:17:21.117511779 -0400
|
new file mode 100644
|
||||||
+++ Python-3.3.0rc2/Lib/test/test_systemtap.py 2012-09-10 09:17:21.117511779 -0400
|
index 0000000..a669064
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/Lib/test/test_systemtap.py
|
||||||
@@ -0,0 +1,234 @@
|
@@ -0,0 +1,234 @@
|
||||||
+# Verify that systemtap static probes work
|
+# Verify that systemtap static probes work
|
||||||
+#
|
+#
|
||||||
|
@ -631,10 +638,11 @@ diff -up Python-3.3.0rc2/Lib/test/test_systemtap.py.systemtap Python-3.3.0rc2/Li
|
||||||
+
|
+
|
||||||
+if __name__ == "__main__":
|
+if __name__ == "__main__":
|
||||||
+ test_main()
|
+ test_main()
|
||||||
diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre.in
|
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||||
--- Python-3.3.0rc2/Makefile.pre.in.systemtap 2012-09-09 05:11:05.000000000 -0400
|
index a88b7d5..3585b88 100644
|
||||||
+++ Python-3.3.0rc2/Makefile.pre.in 2012-09-10 09:19:51.195501518 -0400
|
--- a/Makefile.pre.in
|
||||||
@@ -363,6 +363,7 @@ PYTHON_OBJS= \
|
+++ b/Makefile.pre.in
|
||||||
|
@@ -383,6 +383,7 @@ PYTHON_OBJS= \
|
||||||
Python/formatter_unicode.o \
|
Python/formatter_unicode.o \
|
||||||
Python/fileutils.o \
|
Python/fileutils.o \
|
||||||
Python/$(DYNLOADFILE) \
|
Python/$(DYNLOADFILE) \
|
||||||
|
@ -642,19 +650,19 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre.
|
||||||
$(LIBOBJS) \
|
$(LIBOBJS) \
|
||||||
$(MACHDEP_OBJS) \
|
$(MACHDEP_OBJS) \
|
||||||
$(THREADOBJ)
|
$(THREADOBJ)
|
||||||
@@ -713,7 +714,8 @@ Objects/setobject.o: $(srcdir)/Objects/s
|
@@ -864,7 +865,8 @@ Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
|
||||||
$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
|
$(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
|
||||||
$(OPCODETARGETGEN) $(OPCODETARGETS_H)
|
$(srcdir)/Python/opcode_targets.h
|
||||||
|
|
||||||
-Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h
|
-Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h
|
||||||
+Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h \
|
+Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \
|
||||||
+ $(srcdir)/Python/ceval_systemtap.h @SYSTEMTAPDEPS@
|
+ $(srcdir)/Python/ceval_systemtap.h @SYSTEMTAPDEPS@
|
||||||
|
|
||||||
Python/frozen.o: Python/importlib.h Python/importlib_external.h
|
Python/frozen.o: $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib_external.h
|
||||||
|
|
||||||
@@ -724,6 +726,13 @@ Objects/typeobject.o: $(srcdir)/Objects/
|
@@ -878,6 +880,13 @@ Objects/typeobject.o: Objects/typeslots.inc
|
||||||
Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py
|
< $(srcdir)/Include/typeslots.h \
|
||||||
$(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > Objects/typeslots.inc
|
$(srcdir)/Objects/typeslots.inc
|
||||||
|
|
||||||
+# Only needed with --with-systemtap; not a public header:
|
+# Only needed with --with-systemtap; not a public header:
|
||||||
+$(srcdir)/Python/pysystemtap.h: $(srcdir)/Python/pysystemtap.d
|
+$(srcdir)/Python/pysystemtap.h: $(srcdir)/Python/pysystemtap.d
|
||||||
|
@ -666,18 +674,19 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre.
|
||||||
############################################################################
|
############################################################################
|
||||||
# Header files
|
# Header files
|
||||||
|
|
||||||
@@ -1345,6 +1354,7 @@ clean: pycremoval
|
@@ -1601,6 +1610,7 @@ clean: pycremoval
|
||||||
-rm -f Lib/lib2to3/*Grammar*.pickle
|
-rm -f Lib/lib2to3/*Grammar*.pickle
|
||||||
-rm -f Programs/_testembed Programs/_freeze_importlib
|
-rm -f Programs/_testembed Programs/_freeze_importlib
|
||||||
-rm -rf build
|
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
|
||||||
+ -rm -f $(srcdir)/Python/pysystemtap.h
|
+ -rm -f $(srcdir)/Python/pysystemtap.h
|
||||||
|
|
||||||
profile-removal:
|
profile-removal:
|
||||||
find . -name '*.gc??' -exec rm -f {} ';'
|
find . -name '*.gc??' -exec rm -f {} ';'
|
||||||
diff -up Python-3.3.0rc2/pyconfig.h.in.systemtap Python-3.3.0rc2/pyconfig.h.in
|
diff --git a/pyconfig.h.in b/pyconfig.h.in
|
||||||
--- Python-3.3.0rc2/pyconfig.h.in.systemtap 2012-09-09 05:11:14.000000000 -0400
|
index 39ccf53..9052dbc 100644
|
||||||
+++ Python-3.3.0rc2/pyconfig.h.in 2012-09-10 09:17:21.120511781 -0400
|
--- a/pyconfig.h.in
|
||||||
@@ -1306,6 +1306,9 @@
|
+++ b/pyconfig.h.in
|
||||||
|
@@ -1375,6 +1375,9 @@
|
||||||
/* Define if you want to compile in Python-specific mallocs */
|
/* Define if you want to compile in Python-specific mallocs */
|
||||||
#undef WITH_PYMALLOC
|
#undef WITH_PYMALLOC
|
||||||
|
|
||||||
|
@ -687,10 +696,11 @@ diff -up Python-3.3.0rc2/pyconfig.h.in.systemtap Python-3.3.0rc2/pyconfig.h.in
|
||||||
/* Define if you want to compile in rudimentary thread support */
|
/* Define if you want to compile in rudimentary thread support */
|
||||||
#undef WITH_THREAD
|
#undef WITH_THREAD
|
||||||
|
|
||||||
diff -up Python-3.3.0rc2/Python/ceval.c.systemtap Python-3.3.0rc2/Python/ceval.c
|
diff --git a/Python/ceval.c b/Python/ceval.c
|
||||||
--- Python-3.3.0rc2/Python/ceval.c.systemtap 2012-09-09 05:11:12.000000000 -0400
|
index 7b40518..0e49de5 100644
|
||||||
+++ Python-3.3.0rc2/Python/ceval.c 2012-09-10 09:17:21.122511781 -0400
|
--- a/Python/ceval.c
|
||||||
@@ -18,6 +18,8 @@
|
+++ b/Python/ceval.c
|
||||||
|
@@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
@ -699,7 +709,7 @@ diff -up Python-3.3.0rc2/Python/ceval.c.systemtap Python-3.3.0rc2/Python/ceval.c
|
||||||
#ifndef WITH_TSC
|
#ifndef WITH_TSC
|
||||||
|
|
||||||
#define READ_TIMESTAMP(var)
|
#define READ_TIMESTAMP(var)
|
||||||
@@ -1160,6 +1162,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
|
@@ -1160,6 +1162,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -710,7 +720,7 @@ diff -up Python-3.3.0rc2/Python/ceval.c.systemtap Python-3.3.0rc2/Python/ceval.c
|
||||||
co = f->f_code;
|
co = f->f_code;
|
||||||
names = co->co_names;
|
names = co->co_names;
|
||||||
consts = co->co_consts;
|
consts = co->co_consts;
|
||||||
@@ -3077,6 +3083,11 @@ fast_yield:
|
@@ -3678,6 +3684,11 @@ fast_yield:
|
||||||
|
|
||||||
/* pop frame */
|
/* pop frame */
|
||||||
exit_eval_frame:
|
exit_eval_frame:
|
||||||
|
@ -722,9 +732,11 @@ diff -up Python-3.3.0rc2/Python/ceval.c.systemtap Python-3.3.0rc2/Python/ceval.c
|
||||||
Py_LeaveRecursiveCall();
|
Py_LeaveRecursiveCall();
|
||||||
f->f_executing = 0;
|
f->f_executing = 0;
|
||||||
tstate->frame = f->f_back;
|
tstate->frame = f->f_back;
|
||||||
diff -up Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap Python-3.3.0rc2/Python/ceval_systemtap.h
|
diff --git a/Python/ceval_systemtap.h b/Python/ceval_systemtap.h
|
||||||
--- Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap 2012-09-10 09:17:21.122511781 -0400
|
new file mode 100644
|
||||||
+++ Python-3.3.0rc2/Python/ceval_systemtap.h 2012-09-10 09:17:21.122511781 -0400
|
index 0000000..38697ad
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/Python/ceval_systemtap.h
|
||||||
@@ -0,0 +1,86 @@
|
@@ -0,0 +1,86 @@
|
||||||
+/*
|
+/*
|
||||||
+ Support for SystemTap static markers
|
+ Support for SystemTap static markers
|
||||||
|
@ -812,9 +824,11 @@ diff -up Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap Python-3.3.0rc2/Pyth
|
||||||
+#define systemtap_function_return(f)
|
+#define systemtap_function_return(f)
|
||||||
+
|
+
|
||||||
+#endif
|
+#endif
|
||||||
diff -up Python-3.3.0rc2/Python/pysystemtap.d.systemtap Python-3.3.0rc2/Python/pysystemtap.d
|
diff --git a/Python/pysystemtap.d b/Python/pysystemtap.d
|
||||||
--- Python-3.3.0rc2/Python/pysystemtap.d.systemtap 2012-09-10 09:17:21.122511781 -0400
|
new file mode 100644
|
||||||
+++ Python-3.3.0rc2/Python/pysystemtap.d 2012-09-10 09:17:21.122511781 -0400
|
index 0000000..c2cdef0
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/Python/pysystemtap.d
|
||||||
@@ -0,0 +1,4 @@
|
@@ -0,0 +1,4 @@
|
||||||
+provider python {
|
+provider python {
|
||||||
+ probe function__entry(const char *, const char *, int, PyFrameObject *);
|
+ probe function__entry(const char *, const char *, int, PyFrameObject *);
|
||||||
|
|
|
@ -282,7 +282,7 @@ index c9b113e..60e2392 100644
|
||||||
self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac)
|
self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac)
|
||||||
|
|
||||||
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
|
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
|
||||||
index 44765ac..b8cf490 100644
|
index ff57614..8cd1b77 100644
|
||||||
--- a/Modules/_hashopenssl.c
|
--- a/Modules/_hashopenssl.c
|
||||||
+++ b/Modules/_hashopenssl.c
|
+++ b/Modules/_hashopenssl.c
|
||||||
@@ -20,6 +20,8 @@
|
@@ -20,6 +20,8 @@
|
||||||
|
@ -292,9 +292,9 @@ index 44765ac..b8cf490 100644
|
||||||
+#include <openssl/ssl.h>
|
+#include <openssl/ssl.h>
|
||||||
+#include <openssl/err.h>
|
+#include <openssl/err.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/hmac.h>
|
|
||||||
/* We use the object interface to discover what hashes OpenSSL supports. */
|
/* We use the object interface to discover what hashes OpenSSL supports. */
|
||||||
@@ -45,11 +47,19 @@ typedef struct {
|
#include <openssl/objects.h>
|
||||||
|
@@ -55,10 +57,19 @@ typedef struct {
|
||||||
|
|
||||||
static PyTypeObject EVPtype;
|
static PyTypeObject EVPtype;
|
||||||
|
|
||||||
|
@ -311,14 +311,13 @@ index 44765ac..b8cf490 100644
|
||||||
|
|
||||||
-#define DEFINE_CONSTS_FOR_NEW(Name) \
|
-#define DEFINE_CONSTS_FOR_NEW(Name) \
|
||||||
- static PyObject *CONST_ ## Name ## _name_obj = NULL; \
|
- static PyObject *CONST_ ## Name ## _name_obj = NULL; \
|
||||||
- static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
|
|
||||||
- static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
|
- static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
|
||||||
+#define DEFINE_CONSTS_FOR_NEW(Name) \
|
+#define DEFINE_CONSTS_FOR_NEW(Name) \
|
||||||
+ static EVPCachedInfo cached_info_ ##Name;
|
+ static EVPCachedInfo cached_info_ ##Name;
|
||||||
|
|
||||||
DEFINE_CONSTS_FOR_NEW(md5)
|
DEFINE_CONSTS_FOR_NEW(md5)
|
||||||
DEFINE_CONSTS_FOR_NEW(sha1)
|
DEFINE_CONSTS_FOR_NEW(sha1)
|
||||||
@@ -92,6 +102,48 @@ EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len)
|
@@ -139,6 +150,48 @@ EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,7 +366,7 @@ index 44765ac..b8cf490 100644
|
||||||
/* Internal methods for a hash object */
|
/* Internal methods for a hash object */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -259,15 +311,16 @@ EVP_repr(EVPobject *self)
|
@@ -327,15 +380,16 @@ EVP_repr(EVPobject *self)
|
||||||
static int
|
static int
|
||||||
EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
|
EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
|
||||||
{
|
{
|
||||||
|
@ -387,21 +386,21 @@ index 44765ac..b8cf490 100644
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +341,12 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
|
@@ -356,7 +410,12 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
|
||||||
PyBuffer_Release(&view);
|
PyBuffer_Release(&view);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
- EVP_DigestInit(&self->ctx, digest);
|
- EVP_DigestInit(self->ctx, digest);
|
||||||
+ mc_ctx_init(&self->ctx, usedforsecurity);
|
+ mc_ctx_init(self->ctx, usedforsecurity);
|
||||||
+ if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) {
|
+ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) {
|
||||||
+ set_evp_exception();
|
+ set_evp_exception();
|
||||||
+ PyBuffer_Release(&view);
|
+ PyBuffer_Release(&view);
|
||||||
+ return -1;
|
+ Py_RETURN_NONE;
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
self->name = name_obj;
|
self->name = name_obj;
|
||||||
Py_INCREF(self->name);
|
Py_INCREF(self->name);
|
||||||
@@ -372,7 +430,8 @@ static PyTypeObject EVPtype = {
|
@@ -440,7 +499,8 @@ static PyTypeObject EVPtype = {
|
||||||
static PyObject *
|
static PyObject *
|
||||||
EVPnew(PyObject *name_obj,
|
EVPnew(PyObject *name_obj,
|
||||||
const EVP_MD *digest, const EVP_MD_CTX *initial_ctx,
|
const EVP_MD *digest, const EVP_MD_CTX *initial_ctx,
|
||||||
|
@ -411,13 +410,13 @@ index 44765ac..b8cf490 100644
|
||||||
{
|
{
|
||||||
EVPobject *self;
|
EVPobject *self;
|
||||||
|
|
||||||
@@ -387,7 +446,12 @@ EVPnew(PyObject *name_obj,
|
@@ -455,7 +515,12 @@ EVPnew(PyObject *name_obj,
|
||||||
if (initial_ctx) {
|
if (initial_ctx) {
|
||||||
EVP_MD_CTX_copy(&self->ctx, initial_ctx);
|
EVP_MD_CTX_copy(self->ctx, initial_ctx);
|
||||||
} else {
|
} else {
|
||||||
- EVP_DigestInit(&self->ctx, digest);
|
- EVP_DigestInit(self->ctx, digest);
|
||||||
+ mc_ctx_init(&self->ctx, usedforsecurity);
|
+ mc_ctx_init(self->ctx, usedforsecurity);
|
||||||
+ if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) {
|
+ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) {
|
||||||
+ set_evp_exception();
|
+ set_evp_exception();
|
||||||
+ Py_DECREF(self);
|
+ Py_DECREF(self);
|
||||||
+ return NULL;
|
+ return NULL;
|
||||||
|
@ -425,7 +424,7 @@ index 44765ac..b8cf490 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cp && len) {
|
if (cp && len) {
|
||||||
@@ -411,21 +475,29 @@ PyDoc_STRVAR(EVP_new__doc__,
|
@@ -479,21 +544,29 @@ PyDoc_STRVAR(EVP_new__doc__,
|
||||||
An optional string argument may be provided and will be\n\
|
An optional string argument may be provided and will be\n\
|
||||||
automatically hashed.\n\
|
automatically hashed.\n\
|
||||||
\n\
|
\n\
|
||||||
|
@ -459,7 +458,7 @@ index 44765ac..b8cf490 100644
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,7 +511,8 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
|
@@ -507,7 +580,8 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
|
||||||
|
|
||||||
digest = EVP_get_digestbyname(name);
|
digest = EVP_get_digestbyname(name);
|
||||||
|
|
||||||
|
@ -469,13 +468,13 @@ index 44765ac..b8cf490 100644
|
||||||
|
|
||||||
if (data_obj)
|
if (data_obj)
|
||||||
PyBuffer_Release(&view);
|
PyBuffer_Release(&view);
|
||||||
@@ -722,57 +795,114 @@ generate_hash_name_list(void)
|
@@ -769,57 +843,114 @@ generate_hash_name_list(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- * This macro generates constructor function definitions for specific
|
- * This macro generates constructor function definitions for specific
|
||||||
- * hash algorithms. These constructors are much faster than calling
|
- * hash algorithms. These constructors are much faster than calling
|
||||||
- * the generic one passing it a python string and are noticably
|
- * the generic one passing it a python string and are noticeably
|
||||||
- * faster than calling a python new() wrapper. Thats important for
|
- * faster than calling a python new() wrapper. Thats important for
|
||||||
+ * This macro and function generates a family of constructor function
|
+ * This macro and function generates a family of constructor function
|
||||||
+ * definitions for specific hash algorithms. These constructors are much
|
+ * definitions for specific hash algorithms. These constructors are much
|
||||||
|
@ -512,8 +511,8 @@ index 44765ac..b8cf490 100644
|
||||||
+ return implement_specific_EVP_new(self, args, kwdict, \
|
+ return implement_specific_EVP_new(self, args, kwdict, \
|
||||||
+ "|Oi:" #NAME, \
|
+ "|Oi:" #NAME, \
|
||||||
+ &cached_info_ ## NAME ); \
|
+ &cached_info_ ## NAME ); \
|
||||||
}
|
+ }
|
||||||
|
+
|
||||||
+static PyObject *
|
+static PyObject *
|
||||||
+implement_specific_EVP_new(PyObject *self, PyObject *args, PyObject *kwdict,
|
+implement_specific_EVP_new(PyObject *self, PyObject *args, PyObject *kwdict,
|
||||||
+ const char *format,
|
+ const char *format,
|
||||||
|
@ -531,8 +530,8 @@ index 44765ac..b8cf490 100644
|
||||||
+ if (!PyArg_ParseTupleAndKeywords(args, kwdict, format, kwlist,
|
+ if (!PyArg_ParseTupleAndKeywords(args, kwdict, format, kwlist,
|
||||||
+ &data_obj, &usedforsecurity)) {
|
+ &data_obj, &usedforsecurity)) {
|
||||||
+ return NULL;
|
+ return NULL;
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
+ if (data_obj)
|
+ if (data_obj)
|
||||||
+ GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view);
|
+ GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view);
|
||||||
+
|
+
|
||||||
|
@ -581,7 +580,7 @@ index 44765ac..b8cf490 100644
|
||||||
- if (CONST_ ## NAME ## _name_obj == NULL) { \
|
- if (CONST_ ## NAME ## _name_obj == NULL) { \
|
||||||
- CONST_ ## NAME ## _name_obj = PyUnicode_FromString(#NAME); \
|
- CONST_ ## NAME ## _name_obj = PyUnicode_FromString(#NAME); \
|
||||||
- if (EVP_get_digestbyname(#NAME)) { \
|
- if (EVP_get_digestbyname(#NAME)) { \
|
||||||
- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
|
- CONST_new_ ## NAME ## _ctx_p = EVP_MD_CTX_new(); \
|
||||||
- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
|
- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
|
||||||
- } \
|
- } \
|
||||||
- } \
|
- } \
|
||||||
|
@ -621,7 +620,7 @@ index 44765ac..b8cf490 100644
|
||||||
|
|
||||||
GEN_CONSTRUCTOR(md5)
|
GEN_CONSTRUCTOR(md5)
|
||||||
GEN_CONSTRUCTOR(sha1)
|
GEN_CONSTRUCTOR(sha1)
|
||||||
@@ -819,13 +949,10 @@ PyInit__hashlib(void)
|
@@ -866,13 +997,10 @@ PyInit__hashlib(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *openssl_md_meth_names;
|
PyObject *m, *openssl_md_meth_names;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
Index: Include/object.h
|
diff --git Include/object.h Include/object.h
|
||||||
===================================================================
|
index 50d9747..9b7e89e 100644
|
||||||
--- Include/object.h (revision 87911)
|
--- Include/object.h
|
||||||
+++ Include/object.h (working copy)
|
+++ Include/object.h
|
||||||
@@ -914,6 +914,49 @@
|
@@ -1059,6 +1059,49 @@ PyAPI_FUNC(void)
|
||||||
_PyObject_DebugTypeStats(FILE *out);
|
_PyObject_DebugTypeStats(FILE *out);
|
||||||
#endif /* ifndef Py_LIMITED_API */
|
#endif /* ifndef Py_LIMITED_API */
|
||||||
|
|
||||||
|
@ -52,17 +52,17 @@ Index: Include/object.h
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Index: Objects/object.c
|
diff --git Objects/object.c Objects/object.c
|
||||||
===================================================================
|
index d21fd90..d07b49c 100644
|
||||||
--- Objects/object.c (revision 87911)
|
--- Objects/object.c
|
||||||
+++ Objects/object.c (working copy)
|
+++ Objects/object.c
|
||||||
@@ -1899,6 +1899,35 @@
|
@@ -2034,6 +2034,35 @@ _PyTrash_thread_destroy_chain(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+PyAPI_FUNC(void)
|
+PyAPI_FUNC(void)
|
||||||
+_PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr,
|
+_PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr,
|
||||||
+ const char *file, int line, const char *function)
|
+ const char *file, int line, const char *function)
|
||||||
+{
|
+{
|
||||||
+ fprintf(stderr,
|
+ fprintf(stderr,
|
||||||
+ "%s:%d: %s: Assertion \"%s\" failed.\n",
|
+ "%s:%d: %s: Assertion \"%s\" failed.\n",
|
||||||
|
@ -92,23 +92,38 @@ Index: Objects/object.c
|
||||||
#ifndef Py_TRACE_REFS
|
#ifndef Py_TRACE_REFS
|
||||||
/* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc.
|
/* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc.
|
||||||
Define this here, so we can undefine the macro. */
|
Define this here, so we can undefine the macro. */
|
||||||
Index: Lib/test/test_gc.py
|
diff --git Lib/test/test_gc.py Lib/test/test_gc.py
|
||||||
===================================================================
|
index a4d684b..e77029e 100644
|
||||||
--- Lib/test/test_gc.py (revision 87911)
|
--- Lib/test/test_gc.py
|
||||||
+++ Lib/test/test_gc.py (working copy)
|
+++ Lib/test/test_gc.py
|
||||||
@@ -1,7 +1,7 @@
|
@@ -1,10 +1,11 @@
|
||||||
import unittest
|
import unittest
|
||||||
from test.support import (verbose, refcount_test, run_unittest,
|
from test.support import (verbose, refcount_test, run_unittest,
|
||||||
strip_python_stderr, cpython_only, start_threads,
|
strip_python_stderr, cpython_only, start_threads,
|
||||||
- temp_dir)
|
- temp_dir, requires_type_collecting)
|
||||||
+ temp_dir, import_module)
|
+ temp_dir, requires_type_collecting, import_module)
|
||||||
from test.support.script_helper import assert_python_ok, make_script
|
from test.support.script_helper import assert_python_ok, make_script
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@@ -512,6 +512,48 @@
|
+import sysconfig
|
||||||
|
import time
|
||||||
|
import gc
|
||||||
|
import weakref
|
||||||
|
@@ -50,6 +51,8 @@ class GC_Detector(object):
|
||||||
|
# gc collects it.
|
||||||
|
self.wr = weakref.ref(C1055820(666), it_happened)
|
||||||
|
|
||||||
|
+BUILD_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS'])
|
||||||
|
+
|
||||||
|
@with_tp_del
|
||||||
|
class Uncollectable(object):
|
||||||
|
"""Create a reference cycle with multiple __del__ methods.
|
||||||
|
@@ -864,6 +867,50 @@ class GCCallbackTests(unittest.TestCase):
|
||||||
self.assertEqual(len(gc.garbage), 0)
|
self.assertEqual(len(gc.garbage), 0)
|
||||||
|
|
||||||
|
|
||||||
|
+ @unittest.skipIf(BUILD_WITH_NDEBUG,
|
||||||
|
+ 'built with -NDEBUG')
|
||||||
+ def test_refcount_errors(self):
|
+ def test_refcount_errors(self):
|
||||||
+ self.preclean()
|
+ self.preclean()
|
||||||
+ # Verify the "handling" of objects with broken refcounts
|
+ # Verify the "handling" of objects with broken refcounts
|
||||||
|
@ -154,9 +169,10 @@ Index: Lib/test/test_gc.py
|
||||||
class GCTogglingTests(unittest.TestCase):
|
class GCTogglingTests(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
gc.enable()
|
gc.enable()
|
||||||
diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
diff --git Modules/gcmodule.c Modules/gcmodule.c
|
||||||
--- Modules/gcmodule.c.orig2 2014-12-08 10:54:14.251742911 +0100
|
index cb7222d..6a9be80 100644
|
||||||
+++ Modules/gcmodule.c 2014-12-08 10:52:45.674771917 +0100
|
--- Modules/gcmodule.c
|
||||||
|
+++ Modules/gcmodule.c
|
||||||
@@ -341,7 +341,8 @@ update_refs(PyGC_Head *containers)
|
@@ -341,7 +341,8 @@ update_refs(PyGC_Head *containers)
|
||||||
{
|
{
|
||||||
PyGC_Head *gc = containers->gc.gc_next;
|
PyGC_Head *gc = containers->gc.gc_next;
|
||||||
|
@ -188,7 +204,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
if (_PyGCHead_REFS(gc) > 0)
|
if (_PyGCHead_REFS(gc) > 0)
|
||||||
_PyGCHead_DECREF(gc);
|
_PyGCHead_DECREF(gc);
|
||||||
}
|
}
|
||||||
@@ -436,9 +440,10 @@ visit_reachable(PyObject *op, PyGC_Head
|
@@ -436,9 +440,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
|
||||||
* If gc_refs == GC_UNTRACKED, it must be ignored.
|
* If gc_refs == GC_UNTRACKED, it must be ignored.
|
||||||
*/
|
*/
|
||||||
else {
|
else {
|
||||||
|
@ -202,7 +218,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_
|
@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
|
||||||
*/
|
*/
|
||||||
PyObject *op = FROM_GC(gc);
|
PyObject *op = FROM_GC(gc);
|
||||||
traverseproc traverse = Py_TYPE(op)->tp_traverse;
|
traverseproc traverse = Py_TYPE(op)->tp_traverse;
|
||||||
|
@ -211,7 +227,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
_PyGCHead_SET_REFS(gc, GC_REACHABLE);
|
_PyGCHead_SET_REFS(gc, GC_REACHABLE);
|
||||||
(void) traverse(op,
|
(void) traverse(op,
|
||||||
(visitproc)visit_reachable,
|
(visitproc)visit_reachable,
|
||||||
@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreac
|
@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
|
||||||
for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {
|
for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {
|
||||||
PyObject *op = FROM_GC(gc);
|
PyObject *op = FROM_GC(gc);
|
||||||
|
|
||||||
|
@ -220,7 +236,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
next = gc->gc.gc_next;
|
next = gc->gc.gc_next;
|
||||||
|
|
||||||
if (has_legacy_finalizer(op)) {
|
if (has_legacy_finalizer(op)) {
|
||||||
@@ -619,7 +624,7 @@ handle_weakrefs(PyGC_Head *unreachable,
|
@@ -619,7 +624,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
|
||||||
PyWeakReference **wrlist;
|
PyWeakReference **wrlist;
|
||||||
|
|
||||||
op = FROM_GC(gc);
|
op = FROM_GC(gc);
|
||||||
|
@ -229,7 +245,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
next = gc->gc.gc_next;
|
next = gc->gc.gc_next;
|
||||||
|
|
||||||
if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
|
if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
|
||||||
@@ -640,9 +645,9 @@ handle_weakrefs(PyGC_Head *unreachable,
|
@@ -640,9 +645,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
|
||||||
* the callback pointer intact. Obscure: it also
|
* the callback pointer intact. Obscure: it also
|
||||||
* changes *wrlist.
|
* changes *wrlist.
|
||||||
*/
|
*/
|
||||||
|
@ -241,7 +257,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
if (wr->wr_callback == NULL)
|
if (wr->wr_callback == NULL)
|
||||||
continue; /* no callback */
|
continue; /* no callback */
|
||||||
|
|
||||||
@@ -676,7 +681,7 @@ handle_weakrefs(PyGC_Head *unreachable,
|
@@ -676,7 +681,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
|
||||||
*/
|
*/
|
||||||
if (IS_TENTATIVELY_UNREACHABLE(wr))
|
if (IS_TENTATIVELY_UNREACHABLE(wr))
|
||||||
continue;
|
continue;
|
||||||
|
@ -250,7 +266,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
|
|
||||||
/* Create a new reference so that wr can't go away
|
/* Create a new reference so that wr can't go away
|
||||||
* before we can process it again.
|
* before we can process it again.
|
||||||
@@ -685,7 +690,8 @@ handle_weakrefs(PyGC_Head *unreachable,
|
@@ -685,7 +690,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
|
||||||
|
|
||||||
/* Move wr to wrcb_to_call, for the next pass. */
|
/* Move wr to wrcb_to_call, for the next pass. */
|
||||||
wrasgc = AS_GC(wr);
|
wrasgc = AS_GC(wr);
|
||||||
|
@ -260,7 +276,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
next isn't, so they can't
|
next isn't, so they can't
|
||||||
be the same */
|
be the same */
|
||||||
gc_list_move(wrasgc, &wrcb_to_call);
|
gc_list_move(wrasgc, &wrcb_to_call);
|
||||||
@@ -701,11 +707,11 @@ handle_weakrefs(PyGC_Head *unreachable,
|
@@ -701,11 +707,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
|
||||||
|
|
||||||
gc = wrcb_to_call.gc.gc_next;
|
gc = wrcb_to_call.gc.gc_next;
|
||||||
op = FROM_GC(gc);
|
op = FROM_GC(gc);
|
||||||
|
@ -292,35 +308,3 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c
|
||||||
if (_PyGCHead_REFS(gc) != 0)
|
if (_PyGCHead_REFS(gc) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
diff -up Lib/test/test_gc.py.old Lib/test/test_gc.py
|
|
||||||
--- Lib/test/test_gc.py.old 2014-12-10 11:19:33.503982288 +0100
|
|
||||||
+++ Lib/test/test_gc.py 2014-12-10 11:21:13.220021364 +0100
|
|
||||||
@@ -49,6 +49,8 @@ class GC_Detector(object):
|
|
||||||
# gc collects it.
|
|
||||||
self.wr = weakref.ref(C1055820(666), it_happened)
|
|
||||||
|
|
||||||
+BUILD_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS'])
|
|
||||||
+
|
|
||||||
@with_tp_del
|
|
||||||
class Uncollectable(object):
|
|
||||||
"""Create a reference cycle with multiple __del__ methods.
|
|
||||||
@@ -854,6 +856,8 @@ class GCCallbackTests(unittest.TestCase)
|
|
||||||
self.assertEqual(len(gc.garbage), 0)
|
|
||||||
|
|
||||||
|
|
||||||
+ @unittest.skipIf(BUILD_WITH_NDEBUG,
|
|
||||||
+ 'built with -NDEBUG')
|
|
||||||
def test_refcount_errors(self):
|
|
||||||
self.preclean()
|
|
||||||
# Verify the "handling" of objects with broken refcounts
|
|
||||||
diff -up Lib/test/test_gc.py.old Lib/test/test_gc.py
|
|
||||||
--- Lib/test/test_gc.py.old 2014-12-10 12:50:58.252121318 +0100
|
|
||||||
+++ Lib/test/test_gc.py 2014-12-10 12:51:08.594266653 +0100
|
|
||||||
@@ -4,6 +4,7 @@ from test.support import (verbose, refco
|
|
||||||
from test.support.script_helper import assert_python_ok, make_script
|
|
||||||
|
|
||||||
import sys
|
|
||||||
+import sysconfig
|
|
||||||
import time
|
|
||||||
import gc
|
|
||||||
import weakref
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
diff -r de35eae9048a config.sub
|
diff --git a/config.sub b/config.sub
|
||||||
--- a/config.sub Wed Apr 24 23:33:20 2013 +0200
|
index 3478c1f..e422173 100755
|
||||||
+++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
|
--- a/config.sub
|
||||||
@@ -1008,7 +1008,7 @@
|
+++ b/config.sub
|
||||||
|
@@ -1040,7 +1040,7 @@ case $basic_machine in
|
||||||
;;
|
;;
|
||||||
ppc64) basic_machine=powerpc64-unknown
|
ppc64) basic_machine=powerpc64-unknown
|
||||||
;;
|
;;
|
||||||
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
+ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
+ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
ppc64le | powerpc64little)
|
||||||
basic_machine=powerpc64le-unknown
|
basic_machine=powerpc64le-unknown
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
--- Python-3.3.2/setup.py.orig 2013-07-01 15:23:24.377711044 +0200
|
|
||||||
+++ Python-3.3.2/setup.py 2013-07-01 15:23:34.094676496 +0200
|
|
||||||
@@ -1882,7 +1882,8 @@
|
|
||||||
if not line:
|
|
||||||
ffi_inc = None
|
|
||||||
break
|
|
||||||
- if line.startswith('#define LIBFFI_H'):
|
|
||||||
+ if line.startswith('#define LIBFFI_H') or \
|
|
||||||
+ line.startswith('#define ffi_wrapper_h'):
|
|
||||||
break
|
|
||||||
ffi_lib = None
|
|
||||||
if ffi_inc is not None:
|
|
|
@ -1,17 +0,0 @@
|
||||||
diff -r 682a8e36dd18 Lib/test/test_pyexpat.py
|
|
||||||
--- a/Lib/test/test_pyexpat.py Tue Jul 05 17:08:52 2016 +0300
|
|
||||||
+++ b/Lib/test/test_pyexpat.py Thu Jul 07 17:04:35 2016 +0800
|
|
||||||
@@ -656,11 +656,9 @@
|
|
||||||
# \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
|
|
||||||
xml = b"<?xml version\xc2\x85='1.0'?>\r\n"
|
|
||||||
parser = expat.ParserCreate()
|
|
||||||
- try:
|
|
||||||
+ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
|
|
||||||
+ with self.assertRaisesRegex(expat.ExpatError, err_pattern):
|
|
||||||
parser.Parse(xml, True)
|
|
||||||
- self.fail()
|
|
||||||
- except expat.ExpatError as e:
|
|
||||||
- self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
|
|
||||||
|
|
||||||
class ErrorMessageTest(unittest.TestCase):
|
|
||||||
def test_codes(self):
|
|
|
@ -1,89 +0,0 @@
|
||||||
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
|
|
||||||
index 24a4156..d2c7991 100644
|
|
||||||
--- a/Doc/howto/urllib2.rst
|
|
||||||
+++ b/Doc/howto/urllib2.rst
|
|
||||||
@@ -538,6 +538,11 @@ setting up a `Basic Authentication`_ handler: ::
|
|
||||||
through a proxy. However, this can be enabled by extending urllib.request as
|
|
||||||
shown in the recipe [#]_.
|
|
||||||
|
|
||||||
+.. note::
|
|
||||||
+
|
|
||||||
+ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see
|
|
||||||
+ the documentation on :func:`~urllib.request.getproxies`.
|
|
||||||
+
|
|
||||||
|
|
||||||
Sockets and Layers
|
|
||||||
==================
|
|
||||||
diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst
|
|
||||||
index 6c1bfb8..1291aeb 100644
|
|
||||||
--- a/Doc/library/urllib.request.rst
|
|
||||||
+++ b/Doc/library/urllib.request.rst
|
|
||||||
@@ -173,6 +173,16 @@ The :mod:`urllib.request` module defines the following functions:
|
|
||||||
If both lowercase and uppercase environment variables exist (and disagree),
|
|
||||||
lowercase is preferred.
|
|
||||||
|
|
||||||
+ .. note::
|
|
||||||
+
|
|
||||||
+ If the environment variable ``REQUEST_METHOD`` is set, which usually
|
|
||||||
+ indicates your script is running in a CGI environment, the environment
|
|
||||||
+ variable ``HTTP_PROXY`` (uppercase ``_PROXY``) will be ignored. This is
|
|
||||||
+ because that variable can be injected by a client using the "Proxy:" HTTP
|
|
||||||
+ header. If you need to use an HTTP proxy in a CGI environment, either use
|
|
||||||
+ ``ProxyHandler`` explicitly, or make sure the variable name is in
|
|
||||||
+ lowercase (or at least the ``_proxy`` suffix).
|
|
||||||
+
|
|
||||||
|
|
||||||
The following classes are provided:
|
|
||||||
|
|
||||||
@@ -280,6 +290,11 @@ The following classes are provided:
|
|
||||||
list of hostname suffixes, optionally with ``:port`` appended, for example
|
|
||||||
``cern.ch,ncsa.uiuc.edu,some.host:8080``.
|
|
||||||
|
|
||||||
+ .. note::
|
|
||||||
+
|
|
||||||
+ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set;
|
|
||||||
+ see the documentation on :func:`~urllib.request.getproxies`.
|
|
||||||
+
|
|
||||||
|
|
||||||
.. class:: HTTPPasswordMgr()
|
|
||||||
|
|
||||||
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
|
|
||||||
index 5d05f8d..c26c52a 100644
|
|
||||||
--- a/Lib/test/test_urllib.py
|
|
||||||
+++ b/Lib/test/test_urllib.py
|
|
||||||
@@ -232,6 +232,18 @@ class ProxyTests(unittest.TestCase):
|
|
||||||
self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com:8888'))
|
|
||||||
self.assertTrue(urllib.request.proxy_bypass_environment('newdomain.com:1234'))
|
|
||||||
|
|
||||||
+ def test_proxy_cgi_ignore(self):
|
|
||||||
+ try:
|
|
||||||
+ self.env.set('HTTP_PROXY', 'http://somewhere:3128')
|
|
||||||
+ proxies = urllib.request.getproxies_environment()
|
|
||||||
+ self.assertEqual('http://somewhere:3128', proxies['http'])
|
|
||||||
+ self.env.set('REQUEST_METHOD', 'GET')
|
|
||||||
+ proxies = urllib.request.getproxies_environment()
|
|
||||||
+ self.assertNotIn('http', proxies)
|
|
||||||
+ finally:
|
|
||||||
+ self.env.unset('REQUEST_METHOD')
|
|
||||||
+ self.env.unset('HTTP_PROXY')
|
|
||||||
+
|
|
||||||
def test_proxy_bypass_environment_host_match(self):
|
|
||||||
bypass = urllib.request.proxy_bypass_environment
|
|
||||||
self.env.set('NO_PROXY',
|
|
||||||
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
|
|
||||||
index 1731fe3..3be327d 100644
|
|
||||||
--- a/Lib/urllib/request.py
|
|
||||||
+++ b/Lib/urllib/request.py
|
|
||||||
@@ -2412,6 +2412,12 @@ def getproxies_environment():
|
|
||||||
name = name.lower()
|
|
||||||
if value and name[-6:] == '_proxy':
|
|
||||||
proxies[name[:-6]] = value
|
|
||||||
+ # CVE-2016-1000110 - If we are running as CGI script, forget HTTP_PROXY
|
|
||||||
+ # (non-all-lowercase) as it may be set from the web server by a "Proxy:"
|
|
||||||
+ # header from the client
|
|
||||||
+ # If "proxy" is lowercase, it will still be used thanks to the next block
|
|
||||||
+ if 'REQUEST_METHOD' in os.environ:
|
|
||||||
+ proxies.pop('http', None)
|
|
||||||
for name, value in os.environ.items():
|
|
||||||
if name[-6:] == '_proxy':
|
|
||||||
name = name.lower()
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/Modules/getpath.c b/Modules/getpath.c
|
||||||
|
index c4055be..1258fcd 100644
|
||||||
|
--- a/Modules/getpath.c
|
||||||
|
+++ b/Modules/getpath.c
|
||||||
|
@@ -735,7 +735,7 @@ calculate_path(void)
|
||||||
|
bufsz += wcslen(zip_path) + 1;
|
||||||
|
bufsz += wcslen(exec_prefix) + 1;
|
||||||
|
|
||||||
|
- buf = PyMem_New(wchar_t, bufsz);
|
||||||
|
+ buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t));
|
||||||
|
if (buf == NULL) {
|
||||||
|
Py_FatalError(
|
||||||
|
"Not enough memory for dynamic PYTHONPATH");
|
|
@ -0,0 +1,25 @@
|
||||||
|
From c3c9db89273fabc62ea1b48389d9a3000c1c03ae Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jay Bosamiya <jaybosamiya@gmail.com>
|
||||||
|
Date: Sun, 18 Jun 2017 22:11:03 +0530
|
||||||
|
Subject: [PATCH] [2.7] bpo-30657: Check & prevent integer overflow in
|
||||||
|
PyString_DecodeEscape (#2174)
|
||||||
|
|
||||||
|
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
|
||||||
|
index 77dd45e..9b29dc3 100644
|
||||||
|
--- a/Objects/bytesobject.c
|
||||||
|
+++ b/Objects/bytesobject.c
|
||||||
|
@@ -970,7 +970,13 @@ PyObject *PyBytes_DecodeEscape(const char *s,
|
||||||
|
char *p, *buf;
|
||||||
|
const char *end;
|
||||||
|
PyObject *v;
|
||||||
|
- Py_ssize_t newlen = recode_encoding ? 4*len:len;
|
||||||
|
+ Py_ssize_t newlen;
|
||||||
|
+ /* Check for integer overflow */
|
||||||
|
+ if (recode_encoding && (len > PY_SSIZE_T_MAX / 4)) {
|
||||||
|
+ PyErr_SetString(PyExc_OverflowError, "string is too large");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+ newlen = recode_encoding ? 4*len:len;
|
||||||
|
v = PyBytes_FromStringAndSize((char *)NULL, newlen);
|
||||||
|
if (v == NULL)
|
||||||
|
return NULL;
|
|
@ -6,5 +6,5 @@
|
||||||
%py_byte_compile()\
|
%py_byte_compile()\
|
||||||
python_binary="%1"\
|
python_binary="%1"\
|
||||||
bytecode_compilation_path="%2"\
|
bytecode_compilation_path="%2"\
|
||||||
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\
|
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
79
python3.spec
79
python3.spec
|
@ -111,8 +111,8 @@
|
||||||
# ==================
|
# ==================
|
||||||
Summary: Version 3 of the Python programming language aka Python 3000
|
Summary: Version 3 of the Python programming language aka Python 3000
|
||||||
Name: python3
|
Name: python3
|
||||||
Version: %{pybasever}.2
|
Version: %{pybasever}.4
|
||||||
Release: 4%{?dist}
|
Release: 3%{?dist}
|
||||||
License: Python
|
License: Python
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
|
|
||||||
|
@ -342,14 +342,6 @@ Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch
|
||||||
# Not appropriate for upstream, Fedora-specific naming
|
# Not appropriate for upstream, Fedora-specific naming
|
||||||
Patch180: 00180-python-add-support-for-ppc64p7.patch
|
Patch180: 00180-python-add-support-for-ppc64p7.patch
|
||||||
|
|
||||||
# 00184 #
|
|
||||||
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=979696
|
|
||||||
# Fixes build of ctypes against libffi with multilib wrapper
|
|
||||||
# Python recognizes ffi.h only if it contains "#define LIBFFI_H",
|
|
||||||
# but the wrapper doesn't contain that, which makes the build fail
|
|
||||||
# We patch this by also accepting "#define ffi_wrapper_h"
|
|
||||||
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
|
|
||||||
|
|
||||||
# 00186 #
|
# 00186 #
|
||||||
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607
|
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607
|
||||||
# Previously, this fixed a problem where some *.py files were not being
|
# Previously, this fixed a problem where some *.py files were not being
|
||||||
|
@ -378,9 +370,7 @@ Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch
|
||||||
# Add the rewheel module, allowing to recreate wheels from already installed
|
# Add the rewheel module, allowing to recreate wheels from already installed
|
||||||
# ones
|
# ones
|
||||||
# https://github.com/bkabrda/rewheel
|
# https://github.com/bkabrda/rewheel
|
||||||
%if 0%{with_rewheel}
|
|
||||||
Patch189: 00189-add-rewheel-module.patch
|
Patch189: 00189-add-rewheel-module.patch
|
||||||
%endif
|
|
||||||
|
|
||||||
# 00205 #
|
# 00205 #
|
||||||
# LIBPL variable in makefile takes LIBPL from configure.ac
|
# LIBPL variable in makefile takes LIBPL from configure.ac
|
||||||
|
@ -392,20 +382,6 @@ Patch205: 00205-make-libpl-respect-lib64.patch
|
||||||
# by debian but fedora infra uses only eabi without hf
|
# by debian but fedora infra uses only eabi without hf
|
||||||
Patch206: 00206-remove-hf-from-arm-triplet.patch
|
Patch206: 00206-remove-hf-from-arm-triplet.patch
|
||||||
|
|
||||||
# 00209 #
|
|
||||||
# Fix test breakage with version 2.2.0 of Expat
|
|
||||||
# rhbz#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918
|
|
||||||
# FIXED UPSTREAM: http://bugs.python.org/issue27369
|
|
||||||
Patch209: 00209-fix-test-pyexpat-failure.patch
|
|
||||||
|
|
||||||
# 00242 #
|
|
||||||
# HTTPoxy attack (CVE-2016-1000110)
|
|
||||||
# https://httpoxy.org/
|
|
||||||
# FIXED UPSTREAM: http://bugs.python.org/issue27568
|
|
||||||
# Based on a patch by Rémi Rampin
|
|
||||||
# Resolves: rhbz#1359177
|
|
||||||
Patch242: 00242-CVE-2016-1000110-httpoxy.patch
|
|
||||||
|
|
||||||
# 00243 #
|
# 00243 #
|
||||||
# Fix the triplet used on 64-bit MIPS
|
# Fix the triplet used on 64-bit MIPS
|
||||||
# rhbz#1322526: https://bugzilla.redhat.com/show_bug.cgi?id=1322526
|
# rhbz#1322526: https://bugzilla.redhat.com/show_bug.cgi?id=1322526
|
||||||
|
@ -413,6 +389,17 @@ Patch242: 00242-CVE-2016-1000110-httpoxy.patch
|
||||||
# Fedora needs the default mips64-linux-gnu
|
# Fedora needs the default mips64-linux-gnu
|
||||||
Patch243: 00243-fix-mips64-triplet.patch
|
Patch243: 00243-fix-mips64-triplet.patch
|
||||||
|
|
||||||
|
# 00279 #
|
||||||
|
# Fix memory corruption due to allocator mix
|
||||||
|
# Fixed upstream: https://bugs.python.org/issue31532
|
||||||
|
Patch279: 00279-fix-memory-corruption-due-to-allocator-mix.patch
|
||||||
|
|
||||||
|
# 00286 #
|
||||||
|
# CVE-2017-1000158
|
||||||
|
# Check & prevent integer overflow in PyString_DecodeEscape
|
||||||
|
# Fixed upstream for Python 2 only: https://bugs.python.org/issue30657
|
||||||
|
Patch286: 00286-pystring-decodeescape-integer-overflow.patch
|
||||||
|
|
||||||
# (New patches go here ^^^)
|
# (New patches go here ^^^)
|
||||||
#
|
#
|
||||||
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
|
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
|
||||||
|
@ -643,7 +630,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en
|
||||||
%patch170 -p0
|
%patch170 -p0
|
||||||
%patch178 -p1
|
%patch178 -p1
|
||||||
%patch180 -p1
|
%patch180 -p1
|
||||||
%patch184 -p1
|
|
||||||
%patch186 -p1
|
%patch186 -p1
|
||||||
%patch188 -p1
|
%patch188 -p1
|
||||||
|
|
||||||
|
@ -653,9 +639,9 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en
|
||||||
|
|
||||||
%patch205 -p1
|
%patch205 -p1
|
||||||
%patch206 -p1
|
%patch206 -p1
|
||||||
%patch209 -p1
|
|
||||||
%patch242 -p1
|
|
||||||
%patch243 -p1
|
%patch243 -p1
|
||||||
|
%patch279 -p1
|
||||||
|
%patch286 -p1
|
||||||
|
|
||||||
# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there
|
# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there
|
||||||
# are many differences between 2.6 and the Python 3 library.
|
# are many differences between 2.6 and the Python 3 library.
|
||||||
|
@ -754,7 +740,11 @@ BuildPython debug \
|
||||||
BuildPython optimized \
|
BuildPython optimized \
|
||||||
python \
|
python \
|
||||||
python%{pybasever} \
|
python%{pybasever} \
|
||||||
|
%ifarch %{ix86} x86_64
|
||||||
|
"--without-ensurepip --enable-optimizations" \
|
||||||
|
%else
|
||||||
"--without-ensurepip" \
|
"--without-ensurepip" \
|
||||||
|
%endif
|
||||||
true
|
true
|
||||||
|
|
||||||
# ======================================================
|
# ======================================================
|
||||||
|
@ -1555,6 +1545,37 @@ rm -fr %{buildroot}
|
||||||
# ======================================================
|
# ======================================================
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Dec 01 2017 Miro Hrončok <mhroncok@redhat.com> - 3.5.4-3
|
||||||
|
- Fix for CVE-2017-1000158
|
||||||
|
- rhbz#1519604: https://bugzilla.redhat.com/show_bug.cgi?id=1519604
|
||||||
|
|
||||||
|
* Mon Oct 09 2017 Charalampos Stratakis <cstratak@redhat.com> - 3.5.4-2
|
||||||
|
- Fix memory corruption due to allocator mix
|
||||||
|
Resolves: rhbz#1498207
|
||||||
|
|
||||||
|
* Wed Aug 23 2017 Petr Viktorin <pviktori@redhat.com> - 3.5.4-1
|
||||||
|
- Update to 3.5.4
|
||||||
|
see https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-4
|
||||||
|
- Remove upstreamed patches (259, 267, 269)
|
||||||
|
|
||||||
|
* Wed May 10 2017 Charalampos Stratakis <cstratak@redhat.com> - 3.5.3-6
|
||||||
|
- Enable profile guided optimizations for x86_64 and i686 architectures
|
||||||
|
|
||||||
|
* Mon Apr 24 2017 Charalampos Stratakis <cstratak@redhat.com> - 3.5.3-5
|
||||||
|
- Make pip installable in a new venv when using the --system-site-packages flag
|
||||||
|
|
||||||
|
* Tue Mar 21 2017 Tomas Orsava <torsava@redhat.com> - 3.5.3-4
|
||||||
|
- Fix syntax error in %%py_byte_compile macro (rhbz#1433569)
|
||||||
|
|
||||||
|
* Wed Mar 8 2017 Iryna Shcherbina <ishcherb@redhat.com> - 3.5.3-3
|
||||||
|
- Replace patch 259 with a backported upstream patch
|
||||||
|
|
||||||
|
* Thu Feb 09 2017 Petr Viktorin <pviktori@redhat.com> - 3.5.3-2
|
||||||
|
- Add patch 259 to work around magic number bump in Python 3.5.3
|
||||||
|
|
||||||
|
* Tue Jan 31 2017 Iryna Shcherbina <ishcherb@redhat.com> - 3.5.3-1
|
||||||
|
- Rebased to version 3.5.3
|
||||||
|
|
||||||
* Wed Sep 14 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.5.2-4
|
* Wed Sep 14 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.5.2-4
|
||||||
- Obsolete and Provide python35 package
|
- Obsolete and Provide python35 package
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue