Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrmm_iutncopy generic/ztrmm_utcopy_8.c:831 : WARNING: ThreadSanitizer: heap-use-after-free #601

Closed
vondele opened this issue Jul 7, 2015 · 3 comments

Comments

@vondele
Copy link

vondele commented Jul 7, 2015

Compiling openblas (from the release xianyi-OpenBLAS-v0.2.14-0-gd0c51c4.zip) on CORE=SANDYBRIDGE
LIBCORE=sandybridge
using:
make -j 24 USE_THREAD=0 LIBNAMESUFFIX=serial
one of the tests fails with:
xianyi-OpenBLAS-d0c51c4/ctest> OPENBLAS_NUM_THREADS=1 ./xccblat3 < cin3
[...]

cblas_ctrmm PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS ( 2592 CALLS)

WARNING: ThreadSanitizer: heap-use-after-free (pid=28032)
Read of size 4 at 0x7d0c0000efb8 by main thread:
#0 ctrmm_iutucopy generic/ztrmm_utcopy_8.c:834 (xccblat3+0x0000004aefd2)
#1 ctrmm_LNUU /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/driver/level3/trmm_L.c:129 (xccblat3+0x00000042cd3b)
#2 cblas_ctrmm /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/interface/trsm.c:369 (xccblat3+0x00000042355a)
#3 cctrmm_ /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblas3.c:491 (xccblat3+0x0000004159ad)
#4 cchk3_ /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblat3.f:1234 (xccblat3+0x00000040c0ca)
#5 cblat3 /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblat3.f:338 (xccblat3+0x000000411b8e)
#6 main /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblat3.f:424 (xccblat3+0x000000401884)

Previous write of size 8 at 0x7d0c0000efb8 by main thread:
[failed to restore the stack]

SUMMARY: ThreadSanitizer: heap-use-after-free generic/ztrmm_utcopy_8.c:834 ctrmm_iutucopy

WARNING: ThreadSanitizer: heap-use-after-free (pid=28032)
Read of size 4 at 0x7d0c0000efa0 by main thread:
#0 ctrmm_iutncopy generic/ztrmm_utcopy_8.c:831 (xccblat3+0x0000004b24f7)
#1 ctrmm_LNUN /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/driver/level3/trmm_L.c:129 (xccblat3+0x00000042d3fb)
#2 cblas_ctrmm /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/interface/trsm.c:369 (xccblat3+0x00000042355a)
#3 cctrmm_ /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblas3.c:491 (xccblat3+0x0000004159ad)
#4 cchk3_ /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblat3.f:1234 (xccblat3+0x00000040c0ca)
#5 cblat3 /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblat3.f:338 (xccblat3+0x000000411b8e)
#6 main /data/vjoost/toolchain-tsan/build/xianyi-OpenBLAS-d0c51c4/ctest/c_cblat3.f:424 (xccblat3+0x000000401884)

Previous write of size 8 at 0x7d0c0000efa0 by main thread:
[failed to restore the stack]

SUMMARY: ThreadSanitizer: heap-use-after-free generic/ztrmm_utcopy_8.c:831 ctrmm_iutncopy

cblas_ctrmm PASSED THE ROW-MAJOR COMPUTATIONAL TESTS ( 2592 CALLS)

I have been compiling openblas with -fsanitize=thread using a slightly modified gcc 5.1.0

The problem appears to be core specific, as on westmere I didn't observe this (or I overlooked this ?).

@vondele
Copy link
Author

vondele commented Jul 7, 2015

Actually a normal (i.e. not including -fsanitize=thread using stock gcc 5.1.0) build, running the test under valgrind signal the same issue:

==15953== Invalid read of size 4
==15953== at 0x4919B9: ctrmm_iutucopy (ztrmm_utcopy_8.c:834)
==15953== by 0x422E69: ctrmm_LNUU (trmm_L.c:129)
==15953== by 0x41C1A9: cblas_ctrmm (trsm.c:369)
==15953== by 0x411A6E: cctrmm_ (c_cblas3.c:491)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953== Address 0x7e6ebd8 is 24 bytes after a block of size 48 in arena "client"
==15953==
==15953== Invalid read of size 4
==15953== at 0x4919C3: ctrmm_iutucopy (ztrmm_utcopy_8.c:835)
==15953== by 0x422E69: ctrmm_LNUU (trmm_L.c:129)
==15953== by 0x41C1A9: cblas_ctrmm (trsm.c:369)
==15953== by 0x411A6E: cctrmm_ (c_cblas3.c:491)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953== Address 0x7e6ebdc is 28 bytes after a block of size 48 in arena "client"
==15953==
==15953== Invalid read of size 4
==15953== at 0x493198: ctrmm_iutncopy (ztrmm_utcopy_8.c:831)
==15953== by 0x423459: ctrmm_LNUN (trmm_L.c:129)
==15953== by 0x41C1A9: cblas_ctrmm (trsm.c:369)
==15953== by 0x411A6E: cctrmm_ (c_cblas3.c:491)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953== Address 0x7e6ee30 is 0 bytes after a block of size 48 alloc'd
==15953== at 0x4A05B10: malloc (vg_replace_malloc.c:296)
==15953== by 0x41193F: cctrmm_ (c_cblas3.c:477)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953==
==15953== Invalid read of size 4
==15953== at 0x4931A1: ctrmm_iutncopy (ztrmm_utcopy_8.c:832)
==15953== by 0x423459: ctrmm_LNUN (trmm_L.c:129)
==15953== by 0x41C1A9: cblas_ctrmm (trsm.c:369)
==15953== by 0x411A6E: cctrmm_ (c_cblas3.c:491)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953== Address 0x7e6ee34 is 4 bytes after a block of size 48 alloc'd
==15953== at 0x4A05B10: malloc (vg_replace_malloc.c:296)
==15953== by 0x41193F: cctrmm_ (c_cblas3.c:477)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953==
==15953== Invalid read of size 4
==15953== at 0x4931AC: ctrmm_iutncopy (ztrmm_utcopy_8.c:834)
==15953== by 0x423459: ctrmm_LNUN (trmm_L.c:129)
==15953== by 0x41C1A9: cblas_ctrmm (trsm.c:369)
==15953== by 0x411A6E: cctrmm_ (c_cblas3.c:491)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953== Address 0x7e6ee48 is 24 bytes after a block of size 48 in arena "client"
==15953==
==15953== Invalid read of size 4
==15953== at 0x4931B6: ctrmm_iutncopy (ztrmm_utcopy_8.c:835)
==15953== by 0x423459: ctrmm_LNUN (trmm_L.c:129)
==15953== by 0x41C1A9: cblas_ctrmm (trsm.c:369)
==15953== by 0x411A6E: cctrmm_ (c_cblas3.c:491)
==15953== by 0x409CC7: cchk3_ (c_cblat3.f:1234)
==15953== by 0x40EE5D: MAIN__ (c_cblat3.f:338)
==15953== by 0x40143E: main (c_cblat3.f:424)
==15953== Address 0x7e6ee4c is 28 bytes after a block of size 48 in arena "client"
==15953==

@martin-frbg
Copy link
Collaborator

Looks vaguely similar to resolved issue 535. (Which is not to say that it has been fixed in the meantime, but there have been 130 commits in all since the 0.2.14 release. Would it be possible for you to rerun your tests with a copy of the current "develop" branch ?)

@vondele
Copy link
Author

vondele commented Jul 7, 2015

It appears still present in the develop branch.

==15767== Invalid read of size 4
==15767== at 0x47FA21: ctrmm_iutucopy (in /data/vjoost/openblas/dev/OpenBLAS-develop/ctest/xccblat3)
==15767== by 0x41EA76: ctrmm_LNUU (in /data/vjoost/openblas/dev/OpenBLAS-develop/ctest/xccblat3)
==15767== by 0x417F6B: cblas_ctrmm (in /data/vjoost/openblas/dev/OpenBLAS-develop/ctest/xccblat3)
==15767== by 0x40F71E: cctrmm_ (in /data/vjoost/openblas/dev/OpenBLAS-develop/ctest/xccblat3)
==15767== by 0x407DFC: cchk3_ (in /data/vjoost/openblas/dev/OpenBLAS-develop/ctest/xccblat3)
==15767== by 0x40CDAB: MAIN__ (in /data/vjoost/openblas/dev/OpenBLAS-develop/ctest/xccblat3)
==15767== by 0x40123E: main (in /data/vjoost/openblas/dev/OpenBLAS-develop/ctest/xccblat3)
==15767== Address 0x7e6b9a8 is 24 bytes after a block of size 48 in arena "client"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants