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

Malloc size error in btree.c:271:18 #130

Closed
seviezhou opened this issue Aug 11, 2020 · 1 comment
Closed

Malloc size error in btree.c:271:18 #130

seviezhou opened this issue Aug 11, 2020 · 1 comment

Comments

@seviezhou
Copy link

System info

Ubuntu x86_64, clang 6.0, mysofa2json (latest master 6f4f25e)

Configure

cmake .. -DCMAKE_CXX_FLAGS="-fsanitize=address -g" -DCMAKE_C_FLAGS="-fsanitize=address -g" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" -DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=address" -DBUILD_SHARED_LIBS=OFF -DCODE_COVERAGE=OFF -DBUILD_TESTS=OFF

Command line

./src/mysofa2json @@

AddressSanitizer output

==74525==WARNING: AddressSanitizer failed to allocate 0xffffffffe2007530 bytes
==74525==AddressSanitizer's allocator is terminating the process instead of returning 0
==74525==If you don't like this behavior set allocator_may_return_null=1
==74525==AddressSanitizer CHECK failed: /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:225 "((0)) != (0)" (0x0, 0x0)
    #0 0x4e90bf in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/asan/asan_rtl.cc:69
    #1 0x506035 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc:79
    #2 0x4eeee6 in __sanitizer::ReportAllocatorCannotReturnNull() /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:225
    #3 0x4eef23 in __sanitizer::ReturnNullOrDieOnFailure::OnBadRequest() /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:241
    #4 0x41fff6 in __asan::asan_malloc(unsigned long, __sanitizer::BufferedStackTrace*) /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/asan/asan_allocator.cc:856
    #5 0x4dfba4 in __interceptor_malloc /home/seviezhou/llvm-6.0.0/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:89
    #6 0x52c55c in treeRead /home/seviezhou/libmysofa/src/hdf/btree.c:271:18
    #7 0x525164 in readOHDRHeaderMessageDataLayout /home/seviezhou/libmysofa/src/hdf/dataobject.c:549:13
    #8 0x525164 in readOHDRmessages /home/seviezhou/libmysofa/src/hdf/dataobject.c:1108
    #9 0x521999 in dataobjectRead /home/seviezhou/libmysofa/src/hdf/dataobject.c:1211:9
    #10 0x5316ba in directblockRead /home/seviezhou/libmysofa/src/hdf/fractalhead.c:238:15
    #11 0x52ec6b in fractalheapRead /home/seviezhou/libmysofa/src/hdf/fractalhead.c:638:13
    #12 0x521cf9 in dataobjectRead /home/seviezhou/libmysofa/src/hdf/dataobject.c:1236:11
    #13 0x51ecf3 in superblockRead2or3 /home/seviezhou/libmysofa/src/hdf/superblock.c:64:10
    #14 0x5200a7 in superblockRead /home/seviezhou/libmysofa/src/hdf/superblock.c:170:12
    #15 0x51abcf in mysofa_load /home/seviezhou/libmysofa/src/hrtf/reader.c:305:10
    #16 0x5178f6 in main /home/seviezhou/libmysofa/src/tests/sofa2json.c:90:10
    #17 0x7fa25800483f in __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:291
    #18 0x41b9b8 in _start (/home/seviezhou/libmysofa/build-sofa/src/mysofa2json+0x41b9b8)

POC

malloc-size-error-treeRead-btree-271.zip

@hoene
Copy link
Owner

hoene commented Nov 28, 2020

fixed with #146

@hoene hoene closed this as completed Nov 28, 2020
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