Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AddressSanitizer Errors for test_dict_nested1.py and print_list_tuple_03.py: requested allocation size exceeds maximum supported size #2595

Closed
@Vipul-Cariappa

Description

@Vipul-Cariappa

Steps to reproduce:

./src/bin/lpython ./integration_tests/test_dict_nested1.py
clang -L./src/runtime/ -llpython_runtime -lm -g -fsanitize=address -fno-omit-frame-pointer ./test_dict_nested1.out.tmp.o
LD_PRELOAD=./src/runtime/liblpython_runtime.so ./a.out

AddressSanitizer Output:

==119540==ERROR: AddressSanitizer: requested allocation size 0xfffffffffafafaf8 (0xfffffffffafb0af8 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
    #0 0x6140945de9be in malloc /home/runner/work/llvm-project/llvm-project/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x776f5992ea0c in _lfortran_malloc /home/vipul/Workspace/python/lpython/src/libasr/runtime/lfortran_intrinsics.c:1645:12
    #2 0x61409461cdfe in __module___main___test_nested_dict (/home/vipul/Workspace/python/lpython/a.out+0x106dfe)
    #3 0x61409461b435 in __module___main_____main__global_stmts (/home/vipul/Workspace/python/lpython/a.out+0x105435)

==119540==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big /home/runner/work/llvm-project/llvm-project/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3 in malloc
==119540==ABORTING

If I run it with allocator_may_return_null=1

❯ ASAN_OPTIONS="allocator_may_return_null=1" LD_PRELOAD=./src/runtime/liblpython_runtime.so ./a.out
==122213==WARNING: AddressSanitizer failed to allocate 0xfffffffffafafaf8 bytes
=================================================================
==122213==ERROR: AddressSanitizer: unknown-crash on address 0xbebebebebebebebe at pc 0x5a7abf10bad1 bp 0x7ffdca059750 sp 0x7ffdca058f08
READ of size 4210752248 at 0xbebebebebebebebe thread T0
    #0 0x5a7abf10bad0 in memcpy /home/runner/work/llvm-project/llvm-project/final/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc:115:5
    #1 0x5a7abf14ae10 in __module___main___test_nested_dict (/home/vipul/Workspace/python/lpython/a.out+0x106e10)
    #2 0x5a7abf149435 in __module___main_____main__global_stmts (/home/vipul/Workspace/python/lpython/a.out+0x105435)
    #3 0x5a7abf14be9a in main (/home/vipul/Workspace/python/lpython/a.out+0x107e9a)
    #4 0x7cb4de029d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #5 0x7cb4de029e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    #6 0x5a7abf06f344 in _start (/home/vipul/Workspace/python/lpython/a.out+0x2b344)

Address 0xbebebebebebebebe is a wild pointer inside of access range of size 0x0000fafafaf8.
SUMMARY: AddressSanitizer: unknown-crash /home/runner/work/llvm-project/llvm-project/final/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc:115:5 in memcpy
==122213==ABORTING

You can preform similar steps with ./integration_tests/print_list_tuple_03.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions