riptable
riptable copied to clipboard
Segfault when using Cat.flags.writeable = True
Creating many times a multicat from Cat's who have flags.writeable = True cause a segfault.
The precise number of times you need to do this before it crashes is non-deterministic.
To preproduce the issue (with riptable version: 1.0.58):
import os
import sys
import riptable as rt
import numpy as np
print(f'{rt.__version__=}')
# We mute stderr as the loop below spams it with:
"""
Exception ignored in: <function Categorical.__del__ at 0x7f514934fe50>
Traceback (most recent call last):
File ".../lib/python3.8/site-packages/riptable/rt_categorical.py", line 4473, in __del__
del self._categories_wrap
AttributeError: _categories_wrap
"""
f = open(os.devnull, 'w')
sys.stderr = f
cat_len = 30
n_try = 10000
cat_1 = rt.Cat(np.arange(cat_len) % 10)
cat_2 = rt.Cat(np.arange(cat_len) % 11)
cat_1.flags.writeable = False
for _ in range(n_try):
r = rt.Cat([cat_1, cat_2])
f.close()