[Bug] Segmentation fault for M1 Mac
coder2003lucky opened this issue · 6 comments
Hi eFEL developers,
Recently I've found that on the new MacBook M1 computation of efel features (even with version 4.0.32) results in an occasional segmentation fault.
OS: Darwin 21.3.0
Python version: Python 3.9.7
GCC version: 4.2.1
GCC target arch: arm64-apple-darwin21.3.0
eFEL version: 4.0.32
numpy version: 1.23.1
GNU Make version: 3.81
attached is a reproducible example (pickle files and python code)
seg_fault.tar.gz
below is the code to reproduce:
import pickle
import efel
import numpy as np
with open('traces.pkl', 'rb') as f:
traces = pickle.load(f)
with open('score_funcs.pkl', 'rb') as f:
score_funcs = pickle.load(f)
score_functions = np.unique(score_funcs).tolist()
custom_score_functions = [
'chi_square_normal',\
'traj_score_1',\
'traj_score_2',\
'traj_score_3',\
'isi',\
'rev_dot_product',\
'KL_divergence']
for i in range(len(score_functions)):
score_functions[i] = score_functions[i].decode()
for f in score_functions:
if f in custom_score_functions:
continue
traces_results = efel.getFeatureValues(traces, [f], raise_warnings=False)
print('success')
thank you in advance for your support!
Thx for the example. I can also reproduce this on an Intel MBP. @AurelienJaquier will have a look.
@AurelienJaquier has fixed this in #239 .
A new version of eFEL has been released, i.e. 4.0.34 (https://pypi.org/project/efel/4.0.34/)
I tested it myself, after upgrade eFEL the issue disappeared for your example.
Btw @coder2003lucky , would you mind if we use the offending trace in a test for this case (and as such commit it in the repository) ?
Sure, go ahead. Thanks for the help!
@AurelienJaquier could you add a regression test based on the part of the trace that caused the issue? Thx
Yes, I added a test in PR #241
Sorry hadn't seen that yet, was still going through my emails :-) Thx!