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

Potential memory overrun in test_ldpc #253

Closed
asedlmayr opened this issue Jan 15, 2021 · 1 comment
Closed

Potential memory overrun in test_ldpc #253

asedlmayr opened this issue Jan 15, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@asedlmayr
Copy link
Collaborator

Zc = 112, {encoding, decoding}: {58.45, 24.36} Mbps, {42.15, 101.16} us per code block. Bit errors = 0, BER = 0.000
Zc = 120, {encoding, decoding}: {61.33, 21.26} Mbps, {43.04, 124.18} us per code block. Bit errors = 0, BER = 0.000

==50457==ERROR: AddressSanitizer: unknown-crash on address 0x7ffceebe3e6f at pc 0x00000061ae9d bp 0x7ffceebe3b70 sp 0x7ffceebe3b60
READ of size 32 at 0x7ffceebe3e6f thread T0
#0 0x61ae9c in _mm256_loadu_si256(long long __vector(4) const*) /usr/lib/gcc/x86_64-linux-gnu/9/include/avxintrin.h:922
#1 0x61ae9c in avx2enc::cycle_bit_shift_72to128(long long __vector(4), short, short) /home/rice/Documents/Development/Repos/agora_updown/src/encoder/cyclic_shift.cpp:69
#2 0x61cc0d in avx2enc::ldpc_encoder_bg1(signed char*, signed char*, short const*, short const*, short const*, short, unsigned char) /home/rice/Documents/Development/Repos/agora_updown/src/encoder/encoder.cpp:32
#3 0x62125a in avx2enc::bblib_ldpc_encoder_5gnr(bblib_ldpc_encoder_5gnr_request*, bblib_ldpc_encoder_5gnr_response*) /home/rice/Documents/Development/Repos/agora_updown/src/encoder/encoder.cpp:286
#4 0x482f33 in ldpc_encode_helper /home/rice/Documents/Development/Repos/agora_updown/src/common/utils_ldpc.hpp:226
#5 0x48478b in main /home/rice/Documents/Development/Repos/agora_updown/test/compute_kernels/ldpc/test_ldpc.cpp:75
#6 0x7f962e8cb0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#7 0x480e4d in _start (/home/rice/Documents/Development/Repos/agora_updown/build/test_ldpc+0x480e4d)

Address 0x7ffceebe3e6f is located in stack of thread T0 at offset 399 in frame
#0 0x61a65f in avx2enc::cycle_bit_shift_72to128(long long __vector(4), short, short) /home/rice/Documents/Development/Repos/agora_updown/src/encoder/cyclic_shift.cpp:37

This frame has 3 object(s):
[32, 64) 'x0' (line 58)
[96, 128) 'x2' (line 58)
[160, 416) 'shuffle_table' (line 39) <== Memory access at offset 399 partially overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions are supported)
SUMMARY: AddressSanitizer: unknown-crash /usr/lib/gcc/x86_64-linux-gnu/9/include/avxintrin.h:922 in _mm256_loadu_si256(long long __vector(4) const*)
Shadow bytes around the buggy address:
0x10001dd74770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10001dd74780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10001dd74790: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
0x10001dd747a0: 00 00 00 00 f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2
0x10001dd747b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x10001dd747c0: 00 00 00 00 00 00 00 00 00 00 00 00 00[00]00 00
0x10001dd747d0: f3 f3 f3 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00
0x10001dd747e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10001dd747f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10001dd74800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10001dd74810: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==50457==ABORTING

@asedlmayr asedlmayr added the bug Something isn't working label Jan 15, 2021
@asedlmayr
Copy link
Collaborator Author

Fixed in commit a03ffb4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant