Skip to content

Commit 45ed9ea

Browse files
committedNov 24, 2023
Tests: update leak config/suppressions
1 parent 61057f2 commit 45ed9ea

File tree

2 files changed

+111
-43
lines changed

2 files changed

+111
-43
lines changed
 

‎test/leak/leak.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
2+
set -e
23

34
if ! type valgrind >/dev/null; then
45
echo "Please install valgrind before running memory leak tests"
@@ -7,14 +8,15 @@ fi
78

89
curl -s -o ./test/leak/libvips.supp https://raw.githubusercontent.com/libvips/libvips/master/suppressions/valgrind.supp
910

10-
for test in ./test/unit/*.js; do
11+
TESTS=$(ls test/unit --ignore=svg.js --ignore=text.js)
12+
for test in $TESTS; do
1113
G_SLICE=always-malloc G_DEBUG=gc-friendly VIPS_LEAK=1 VIPS_NOVECTOR=1 valgrind \
1214
--suppressions=test/leak/libvips.supp \
1315
--suppressions=test/leak/sharp.supp \
1416
--gen-suppressions=yes \
1517
--leak-check=full \
16-
--show-leak-kinds=definite,indirect,possible \
18+
--show-leak-kinds=definite,indirect \
1719
--num-callers=20 \
1820
--trace-children=yes \
19-
node --expose-gc node_modules/.bin/mocha --no-config --slow=60000 --timeout=120000 --require test/beforeEach.js "$test";
21+
node --expose-gc --zero-fill-buffers node_modules/.bin/mocha --no-config --slow=60000 --timeout=120000 --require test/beforeEach.js "test/unit/$test";
2022
done

‎test/leak/sharp.supp

+105-39
Original file line numberDiff line numberDiff line change
@@ -173,41 +173,6 @@
173173
fun:TIFFWriteEncodedTile
174174
}
175175

176-
# gsf
177-
{
178-
param_gsf_output_write
179-
Memcheck:Param
180-
write(buf)
181-
fun:write
182-
...
183-
fun:gsf_output_write
184-
}
185-
{
186-
value_gsf_output_write_crc32_little
187-
Memcheck:Value8
188-
fun:crc32_little
189-
...
190-
fun:gsf_output_write
191-
}
192-
{
193-
param_gsf_new_do_write
194-
Memcheck:Param
195-
write(buf)
196-
...
197-
fun:new_do_write
198-
...
199-
fun:gsf_output_close
200-
}
201-
{
202-
param_gsf_output_write
203-
Memcheck:Param
204-
write(buf)
205-
...
206-
fun:new_do_write
207-
...
208-
fun:gsf_output_write
209-
}
210-
211176
# fontconfig
212177
{
213178
leak_fontconfig_FcConfigSubstituteWithPat
@@ -349,11 +314,39 @@
349314
fun:heif_context_read_from_reader
350315
}
351316

352-
# orc
317+
# glib
318+
{
319+
leak_glib__tls_get_addr
320+
Memcheck:Leak
321+
match-leak-kinds: possible
322+
...
323+
fun:malloc
324+
fun:allocate_dtv_entry
325+
fun:allocate_and_init
326+
fun:tls_get_addr_tail
327+
fun:__tls_get_addr
328+
}
329+
{
330+
value_g_utf8_make_valid_strlen
331+
Memcheck:Value8
332+
fun:strlen
333+
fun:g_utf8_make_valid
334+
}
335+
{
336+
value_g_utf8_make_valid_strncpy
337+
Memcheck:Value8
338+
fun:strncpy
339+
fun:g_strndup
340+
...
341+
fun:g_utf8_make_valid
342+
}
353343
{
354-
addr_orcexec
355-
Memcheck:Addr1
356-
obj:*/orcexec.*
344+
cond_g_utf8_make_valid_strncpy
345+
Memcheck:Cond
346+
fun:strncpy
347+
fun:g_strndup
348+
...
349+
fun:g_utf8_make_valid
357350
}
358351

359352
# libvips
@@ -943,6 +936,79 @@
943936
...
944937
fun:_ZN2v88internal18ArrayBufferSweeper10ReleaseAllEv
945938
}
939+
{
940+
cond_node_Builtins_JSEntry
941+
Memcheck:Cond
942+
...
943+
fun:Builtins_JSEntry
944+
...
945+
fun:uv__poll_io_uring
946+
}
947+
{
948+
cond_node_Builtins_TestEqualStrictHandler
949+
Memcheck:Cond
950+
fun:Builtins_TestEqualStrictHandler
951+
...
952+
fun:uv__poll_io_uring
953+
}
954+
{
955+
cond_node_Builtins_TestGreaterThanHandler
956+
Memcheck:Cond
957+
fun:Builtins_TestGreaterThanHandler
958+
...
959+
fun:uv__poll_io_uring
960+
}
961+
{
962+
cond_node_AfterStat
963+
Memcheck:Cond
964+
...
965+
fun:_ZN4node2fs9AfterStatEP7uv_fs_s
966+
...
967+
fun:uv__poll_io_uring
968+
}
969+
{
970+
cond_node_AfterMkdirp
971+
Memcheck:Cond
972+
fun:_ZN4node2fs11AfterMkdirpEP7uv_fs_s
973+
fun:_ZN4node24MakeLibuvRequestCallbackI7uv_fs_sPFvPS1_EE7WrapperES2_
974+
fun:_ZZZN4node2fs11MKDirpAsyncEP9uv_loop_sP7uv_fs_sPKciPFvS4_EENKUlS4_E_clES4_ENUlS4_E_4_FUNES4_
975+
fun:uv__poll_io_uring
976+
}
977+
{
978+
cond_v8_ArrayBufferSweeper_Finalize
979+
Memcheck:Cond
980+
fun:_ZN2v88internal18ArrayBufferSweeper8FinalizeEv
981+
}
982+
{
983+
cond_v8_AdjustAmountOfExternalAllocatedMemory
984+
Memcheck:Cond
985+
fun:_ZN2v87Isolate37AdjustAmountOfExternalAllocatedMemoryEl
986+
}
987+
{
988+
cond_v8_IncrementalMarkingLimitReached
989+
Memcheck:Cond
990+
fun:_ZN2v88internal4Heap30IncrementalMarkingLimitReachedEv
991+
}
992+
{
993+
cond_v8_ShouldExpandOldGenerationOnSlowAllocation
994+
Memcheck:Cond
995+
fun:_ZN2v88internal4Heap41ShouldExpandOldGenerationOnSlowAllocationEPNS0_9LocalHeapENS0_16AllocationOriginE
996+
}
997+
{
998+
cond_v8_ArrayBufferSweeper_SweepingJob_SweepListFull
999+
Memcheck:Cond
1000+
fun:_ZN2v88internal18ArrayBufferSweeper11SweepingJob13SweepListFullEPNS0_15ArrayBufferListE
1001+
}
1002+
{
1003+
cond_v8_ArrayBufferSweeper_SweepingJob_SweepYoung
1004+
Memcheck:Cond
1005+
fun:_ZN2v88internal18ArrayBufferSweeper11SweepingJob10SweepYoungEv
1006+
}
1007+
{
1008+
cond_v8_StartIncrementalMarkingIfAllocationLimitIsReachedBackground
1009+
Memcheck:Cond
1010+
fun:_ZN2v88internal4Heap59StartIncrementalMarkingIfAllocationLimitIsReachedBackgroundEv
1011+
}
9461012
{
9471013
addr_v8_ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0
9481014
Memcheck:Addr8

0 commit comments

Comments
 (0)
Please sign in to comment.