Skip to content

Instantly share code, notes, and snippets.

@kootenpv
Created July 30, 2016 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kootenpv/5e86cd2f38220f6bccadfc175e475da1 to your computer and use it in GitHub Desktop.
Save kootenpv/5e86cd2f38220f6bccadfc175e475da1 to your computer and use it in GitHub Desktop.
malloc: *** error in re for Python 3.5
import re
def fn():
scanner = re.Scanner([
(r'([0-9]{2}):([0-9]{2}):([0-9]{2})', lambda y, x: x),
(r'.', lambda y, x: x)
])
return scanner.scan("10:10:10")
# This works on Python 2.7, but not on Python 3.5
for i in range(10):
print(fn())
# Error: Python(87764,0x7fff72029000) malloc: *** error for object 0x10331d4e8: incorrect checksum for freed object - object was probably modified after being freed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment