slow5lib icon indicating copy to clipboard operation
slow5lib copied to clipboard

Double free when using Path instead of str

Open maximilianmordig opened this issue 2 years ago • 2 comments

Hi Hasindu Thank you for the very nice library. I have encountered a segmentation error and others may run into this as well.

from pathlib import Path
import pyslow5

s5_file = Path("runs/random_seqs.slow5")
# does not work: 
# free(): invalid pointer
# [1]    19462 IOT instruction  python test2.py
# pyslow5.Open(s5_file, 'r')
# fix:
pyslow5.Open(str(s5_file), 'r')

I can provide the slow5 file if needed.

maximilianmordig avatar Nov 08 '23 15:11 maximilianmordig

Hello,

The correct api for the input file is a string, not a path object.

So that is working as intended.

James

Psy-Fer avatar Nov 09 '23 01:11 Psy-Fer

@Psy-Fer We could add this information that the input argument to the Open is a string in our documentation?

I thought that given Python is independent of type, data types are converted automatically when needed.

hasindu2008 avatar Nov 28 '23 07:11 hasindu2008