adrian-thurston / colm

The Colm Programming Language
MIT License
164 stars 31 forks source link

Fails to compile with Clang AddressSanitizer #155

Open zhxie opened 1 year ago

zhxie commented 1 year ago

Colm fails to be built with Clang ASAN.

CC=clang CXX=clang++ CFLAGS="-fsanitize=address,undefined" CXXFLAGS="-fsanitize=address,undefined"

The error shows there are thousands of leaks.

...

Indirect leak of 1 byte(s) in 1 object(s) allocated from:
    #0 0x55b07ef22c6d in operator new[](unsigned long) (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x395c6d) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #1 0x55b07f09edd9 in ObjectMethod::ObjectMethod(UniqueType*, StrTmpl<char>, int, int, int, UniqueType**, DList<ObjectField>*, bool) (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x511dd9) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #2 0x55b07f07302b in initFunction(UniqueType*, Namespace*, ObjectDef*, ObjectMethod::Type, StrTmpl<char> const&, int, int, int, UniqueType**, bool, bool, GenericType*) (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x4e602b) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #3 0x55b07f073a79 in initFunction(UniqueType*, ObjectDef*, ObjectMethod::Type, StrTmpl<char> const&, int, int, bool, bool, GenericType*) (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x4e6a79) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #4 0x55b07f088c26 in Compiler::declareIntFields() (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x4fbc26) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #5 0x55b07f09e784 in Compiler::declarePass() (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x511784) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #6 0x55b07f0dc81d in Compiler::compile() (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x54f81d) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #7 0x55b07ef5a2d8 in main (/home/zhihao/colm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf/src/bootstrap0+0x3cd2d8) (BuildId: 71fd095e43b1ef0ea62a11bd407038bb443554d8)
    #8 0x7f922a029d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: AddressSanitizer: 1161600 byte(s) leaked in 11961 allocation(s).