jacobaustin123 / Coral

The Coral Programming Language: a blazingly-fast, gradually-typed Python compiler with optional static typing for optimization and safety.
https://jacobaustin123.github.io/Coral/
Other
143 stars 6 forks source link

Adding a list with exactly two or three ints or bools to itself leads to a malloc fault #7

Closed jacobaustin123 closed 4 years ago

jacobaustin123 commented 5 years ago

If you had a lists with exactly two integers or booleans to itself, you get a malloc-related segfault. For example:

x = [1, 2]
print(x + x)

x = [True, False]
print(x + x)

The error message is:

a.out(34458,0x7fff8b278380) malloc: *** error for object 0x7ff9c8c02818: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
/bin/sh: line 1: 34458 Abort trap: 6           ./a.out

This is mysterious, but might have to do with lists reusing pointers.