• 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 after a fork.
51   Memcheck:Leak
52   fun:malloc
53   fun:PyThread_allocate_lock
54   fun:PyEval_ReInitThreads
55}
56
57{
58   Suppress leaking the autoTLSkey.  This looks like it shouldn't leak though.
59   Memcheck:Leak
60   fun:malloc
61   fun:PyThread_create_key
62   fun:_PyGILState_Init
63   fun:Py_InitializeEx
64   fun:Py_Main
65}
66
67{
68   Hmmm, is this a real leak or like the GIL?
69   Memcheck:Leak
70   fun:malloc
71   fun:PyThread_ReInitTLS
72}
73
74{
75   Handle PyMalloc confusing valgrind (possibly leaked)
76   Memcheck:Leak
77   fun:realloc
78   fun:_PyObject_GC_Resize
79   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
80}
81
82{
83   Handle PyMalloc confusing valgrind (possibly leaked)
84   Memcheck:Leak
85   fun:malloc
86   fun:_PyObject_GC_New
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_NewVar
95   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
96}
97
98#
99# Leaks: dlopen() called without dlclose()
100#
101
102{
103   dlopen() called without dlclose()
104   Memcheck:Leak
105   fun:malloc
106   fun:malloc
107   fun:strdup
108   fun:_dl_load_cache_lookup
109}
110{
111   dlopen() called without dlclose()
112   Memcheck:Leak
113   fun:malloc
114   fun:malloc
115   fun:strdup
116   fun:_dl_map_object
117}
118{
119   dlopen() called without dlclose()
120   Memcheck:Leak
121   fun:malloc
122   fun:*
123   fun:_dl_new_object
124}
125{
126   dlopen() called without dlclose()
127   Memcheck:Leak
128   fun:calloc
129   fun:*
130   fun:_dl_new_object
131}
132{
133   dlopen() called without dlclose()
134   Memcheck:Leak
135   fun:calloc
136   fun:*
137   fun:_dl_check_map_versions
138}
139
140
141#
142# Non-python specific leaks
143#
144
145{
146   Handle pthread issue (possibly leaked)
147   Memcheck:Leak
148   fun:calloc
149   fun:allocate_dtv
150   fun:_dl_allocate_tls_storage
151   fun:_dl_allocate_tls
152}
153
154{
155   Handle pthread issue (possibly leaked)
156   Memcheck:Leak
157   fun:memalign
158   fun:_dl_allocate_tls_storage
159   fun:_dl_allocate_tls
160}
161
162###{
163###   ADDRESS_IN_RANGE/Invalid read of size 4
164###   Memcheck:Addr4
165###   fun:_PyObject_Free
166###}
167###
168###{
169###   ADDRESS_IN_RANGE/Invalid read of size 4
170###   Memcheck:Value4
171###   fun:_PyObject_Free
172###}
173###
174###{
175###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
176###   Memcheck:Addr8
177###   fun:_PyObject_Free
178###}
179###
180###{
181###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
182###   Memcheck:Value8
183###   fun:_PyObject_Free
184###}
185###
186###{
187###   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
188###   Memcheck:Cond
189###   fun:_PyObject_Free
190###}
191
192###{
193###   ADDRESS_IN_RANGE/Invalid read of size 4
194###   Memcheck:Addr4
195###   fun:_PyObject_Realloc
196###}
197###
198###{
199###   ADDRESS_IN_RANGE/Invalid read of size 4
200###   Memcheck:Value4
201###   fun:_PyObject_Realloc
202###}
203###
204###{
205###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
206###   Memcheck:Addr8
207###   fun:_PyObject_Realloc
208###}
209###
210###{
211###   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
212###   Memcheck:Value8
213###   fun:_PyObject_Realloc
214###}
215###
216###{
217###   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
218###   Memcheck:Cond
219###   fun:_PyObject_Realloc
220###}
221
222###
223### All the suppressions below are for errors that occur within libraries
224### that Python uses.  The problems to not appear to be related to Python's
225### use of the libraries.
226###
227
228{
229   Generic ubuntu ld problems
230   Memcheck:Addr8
231   obj:/lib/ld-2.4.so
232   obj:/lib/ld-2.4.so
233   obj:/lib/ld-2.4.so
234   obj:/lib/ld-2.4.so
235}
236
237{
238   Generic gentoo ld problems
239   Memcheck:Cond
240   obj:/lib/ld-2.3.4.so
241   obj:/lib/ld-2.3.4.so
242   obj:/lib/ld-2.3.4.so
243   obj:/lib/ld-2.3.4.so
244}
245
246{
247   DBM problems, see test_dbm
248   Memcheck:Param
249   write(buf)
250   fun:write
251   obj:/usr/lib/libdb1.so.2
252   obj:/usr/lib/libdb1.so.2
253   obj:/usr/lib/libdb1.so.2
254   obj:/usr/lib/libdb1.so.2
255   fun:dbm_close
256}
257
258{
259   DBM problems, see test_dbm
260   Memcheck:Value8
261   fun:memmove
262   obj:/usr/lib/libdb1.so.2
263   obj:/usr/lib/libdb1.so.2
264   obj:/usr/lib/libdb1.so.2
265   obj:/usr/lib/libdb1.so.2
266   fun:dbm_store
267   fun:dbm_ass_sub
268}
269
270{
271   DBM problems, see test_dbm
272   Memcheck:Cond
273   obj:/usr/lib/libdb1.so.2
274   obj:/usr/lib/libdb1.so.2
275   obj:/usr/lib/libdb1.so.2
276   fun:dbm_store
277   fun:dbm_ass_sub
278}
279
280{
281   DBM problems, see test_dbm
282   Memcheck:Cond
283   fun:memmove
284   obj:/usr/lib/libdb1.so.2
285   obj:/usr/lib/libdb1.so.2
286   obj:/usr/lib/libdb1.so.2
287   obj:/usr/lib/libdb1.so.2
288   fun:dbm_store
289   fun:dbm_ass_sub
290}
291
292{
293   GDBM problems, see test_gdbm
294   Memcheck:Param
295   write(buf)
296   fun:write
297   fun:gdbm_open
298
299}
300
301{
302   Uninitialised byte(s) false alarm, see bpo-35561
303   Memcheck:Param
304   epoll_ctl(event)
305   fun:epoll_ctl
306   fun:pyepoll_internal_ctl
307}
308
309{
310   ZLIB problems, see test_gzip
311   Memcheck:Cond
312   obj:/lib/libz.so.1.2.3
313   obj:/lib/libz.so.1.2.3
314   fun:deflate
315}
316
317{
318   Avoid problems w/readline doing a putenv and leaking on exit
319   Memcheck:Leak
320   fun:malloc
321   fun:xmalloc
322   fun:sh_set_lines_and_columns
323   fun:_rl_get_screen_size
324   fun:_rl_init_terminal_io
325   obj:/lib/libreadline.so.4.3
326   fun:rl_initialize
327}
328
329# Valgrind emits "Conditional jump or move depends on uninitialised value(s)"
330# false alarms on GCC builtin strcmp() function. The GCC code is correct.
331#
332# Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=264936
333{
334   bpo-38118: Valgrind emits false alarm on GCC builtin strcmp()
335   Memcheck:Cond
336   fun:PyUnicode_Decode
337}
338
339
340###
341### These occur from somewhere within the SSL, when running
342###  test_socket_sll.  They are too general to leave on by default.
343###
344###{
345###   somewhere in SSL stuff
346###   Memcheck:Cond
347###   fun:memset
348###}
349###{
350###   somewhere in SSL stuff
351###   Memcheck:Value4
352###   fun:memset
353###}
354###
355###{
356###   somewhere in SSL stuff
357###   Memcheck:Cond
358###   fun:MD5_Update
359###}
360###
361###{
362###   somewhere in SSL stuff
363###   Memcheck:Value4
364###   fun:MD5_Update
365###}
366
367# Fedora's package "openssl-1.0.1-0.1.beta2.fc17.x86_64" on x86_64
368# See http://bugs.python.org/issue14171
369{
370   openssl 1.0.1 prng 1
371   Memcheck:Cond
372   fun:bcmp
373   fun:fips_get_entropy
374   fun:FIPS_drbg_instantiate
375   fun:RAND_init_fips
376   fun:OPENSSL_init_library
377   fun:SSL_library_init
378   fun:init_hashlib
379}
380
381{
382   openssl 1.0.1 prng 2
383   Memcheck:Cond
384   fun:fips_get_entropy
385   fun:FIPS_drbg_instantiate
386   fun:RAND_init_fips
387   fun:OPENSSL_init_library
388   fun:SSL_library_init
389   fun:init_hashlib
390}
391
392{
393   openssl 1.0.1 prng 3
394   Memcheck:Value8
395   fun:_x86_64_AES_encrypt_compact
396   fun:AES_encrypt
397}
398
399#
400# All of these problems come from using test_socket_ssl
401#
402{
403   from test_socket_ssl
404   Memcheck:Cond
405   fun:BN_bin2bn
406}
407
408{
409   from test_socket_ssl
410   Memcheck:Cond
411   fun:BN_num_bits_word
412}
413
414{
415   from test_socket_ssl
416   Memcheck:Value4
417   fun:BN_num_bits_word
418}
419
420{
421   from test_socket_ssl
422   Memcheck:Cond
423   fun:BN_mod_exp_mont_word
424}
425
426{
427   from test_socket_ssl
428   Memcheck:Cond
429   fun:BN_mod_exp_mont
430}
431
432{
433   from test_socket_ssl
434   Memcheck:Param
435   write(buf)
436   fun:write
437   obj:/usr/lib/libcrypto.so.0.9.7
438}
439
440{
441   from test_socket_ssl
442   Memcheck:Cond
443   fun:RSA_verify
444}
445
446{
447   from test_socket_ssl
448   Memcheck:Value4
449   fun:RSA_verify
450}
451
452{
453   from test_socket_ssl
454   Memcheck:Value4
455   fun:DES_set_key_unchecked
456}
457
458{
459   from test_socket_ssl
460   Memcheck:Value4
461   fun:DES_encrypt2
462}
463
464{
465   from test_socket_ssl
466   Memcheck:Cond
467   obj:/usr/lib/libssl.so.0.9.7
468}
469
470{
471   from test_socket_ssl
472   Memcheck:Value4
473   obj:/usr/lib/libssl.so.0.9.7
474}
475
476{
477   from test_socket_ssl
478   Memcheck:Cond
479   fun:BUF_MEM_grow_clean
480}
481
482{
483   from test_socket_ssl
484   Memcheck:Cond
485   fun:memcpy
486   fun:ssl3_read_bytes
487}
488
489{
490   from test_socket_ssl
491   Memcheck:Cond
492   fun:SHA1_Update
493}
494
495{
496   from test_socket_ssl
497   Memcheck:Value4
498   fun:SHA1_Update
499}
500
501{
502   test_buffer_non_debug
503   Memcheck:Addr4
504   fun:PyUnicodeUCS2_FSConverter
505}
506
507{
508   test_buffer_non_debug
509   Memcheck:Addr4
510   fun:PyUnicode_FSConverter
511}
512
513{
514   wcscmp_false_positive
515   Memcheck:Addr8
516   fun:wcscmp
517   fun:_PyOS_GetOpt
518   fun:Py_Main
519   fun:main
520}
521
522# Additional suppressions for the unified decimal tests:
523{
524   test_decimal
525   Memcheck:Addr4
526   fun:PyUnicodeUCS2_FSConverter
527}
528
529{
530   test_decimal2
531   Memcheck:Addr4
532   fun:PyUnicode_FSConverter
533}
534
535