Code Monkey home page Code Monkey logo

Comments (15)

zkamvar avatar zkamvar commented on September 26, 2024

The problem children:

==21510==    at 0x1BD52E0F: bitwise_distance_haploid._omp_fn.0 (packages/tests-vg/poppr/src/bitwise_distance.c:232)
==21510==    by 0x1BD50F08: bitwise_distance_haploid (packages/tests-vg/poppr/src/bitwise_distance.c:175)
==21510==    at 0x1BD52EE0: bitwise_distance_haploid._omp_fn.0 (packages/tests-vg/poppr/src/bitwise_distance.c:248)
==21510==    at 0x1BD5331F: bitwise_distance_diploid._omp_fn.1 (packages/tests-vg/poppr/src/bitwise_distance.c:439)
==21510==    by 0x1BD5125F: bitwise_distance_diploid (packages/tests-vg/poppr/src/bitwise_distance.c:374)
==21510==    at 0x1BD533F0: bitwise_distance_diploid._omp_fn.1 (packages/tests-vg/poppr/src/bitwise_distance.c:455)
==21510==    by 0x1BD50F08: bitwise_distance_haploid (packages/tests-vg/poppr/src/bitwise_distance.c:175)
==21510==    by 0x1BD55344: bruvo_dist (packages/tests-vg/poppr/src/poppr_distance.c:425)
==21510==    by 0x1BD56050: bruvo_distance (packages/tests-vg/poppr/src/poppr_distance.c:296)
==21510==    by 0x1BD55356: bruvo_dist (packages/tests-vg/poppr/src/poppr_distance.c:432)
==21510==    by 0x1BD56050: bruvo_distance (packages/tests-vg/poppr/src/poppr_distance.c:296)

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

Here are the lines:

src/bitwise_distance.c:175:    chr_length = XLENGTH(R_chr1_1); // VALGRIND
src/bitwise_distance.c:232:          next_missing_i = (int)INTEGER(R_nap1)[next_missing_index_i] - 1; // VALGRIND
src/bitwise_distance.c:248:          next_missing_j = (int)INTEGER(R_nap2)[next_missing_index_j] - 1; // VALGRIND
src/bitwise_distance.c:374:    chr_length = XLENGTH(R_chr1_1); // VALGRIND
src/bitwise_distance.c:439:          next_missing_i = (int)INTEGER(R_nap1)[next_missing_index_i] - 1; // VALGRIND
src/poppr_distance.c:296:               REAL(Rval)[count++] = bruvo_dist(INTEGER(pair_matrix), pA, // VALGRIND
src/poppr_distance.c:425:   genos = R_Calloc(2*p, int); // VALGRIND
src/poppr_distance.c:432:   zero_ind = R_Calloc(2, int*); // VALGRIND

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

After a second pass, I believe that the last three lines are related to the valgrind accounting for what was lost, not what was wrong. So, the issue seems to be dealing with missing data when there is none?

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

This is in the valgrind-fix branch

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

Actually, there is missing data. This is the code that likely sprung the leak:

set.seed(991)
dat <- sample(c(0, 1, NA), 50, replace = TRUE, prob = c(0.49, 0.5, 0.01))
mat <- matrix(dat, nrow = 5, ncol = 10)
mat
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
## [1,]    0    0    0    0    1    1    1    1    1     1
## [2,]    0    1    0    1    0    0    0   NA    1     1
## [3,]    0    1    0    1    0    0    1    1    0     0
## [4,]    0    0    0    0    1    1    0    1    0     1
## [5,]    0    0    1    1    0    1    0    1    0     0

As the missing datum is right on the 8th bit, I believe it might be a one-off error, but I really can't be too sure of that.

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

Luckily, it looks like rocker has a version with valgrind: https://registry.hub.docker.com/u/rocker/r-devel-san/

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

I might have found the error?

I noticed that R_chr1_1 is not listed in shared() within the omp pragma. I'm adding this in and testing it.

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

Welp, this is frustrating. I cannot check how well this works. It's currently on the valgrind-fix branch, but I'm unable to actually run valgrind because I keep getting this error:

==21923==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.

Here's the full output:

root@c5e841c3807f:/# RD -f poppr/tests/test-all.R --restore --save --no-readline --vanilla -d "valgrind"
==21923== Memcheck, a memory error detector
==21923== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==21923== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==21923== Command: /usr/local/lib/R/bin/exec/R -f poppr/tests/test-all.R --restore --save --no-readline --vanilla
==21923==
--21923-- Valgrind options:
--21923--    --tool=memcheck
--21923--    --leak-check=full
--21923--    --track-origins=yes
--21923--    -v
--21923-- Contents of /proc/version:
--21923--   Linux version 3.18.5-tinycore64 (root@dc534047acbb) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Sun Feb 1 06:02:30 UTC 2015
--21923-- Arch and hwcaps: AMD64, LittleEndian, amd64-rdtscp-sse3
--21923-- Page sizes: currently 4096, max supported 4096
--21923-- Valgrind library directory: /usr/lib/valgrind
--21923-- Reading syms from /usr/local/lib/R/bin/exec/R
--21923-- Reading syms from /lib/x86_64-linux-gnu/ld-2.19.so
--21923--   Considering /lib/x86_64-linux-gnu/ld-2.19.so ..
--21923--   .. CRC mismatch (computed a7f35eb3 wanted c33a8314)
--21923--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.19.so ..
--21923--   .. CRC is valid
--21923-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--21923--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--21923--   .. CRC mismatch (computed 731bf187 wanted 9a215fac)
--21923--    object doesn't have a symbol table
--21923--    object doesn't have a dynamic symbol table
--21923-- Scheduler: using generic scheduler lock implementation.
--21923-- Reading suppressions file: /usr/lib/valgrind/default.supp
==21923== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-21923-by-???-on-c5e841c3807f
==21923== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-21923-by-???-on-c5e841c3807f
==21923== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-21923-by-???-on-c5e841c3807f
==21923==
==21923== TO CONTROL THIS PROCESS USING vgdb (which you probably
==21923== don't want to do, unless you know exactly what you're doing,
==21923== or are doing some strange experiment):
==21923==   /usr/lib/valgrind/../../bin/vgdb --pid=21923 ...command...
==21923==
==21923== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==21923==   /path/to/gdb /usr/local/lib/R/bin/exec/R
==21923== and then give GDB the following command
==21923==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=21923
==21923== --pid is optional if only one valgrind process is running
==21923==
--21923-- REDIR: 0x4017950 (ld-linux-x86-64.so.2:strlen) redirected to 0x380c21d1 (???)
--21923-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--21923--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--21923--   .. CRC mismatch (computed 8de94024 wanted dee60e34)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--21923--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--21923--   .. CRC mismatch (computed 0df12582 wanted d7d4b689)
--21923--    object doesn't have a symbol table
==21923== WARNING: new redirection conflicts with existing -- ignoring it
--21923--     old: 0x04017950 (strlen              ) R-> (0000.0) 0x380c21d1 ???
--21923--     new: 0x04017950 (strlen              ) R-> (2007.0) 0x04c2c260 strlen
--21923-- REDIR: 0x4017700 (ld-linux-x86-64.so.2:index) redirected to 0x4c2be10 (index)
--21923-- REDIR: 0x4017920 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c2d310 (strcmp)
--21923-- REDIR: 0x4018650 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c2fe60 (mempcpy)
--21923-- Reading syms from /usr/lib/x86_64-linux-gnu/libasan.so.1.0.0
--21923--   Considering /usr/lib/x86_64-linux-gnu/libasan.so.1.0.0 ..
--21923--   .. CRC mismatch (computed aee40294 wanted ede532dc)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /usr/local/lib/R/lib/libR.so
--21923-- Reading syms from /usr/local/lib/R/lib/libRblas.so
--21923-- Reading syms from /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0
--21923--   Considering /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0 ..
--21923--   .. CRC mismatch (computed 660019d9 wanted f2ef702d)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/libc-2.19.so
--21923--   Considering /lib/x86_64-linux-gnu/libc-2.19.so ..
--21923--   .. CRC mismatch (computed c7b6f1bf wanted 8c956c0d)
--21923--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so ..
--21923--   .. CRC is valid
--21923-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.19.so
--21923--   Considering /lib/x86_64-linux-gnu/libpthread-2.19.so ..
--21923--   .. CRC mismatch (computed 85ae53b8 wanted 1d1e49d0)
--21923--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libpthread-2.19.so ..
--21923--   .. CRC is valid
--21923-- Reading syms from /lib/x86_64-linux-gnu/libdl-2.19.so
--21923--   Considering /lib/x86_64-linux-gnu/libdl-2.19.so ..
--21923--   .. CRC mismatch (computed 3266e406 wanted 3cd73555)
--21923--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libdl-2.19.so ..
--21923--   .. CRC is valid
--21923-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
--21923--   Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 ..
--21923--   .. CRC mismatch (computed 79b96cef wanted 5feafc8e)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/libm-2.19.so
--21923--   Considering /lib/x86_64-linux-gnu/libm-2.19.so ..
--21923--   .. CRC mismatch (computed 99371e4a wanted 9a41b649)
--21923--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.19.so ..
--21923--   .. CRC is valid
--21923-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1
--21923--   Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--21923--   .. CRC mismatch (computed dd3105a0 wanted a21d6f7f)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
--21923--   Considering /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0 ..
--21923--   .. CRC mismatch (computed 36057e8f wanted db636398)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
--21923--   Considering /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0 ..
--21923--   .. CRC mismatch (computed 1d07f7d0 wanted 14b7df0b)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/libreadline.so.6.3
--21923--   Considering /lib/x86_64-linux-gnu/libreadline.so.6.3 ..
--21923--   .. CRC mismatch (computed f67e0939 wanted ab015828)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/libpcre.so.3.13.1
--21923--   Considering /lib/x86_64-linux-gnu/libpcre.so.3.13.1 ..
--21923--   .. CRC mismatch (computed d6bbf166 wanted d4a19465)
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/liblzma.so.5.0.0
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/libbz2.so.1.0.4
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/libz.so.1.2.8
--21923--    object doesn't have a symbol table
--21923-- Reading syms from /lib/x86_64-linux-gnu/librt-2.19.so
--21923--   Considering /lib/x86_64-linux-gnu/librt-2.19.so ..
--21923--   .. CRC mismatch (computed a701162d wanted 8a1b6449)
--21923--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/librt-2.19.so ..
--21923--   .. CRC is valid
--21923-- Reading syms from /lib/x86_64-linux-gnu/libtinfo.so.5.9
--21923--   Considering /lib/x86_64-linux-gnu/libtinfo.so.5.9 ..
--21923--   .. CRC mismatch (computed cdea312a wanted 5e09e76f)
--21923--    object doesn't have a symbol table
--21923-- REDIR: 0x8dfee10 (libc.so.6:strcasecmp) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8e01100 (libc.so.6:strncasecmp) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8dfe5e0 (libc.so.6:memcpy@GLIBC_2.2.5) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8e6c5e0 (libc.so.6:__memcpy_chk) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8df9210 (libc.so.6:strcmp) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8dfb080 (libc.so.6:strncmp) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8dfe000 (libc.so.6:bcmp) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8df8dc0 (libc.so.6:strcat) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8df8fc0 (libc.so.6:index) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8dfa6a0 (libc.so.6:strcpy) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8dfb040 (libc.so.6:strncat) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
--21923-- REDIR: 0x8dfc920 (libc.so.6:strncpy) redirected to 0x4a23730 (_vgnU_ifunc_wrapper)
==21923==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==21923==Process memory map follows:
    0x000000400000-0x000000401000   /usr/local/lib/R/bin/exec/R
    0x000000600000-0x000000601000   /usr/local/lib/R/bin/exec/R
    0x000004000000-0x000004020000   /lib/x86_64-linux-gnu/ld-2.19.so
    0x000004020000-0x00000402a000
    0x00000402d000-0x000004037000
    0x00000403b000-0x00000403f000
    0x000004220000-0x000004221000   /lib/x86_64-linux-gnu/ld-2.19.so
    0x000004221000-0x000004222000   /lib/x86_64-linux-gnu/ld-2.19.so
    0x000004222000-0x000004223000
    0x000004223000-0x000004224000
    0x000004a23000-0x000004a24000   /usr/lib/valgrind/vgpreload_core-amd64-linux.so
    0x000004a24000-0x000004c23000   /usr/lib/valgrind/vgpreload_core-amd64-linux.so
    0x000004c23000-0x000004c24000   /usr/lib/valgrind/vgpreload_core-amd64-linux.so
    0x000004c24000-0x000004c25000   /usr/lib/valgrind/vgpreload_core-amd64-linux.so
    0x000004c25000-0x000004c34000   /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
    0x000004c34000-0x000004e33000   /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
    0x000004e33000-0x000004e34000   /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
    0x000004e34000-0x000004e35000   /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
    0x000004e35000-0x000004ed1000   /usr/lib/x86_64-linux-gnu/libasan.so.1.0.0
    0x000004ed1000-0x0000050d1000   /usr/lib/x86_64-linux-gnu/libasan.so.1.0.0
    0x0000050d1000-0x0000050d4000   /usr/lib/x86_64-linux-gnu/libasan.so.1.0.0
    0x0000050d4000-0x000005d0d000
    0x000005d0d000-0x000006eba000   /usr/local/lib/R/lib/libR.so
    0x000006eba000-0x0000070b9000   /usr/local/lib/R/lib/libR.so
    0x0000070b9000-0x000007a43000   /usr/local/lib/R/lib/libR.so
    0x000007a43000-0x000007b37000
    0x000007b37000-0x000007d64000   /usr/local/lib/R/lib/libRblas.so
    0x000007d64000-0x000007f63000   /usr/local/lib/R/lib/libRblas.so
    0x000007f63000-0x00000806a000   /usr/local/lib/R/lib/libRblas.so
    0x00000806a000-0x0000080a6000   /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0
    0x0000080a6000-0x0000082a5000   /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0
    0x0000082a5000-0x0000082a7000   /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0
    0x0000082a7000-0x0000082a8000   /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0
    0x0000082a8000-0x000008d79000
    0x000008d79000-0x000008f18000   /lib/x86_64-linux-gnu/libc-2.19.so
    0x000008f18000-0x000009118000   /lib/x86_64-linux-gnu/libc-2.19.so
    0x000009118000-0x00000911c000   /lib/x86_64-linux-gnu/libc-2.19.so
    0x00000911c000-0x00000911e000   /lib/x86_64-linux-gnu/libc-2.19.so
    0x00000911e000-0x000009122000
    0x000009122000-0x00000913a000   /lib/x86_64-linux-gnu/libpthread-2.19.so
    0x00000913a000-0x000009339000   /lib/x86_64-linux-gnu/libpthread-2.19.so
    0x000009339000-0x00000933a000   /lib/x86_64-linux-gnu/libpthread-2.19.so
    0x00000933a000-0x00000933b000   /lib/x86_64-linux-gnu/libpthread-2.19.so
    0x00000933b000-0x00000933f000
    0x00000933f000-0x000009342000   /lib/x86_64-linux-gnu/libdl-2.19.so
    0x000009342000-0x000009541000   /lib/x86_64-linux-gnu/libdl-2.19.so
    0x000009541000-0x000009542000   /lib/x86_64-linux-gnu/libdl-2.19.so
    0x000009542000-0x000009543000   /lib/x86_64-linux-gnu/libdl-2.19.so
    0x000009543000-0x000009643000   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
    0x000009643000-0x000009843000   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
    0x000009843000-0x00000984a000   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
    0x00000984a000-0x00000984c000   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
    0x00000984c000-0x00000984f000
    0x00000984f000-0x00000994f000   /lib/x86_64-linux-gnu/libm-2.19.so
    0x00000994f000-0x000009b4e000   /lib/x86_64-linux-gnu/libm-2.19.so
    0x000009b4e000-0x000009b4f000   /lib/x86_64-linux-gnu/libm-2.19.so
    0x000009b4f000-0x000009b50000   /lib/x86_64-linux-gnu/libm-2.19.so
    0x000009b50000-0x000009b66000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x000009b66000-0x000009d65000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x000009d65000-0x000009d66000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x000009d66000-0x000009e84000   /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
    0x000009e84000-0x00000a083000   /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
    0x00000a083000-0x00000a084000   /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
    0x00000a084000-0x00000a086000   /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
    0x00000a086000-0x00000a0c4000   /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
    0x00000a0c4000-0x00000a2c3000   /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
    0x00000a2c3000-0x00000a2c4000   /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
    0x00000a2c4000-0x00000a2c5000   /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
    0x00000a2c5000-0x00000a305000   /lib/x86_64-linux-gnu/libreadline.so.6.3
    0x00000a305000-0x00000a505000   /lib/x86_64-linux-gnu/libreadline.so.6.3
    0x00000a505000-0x00000a507000   /lib/x86_64-linux-gnu/libreadline.so.6.3
    0x00000a507000-0x00000a50e000   /lib/x86_64-linux-gnu/libreadline.so.6.3
    0x00000a50e000-0x00000a50f000
    0x00000a50f000-0x00000a57b000   /lib/x86_64-linux-gnu/libpcre.so.3.13.1
    0x00000a57b000-0x00000a77b000   /lib/x86_64-linux-gnu/libpcre.so.3.13.1
    0x00000a77b000-0x00000a77c000   /lib/x86_64-linux-gnu/libpcre.so.3.13.1
    0x00000a77c000-0x00000a77d000   /lib/x86_64-linux-gnu/libpcre.so.3.13.1
    0x00000a77d000-0x00000a79f000   /lib/x86_64-linux-gnu/liblzma.so.5.0.0
    0x00000a79f000-0x00000a99e000   /lib/x86_64-linux-gnu/liblzma.so.5.0.0
    0x00000a99e000-0x00000a99f000   /lib/x86_64-linux-gnu/liblzma.so.5.0.0
    0x00000a99f000-0x00000a9a0000   /lib/x86_64-linux-gnu/liblzma.so.5.0.0
    0x00000a9a0000-0x00000a9af000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x00000a9af000-0x00000abae000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x00000abae000-0x00000abaf000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x00000abaf000-0x00000abb0000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x00000abb0000-0x00000abca000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x00000abca000-0x00000adc9000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x00000adc9000-0x00000adca000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x00000adca000-0x00000adcb000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x00000adcb000-0x00000add2000   /lib/x86_64-linux-gnu/librt-2.19.so
    0x00000add2000-0x00000afd1000   /lib/x86_64-linux-gnu/librt-2.19.so
    0x00000afd1000-0x00000afd2000   /lib/x86_64-linux-gnu/librt-2.19.so
    0x00000afd2000-0x00000afd3000   /lib/x86_64-linux-gnu/librt-2.19.so
    0x00000afd3000-0x00000aff9000   /lib/x86_64-linux-gnu/libtinfo.so.5.9
    0x00000aff9000-0x00000b1f8000   /lib/x86_64-linux-gnu/libtinfo.so.5.9
    0x00000b1f8000-0x00000b1fc000   /lib/x86_64-linux-gnu/libtinfo.so.5.9
    0x00000b1fc000-0x00000b1fd000   /lib/x86_64-linux-gnu/libtinfo.so.5.9
    0x000038000000-0x0000383e2000   /usr/lib/valgrind/memcheck-amd64-linux
    0x0000385e2000-0x0000385e5000   /usr/lib/valgrind/memcheck-amd64-linux
    0x0000385e5000-0x00003a055000
    0x000802001000-0x000808a94000
    0x000808a94000-0x000808a96000
    0x000808a96000-0x000808b96000   [stack:21923]
    0x000808b96000-0x000808b98000
    0x000808b98000-0x000808b99000   /tmp/vgdb-pipe-shared-mem-vgdb-21923-by-???-on-c5e841c3807f
    0x000808b99000-0x00080b66f000
    0x00080b71f000-0x00080bb11000
    0x000ffefff000-0x000fff001000
    0x7fffb30b8000-0x7fffb30d9000
    0x7fffb3136000-0x7fffb3138000   [vvar]
    0xffffffffff600000-0xffffffffff601000   [vsyscall]
==21923==End of process memory map.
==21923==
==21923== HEAP SUMMARY:
==21923==     in use at exit: 0 bytes in 0 blocks
==21923==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==21923==
==21923== All heap blocks were freed -- no leaks are possible
==21923==
==21923== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==21923== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

@JonahBrooks, when you get to this, can you record notes on how to run valgrind on poppr?

from poppr.

JonahBrooks avatar JonahBrooks commented on September 26, 2024

I won't be able to look into this with much detail until tomorrow, but I looked into a bit just now. I usually run R from command line with valgrind attached ( something like: R -d "valgrind --leak-check=full --trace-children=yes --log-file=valgrind.out" ), then load the libraries and run whatever tests I need. Once I exit R (with quit() or ctrl-d) valgrind dumps all its logs into the output file and I can look them over. This lets me run anything I like in R to see if it, specifically, has a problem.

from poppr.

JonahBrooks avatar JonahBrooks commented on September 26, 2024

This should now be fixed on the devel branch as of commit 90facb4

Valgrind still has a few complaints about the openMP calls in bitwise.c. I'll see if I can sort those out next week.

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

Thanks for catching that pesky bug. I have no clue how the hell it survived for a whole year.

Sent from my iPhone

On Jul 10, 2015, at 17:47, JonahBrooks [email protected] wrote:

This should now be fixed on the devel branch as of commit 90facb4

Valgrind still has a few complaints about the openMP calls in bitwise.c. I'll see if I can sort those out next week.


Reply to this email directly or view it on GitHub.

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

I removed the valgrind-fix branch as Jonah is working on the devel branch.

from poppr.

JonahBrooks avatar JonahBrooks commented on September 26, 2024
==29745== Memcheck, a memory error detector
==29745== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==29745== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==29745== Command: /bin/rm -rf /tmp/RtmpOdZ4Dt
==29745== Parent PID: 29744
==297==29700==
==29700== HEAP SUMMARY:
==29700==     in use at exit: 121,323,130 bytes in 50,870 blocks
==29700==   total heap usage: 172,416 allocs, 121,546 frees, 286,506,757 bytes allocated
==29700==
==29700== 152 bytes in 1 blocks are possibly lost in loss record 92 of 2,969
==29700==    at 0x402C109: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==29700==    by 0x401117E: allocate_dtv (dl-tls.c:296)
==29700==    by 0x40118EB: _dl_allocate_tls (dl-tls.c:460)
==29700==    by 0x43C27A2: pthread_create@@GLIBC_2.1 (allocatestack.c:589)
==29700==    by 0x472BD68: ??? (in /usr/lib/i386-linux-gnu/libgomp.so.1.0.0)
==29700==    by 0x472A8BD: GOMP_parallel_start (in /usr/lib/i386-linux-gnu/libgomp.so.1.0.0)
==29700==    by 0xF1B6979: bitwise_distance_haploid (bitwise_distance.c:180)
==29700==    by 0x40D02E1: ??? (in /usr/lib/R/lib/libR.so)
==29700==    by 0x40D073F: ??? (in /usr/lib/R/lib/libR.so)
==29700==    by 0x410F5F2: Rf_eval (in /usr/lib/R/lib/libR.so)
==29700==    by 0x4112A52: ??? (in /usr/lib/R/lib/libR.so)
==29700==    by 0x410F3C8: Rf_eval (in /usr/lib/R/lib/libR.so)
==29700==
==29700== LEAK SUMMARY:
==29700==    definitely lost: 0 bytes in 0 blocks
==29700==    indirectly lost: 0 bytes in 0 blocks
==29700==      possibly lost: 152 bytes in 1 blocks
==29700==    still reachable: 121,322,978 bytes in 50,869 blocks
==29700==         suppressed: 0 bytes in 0 blocks
==29700== Reachable blocks (those to which a pointer was found) are not shown.
==29700== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==29700==
==29700== For counts of detected and suppressed errors, rerun with: -v
==29700== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

This is the log for the possible leak on line 180 of bitwise_distance.c.

from poppr.

zkamvar avatar zkamvar commented on September 26, 2024

This issue was closed due to the fact that there are no definitely or indirectly lost bytes of memory. Several resources hint at the fact that valgrind has trouble with OMP threaded programs and will squawk because it doesn't understand really deep-level calls that OMP is making.

from poppr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.