From bf88f6577ff9f28860e745f516400f2ccc80c580 Mon Sep 17 00:00:00 2001 From: poop Date: Wed, 15 Mar 2023 14:31:52 -0700 Subject: [PATCH] Use --mm:orc -d:useMalloc with Valgrind in order to avoid false positives. --- testresults.html | 99 ++++++++++++++++++++++++++++++++++------ tests/config.nims | 2 + tests/config/tconfig.nim | 2 +- 3 files changed, 88 insertions(+), 15 deletions(-) diff --git a/testresults.html b/testresults.html index b54980e..83ee5a7 100644 --- a/testresults.html +++ b/testresults.html @@ -126,9 +126,9 @@

Testament Test Results Nim Tester

Hostname
spaceship
Git Commit
-
62df3610e8a
+
39b89ad1b5f
Branch ref.
-
manifest
+
bug/valgrind-fails-on-asyncdispatch-and-threadpool-import
All Tests
@@ -139,7 +139,7 @@

Testament Test Results Nim Tester

Successful Tests
- 2 (100.00%) + 1 (50.00%)
Skipped Tests
@@ -149,7 +149,7 @@

Testament Test Results Nim Tester

Failed Tests
- 0 (0.00%) + 1 (50.00%)
@@ -231,34 +231,105 @@

boatNo output details

-
+
-
+
Name
-
tests/config/tconfig.nim c
+
tests/config/tconfig.nim c
Category
config
Timestamp
unknown
Nim Action
-
run
+
run
Nim Backend Target
c
Code
-
reSuccess
+
reExitcodesDiffer
-

No output details

+
+ + + + + + + + + + + + + +
ExpectedActual
exitcode: 0
exitcode: 1
+
+Output:
+==395791== Memcheck, a memory error detector
+==395791== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
+==395791== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
+==395791== Command: tests/config/tconfig
+==395791== 
+ref Exception(parent: nil, name: "OSError", msg: "No such file or directory\n
+Additional info: 192.168.1.1", trace: @[StackTraceEntry(procname: "raiseOSError", line: 95, filename: "oserr.nim", frameMsg: "")], up: nil)
+ref Exception(parent: nil, name: "OSError", msg: "No such file or directory\n
+Additional info: http://www.not.https", trace: @[StackTraceEntry(procname: "raiseOSError", line: 95, filename: "oserr.nim", frameMsg: "")], up: ref Exception(parent: nil, name: "OSError", msg: "No such file or directory\n
+Additional info: 192.168.1.1", trace: @[StackTraceEntry(procname: "raiseOSError", line: 95, filename: "oserr.nim", frameMsg: "")], up: nil))
+==395791== 
+==395791== HEAP SUMMARY:
+==395791==     in use at exit: 215,387 bytes in 40 blocks
+==395791==   total heap usage: 3,609 allocs, 3,569 frees, 398,536 bytes allocated
+==395791== 
+==395791== 0 bytes in 1 blocks are definitely lost in loss record 1 of 14
+==395791==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
+==395791==    by 0x4005A22: malloc (rtld-malloc.h:56)
+==395791==    by 0x4005A22: _dl_find_object_update (dl-find_object.c:791)
+==395791==    by 0x400ECCF: dl_open_worker_begin (dl-open.c:735)
+==395791==    by 0x49E2C27: _dl_catch_exception (dl-error-skeleton.c:208)
+==395791==    by 0x400DF99: dl_open_worker (dl-open.c:782)
+==395791==    by 0x49E2C27: _dl_catch_exception (dl-error-skeleton.c:208)
+==395791==    by 0x400E34D: _dl_open (dl-open.c:883)
+==395791==    by 0x48FE6BB: dlopen_doit (dlopen.c:56)
+==395791==    by 0x49E2C27: _dl_catch_exception (dl-error-skeleton.c:208)
+==395791==    by 0x49E2CF2: _dl_catch_error (dl-error-skeleton.c:227)
+==395791==    by 0x48FE1AD: _dlerror_run (dlerror.c:138)
+==395791==    by 0x48FE747: dlopen_implementation (dlopen.c:71)
+==395791==    by 0x48FE747: dlopen@@GLIBC_2.34 (dlopen.c:81)
+==395791== 
+==395791== 3,264 bytes in 12 blocks are possibly lost in loss record 12 of 14
+==395791==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
+==395791==    by 0x40147D9: calloc (rtld-malloc.h:44)
+==395791==    by 0x40147D9: allocate_dtv (dl-tls.c:375)
+==395791==    by 0x40147D9: _dl_allocate_tls (dl-tls.c:634)
+==395791==    by 0x4903834: allocate_stack (allocatestack.c:430)
+==395791==    by 0x4903834: pthread_create@@GLIBC_2.34 (pthread_create.c:647)
+==395791==    by 0x11633E: createThread__pureZconcurrencyZthreadpool_489 (in /home/poop/git/private/nirv/boat/tests/config/tconfig)
+==395791==    by 0x127249: atmdotdotatsdotdotatsdotdotatsdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot12atslibatspureatsconcurrencyatsthreadpooldotnim_Init000 (in /home/poop/git/private/nirv/boat/tests/config/tconfig)
+==395791==    by 0x12831C: PreMain (in /home/poop/git/private/nirv/boat/tests/config/tconfig)
+==395791==    by 0x10A7E0: main (in /home/poop/git/private/nirv/boat/tests/config/tconfig)
+==395791== 
+==395791== LEAK SUMMARY:
+==395791==    definitely lost: 0 bytes in 1 blocks
+==395791==    indirectly lost: 0 bytes in 0 blocks
+==395791==      possibly lost: 3,264 bytes in 12 blocks
+==395791==    still reachable: 212,123 bytes in 27 blocks
+==395791==         suppressed: 0 bytes in 0 blocks
+==395791== Reachable blocks (those to which a pointer was found) are not shown.
+==395791== To see them, rerun with: --leak-check=full --show-leak-kinds=all
+==395791== 
+==395791== For lists of detected and suppressed errors, rerun with: -s
+==395791== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
+
@@ -267,7 +338,7 @@

config<

Report generated by: testament – Nim Tester
- Made with Nim. Generated on: 2023-03-15 10:24:16 UTC-07:00 + Made with Nim. Generated on: 2023-03-15 14:39:16 UTC-07:00

diff --git a/tests/config.nims b/tests/config.nims index 310c9f3..4ae9604 100644 --- a/tests/config.nims +++ b/tests/config.nims @@ -8,6 +8,8 @@ --define:nimPreviewJsonutilsHoleyEnum --define:nimUnittestColor:off --define:nimUnittestOutputLevel:PRINT_FAILURES +--define:useMalloc # required for valgrind --excessiveStackTrace:off +--mm:orc # required for valgrind --path:"$projectDir/../../src" --processing:off diff --git a/tests/config/tconfig.nim b/tests/config/tconfig.nim index b6cce5f..2c8874d 100644 --- a/tests/config/tconfig.nim +++ b/tests/config/tconfig.nim @@ -1,6 +1,6 @@ discard """ action: "run" -valgrind: "leaks" +valgrind: true exitcode: 0 """