hasindu2008 / slow5lib

slow5lib is a software library for reading & writing SLOW5 files.
https://hasindu2008.github.io/slow5lib
MIT License
41 stars 4 forks source link

Double free when using Path instead of str #80

Closed maximilianmordig closed 4 months ago

maximilianmordig commented 1 year ago

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.

Psy-Fer commented 1 year ago

Hello,

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

So that is working as intended.

James

hasindu2008 commented 11 months ago

@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.