• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# This is a valgrind suppression file that should be used when using valgrind.
3#
4#  Here's an example of running valgrind:
5#
6#	cd python/dist/src
7#	valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
8#		./python -E ./Lib/test/regrtest.py -u gui,network
9#
10# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
11# to use the preferred suppressions with address_in_range.
12#
13# If you do not want to recompile Python, you can uncomment
14# suppressions for _PyObject_Free and _PyObject_Realloc.
15#
16# See Misc/README.valgrind for more information.
17
18# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif
19{
20   ADDRESS_IN_RANGE/Invalid read of size 4
21   Memcheck:Addr4
22   fun:address_in_range
23}
24
25{
26   ADDRESS_IN_RANGE/Invalid read of size 4
27   Memcheck:Value4
28   fun:address_in_range
29}
30
31{
32   ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
33   Memcheck:Value8
34   fun:address_in_range
35}
36
37{
38   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
39   Memcheck:Cond
40   fun:address_in_range
41}
42
43#
44# Leaks (including possible leaks)
45#    Hmmm, I wonder if this masks some real leaks.  I think it does.
46#    Will need to fix that.
47#
48
49{
50   Suppress leaking the GIL.  Happens once per process, see comment in ceval.c.
51   Memcheck:Leak
52   fun:malloc
53   fun:PyThread_allocate_lock
54   fun:PyEval_InitThreads
55}
56
57{
58   Suppress leaking the GIL after a fork.
59   Memcheck:Leak
60   fun:malloc
61   fun:PyThread_allocate_lock
62   fun:PyEval_ReInitThreads
63}
64
65{
66   Suppress leaking the autoTLSkey.  This looks like it shouldn't leak though.
67   Memcheck:Leak
68   fun:malloc
69   fun:PyThread_create_key
70   fun:_PyGILState_Init
71   fun:Py_InitializeEx
72   fun:Py_Main
73}
74
75{
76   Hmmm, is this a real leak or like the GIL?
77   Memcheck:Leak
78   fun:malloc
79   fun:PyThread_ReInitTLS
80}
81
82{
83   Handle PyMalloc confusing valgrind (possibly leaked)
84   Memcheck:Leak
85   fun:realloc
86   fun:_PyObject_GC_Resize
87   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
88}
89
90{
91   Handle PyMalloc confusing valgrind (possibly leaked)
92   Memcheck:Leak
93   fun:malloc
94   fun:_PyObject_GC_New
95   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
96}
97
98{
99   Handle PyMalloc confusing valgrind (possibly leaked)
100   Memcheck:Leak
101   fun:malloc
102   fun:_PyObject_GC_NewVar
103   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
104}
105
106#
107# Non-python specific leaks
108#
109
110{
111   Handle pthread issue (possibly leaked)
112   Memcheck:Leak
113   fun:calloc
114   fun:allocate_dtv
115   fun:_dl_allocate_tls_storage
116   fun:_dl_allocate_tls
117}
118
119{
120   Handle pthread issue (possibly leaked)
121   Memcheck:Leak
122   fun:memalign
123   fun:_dl_allocate_tls_storage
124   fun:_dl_allocate_tls
125}
126
127###{
128###   ADDRESS_IN_RANGE/Invalid read of size 4
129###   Memcheck:Addr4
130###   fun:_PyObject_Free
131###}
132###
133###{
134###   ADDRESS_IN_RANGE/Invalid read of size 4
135###   Memcheck:Value4
136###   fun:_PyObject_Free
137###}
138###
139###{
140###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
141###   Memcheck:Addr8
142###   fun:_PyObject_Free
143###}
144###
145###{
146###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
147###   Memcheck:Value8
148###   fun:_PyObject_Free
149###}
150###
151###{
152###   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
153###   Memcheck:Cond
154###   fun:_PyObject_Free
155###}
156
157###{
158###   ADDRESS_IN_RANGE/Invalid read of size 4
159###   Memcheck:Addr4
160###   fun:_PyObject_Realloc
161###}
162###
163###{
164###   ADDRESS_IN_RANGE/Invalid read of size 4
165###   Memcheck:Value4
166###   fun:_PyObject_Realloc
167###}
168###
169###{
170###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
171###   Memcheck:Addr8
172###   fun:_PyObject_Realloc
173###}
174###
175###{
176###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
177###   Memcheck:Value8
178###   fun:_PyObject_Realloc
179###}
180###
181###{
182###   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
183###   Memcheck:Cond
184###   fun:_PyObject_Realloc
185###}
186
187###
188### All the suppressions below are for errors that occur within libraries
189### that Python uses.  The problems to not appear to be related to Python's
190### use of the libraries.
191###
192
193{
194   Generic ubuntu ld problems
195   Memcheck:Addr8
196   obj:/lib/ld-2.4.so
197   obj:/lib/ld-2.4.so
198   obj:/lib/ld-2.4.so
199   obj:/lib/ld-2.4.so
200}
201
202{
203   Generic gentoo ld problems
204   Memcheck:Cond
205   obj:/lib/ld-2.3.4.so
206   obj:/lib/ld-2.3.4.so
207   obj:/lib/ld-2.3.4.so
208   obj:/lib/ld-2.3.4.so
209}
210
211{
212   DBM problems, see test_dbm
213   Memcheck:Param
214   write(buf)
215   fun:write
216   obj:/usr/lib/libdb1.so.2
217   obj:/usr/lib/libdb1.so.2
218   obj:/usr/lib/libdb1.so.2
219   obj:/usr/lib/libdb1.so.2
220   fun:dbm_close
221}
222
223{
224   DBM problems, see test_dbm
225   Memcheck:Value8
226   fun:memmove
227   obj:/usr/lib/libdb1.so.2
228   obj:/usr/lib/libdb1.so.2
229   obj:/usr/lib/libdb1.so.2
230   obj:/usr/lib/libdb1.so.2
231   fun:dbm_store
232   fun:dbm_ass_sub
233}
234
235{
236   DBM problems, see test_dbm
237   Memcheck:Cond
238   obj:/usr/lib/libdb1.so.2
239   obj:/usr/lib/libdb1.so.2
240   obj:/usr/lib/libdb1.so.2
241   fun:dbm_store
242   fun:dbm_ass_sub
243}
244
245{
246   DBM problems, see test_dbm
247   Memcheck:Cond
248   fun:memmove
249   obj:/usr/lib/libdb1.so.2
250   obj:/usr/lib/libdb1.so.2
251   obj:/usr/lib/libdb1.so.2
252   obj:/usr/lib/libdb1.so.2
253   fun:dbm_store
254   fun:dbm_ass_sub
255}
256
257{
258   GDBM problems, see test_gdbm
259   Memcheck:Param
260   write(buf)
261   fun:write
262   fun:gdbm_open
263
264}
265
266{
267   Uninitialised byte(s) false alarm, see bpo-35561
268   Memcheck:Param
269   epoll_ctl(event)
270   fun:epoll_ctl
271   fun:pyepoll_internal_ctl
272}
273
274{
275   ZLIB problems, see test_gzip
276   Memcheck:Cond
277   obj:/lib/libz.so.1.2.3
278   obj:/lib/libz.so.1.2.3
279   fun:deflate
280}
281
282{
283   Avoid problems w/readline doing a putenv and leaking on exit
284   Memcheck:Leak
285   fun:malloc
286   fun:xmalloc
287   fun:sh_set_lines_and_columns
288   fun:_rl_get_screen_size
289   fun:_rl_init_terminal_io
290   obj:/lib/libreadline.so.4.3
291   fun:rl_initialize
292}
293
294# Valgrind emits "Conditional jump or move depends on uninitialised value(s)"
295# false alarms on GCC builtin strcmp() function. The GCC code is correct.
296#
297# Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=264936
298{
299   bpo-38118: Valgrind emits false alarm on GCC builtin strcmp()
300   Memcheck:Cond
301   fun:PyUnicode_Decode
302}
303
304
305###
306### These occur from somewhere within the SSL, when running
307###  test_socket_sll.  They are too general to leave on by default.
308###
309###{
310###   somewhere in SSL stuff
311###   Memcheck:Cond
312###   fun:memset
313###}
314###{
315###   somewhere in SSL stuff
316###   Memcheck:Value4
317###   fun:memset
318###}
319###
320###{
321###   somewhere in SSL stuff
322###   Memcheck:Cond
323###   fun:MD5_Update
324###}
325###
326###{
327###   somewhere in SSL stuff
328###   Memcheck:Value4
329###   fun:MD5_Update
330###}
331
332# Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" on x86_64
333# See http://bugs.python.org/issue14171
334{
335   openssl 1.0.1 prng 1
336   Memcheck:Cond
337   fun:bcmp
338   fun:fips_get_entropy
339   fun:FIPS_drbg_instantiate
340   fun:RAND_init_fips
341   fun:OPENSSL_init_library
342   fun:SSL_library_init
343   fun:init_hashlib
344}
345
346{
347   openssl 1.0.1 prng 2
348   Memcheck:Cond
349   fun:fips_get_entropy
350   fun:FIPS_drbg_instantiate
351   fun:RAND_init_fips
352   fun:OPENSSL_init_library
353   fun:SSL_library_init
354   fun:init_hashlib
355}
356
357{
358   openssl 1.0.1 prng 3
359   Memcheck:Value8
360   fun:_x86_64_AES_encrypt_compact
361   fun:AES_encrypt
362}
363
364#
365# All of these problems come from using test_socket_ssl
366#
367{
368   from test_socket_ssl
369   Memcheck:Cond
370   fun:BN_bin2bn
371}
372
373{
374   from test_socket_ssl
375   Memcheck:Cond
376   fun:BN_num_bits_word
377}
378
379{
380   from test_socket_ssl
381   Memcheck:Value4
382   fun:BN_num_bits_word
383}
384
385{
386   from test_socket_ssl
387   Memcheck:Cond
388   fun:BN_mod_exp_mont_word
389}
390
391{
392   from test_socket_ssl
393   Memcheck:Cond
394   fun:BN_mod_exp_mont
395}
396
397{
398   from test_socket_ssl
399   Memcheck:Param
400   write(buf)
401   fun:write
402   obj:/usr/lib/libcrypto.so.0.9.7
403}
404
405{
406   from test_socket_ssl
407   Memcheck:Cond
408   fun:RSA_verify
409}
410
411{
412   from test_socket_ssl
413   Memcheck:Value4
414   fun:RSA_verify
415}
416
417{
418   from test_socket_ssl
419   Memcheck:Value4
420   fun:DES_set_key_unchecked
421}
422
423{
424   from test_socket_ssl
425   Memcheck:Value4
426   fun:DES_encrypt2
427}
428
429{
430   from test_socket_ssl
431   Memcheck:Cond
432   obj:/usr/lib/libssl.so.0.9.7
433}
434
435{
436   from test_socket_ssl
437   Memcheck:Value4
438   obj:/usr/lib/libssl.so.0.9.7
439}
440
441{
442   from test_socket_ssl
443   Memcheck:Cond
444   fun:BUF_MEM_grow_clean
445}
446
447{
448   from test_socket_ssl
449   Memcheck:Cond
450   fun:memcpy
451   fun:ssl3_read_bytes
452}
453
454{
455   from test_socket_ssl
456   Memcheck:Cond
457   fun:SHA1_Update
458}
459
460{
461   from test_socket_ssl
462   Memcheck:Value4
463   fun:SHA1_Update
464}
465
466{
467   test_buffer_non_debug
468   Memcheck:Addr4
469   fun:PyUnicodeUCS2_FSConverter
470}
471
472{
473   test_buffer_non_debug
474   Memcheck:Addr4
475   fun:PyUnicode_FSConverter
476}
477
478{
479   wcscmp_false_positive
480   Memcheck:Addr8
481   fun:wcscmp
482   fun:_PyOS_GetOpt
483   fun:Py_Main
484   fun:main
485}
486
487# Additional suppressions for the unified decimal tests:
488{
489   test_decimal
490   Memcheck:Addr4
491   fun:PyUnicodeUCS2_FSConverter
492}
493
494{
495   test_decimal2
496   Memcheck:Addr4
497   fun:PyUnicode_FSConverter
498}
499
500