hasindu2008 / slow5tools

Slow5tools is a toolkit for converting (FAST5 <-> SLOW5), compressing, viewing, indexing and manipulating data in SLOW5 format.
https://hasindu2008.github.io/slow5tools
MIT License
90 stars 6 forks source link

[Error][Improvement] Unhandled error while file writing in a non-permitted directories #88

Closed AnjanaSenanayake closed 11 months ago

AnjanaSenanayake commented 1 year ago

Issue

slow5tools exits with a segmentation fault error when trying to write a file to a directory with no write access.

Backtrace

[segv_handler::ERROR] I regret to inform that a segmentation fault occurred. But at least it is better than a wrong answer.
[src/main.c(segv_handler:75)::DEBUG] Here is the backtrace:
/lib/x86_64-linux-gnu/libc.so.6(fwrite+0x1e)[0x7f3e1c44586e]
/home/e14317/Workspace/DeepSelectNet/tools/slow5tools-v0.3.0/slow5tools(slow5_idx_write+0x8f)[0x46100f]
/home/e14317/Workspace/DeepSelectNet/tools/slow5tools-v0.3.0/slow5tools(slow5_idx_to+0x6d)[0x462ebd]
/home/e14317/Workspace/DeepSelectNet/tools/slow5tools-v0.3.0/slow5tools(slow5_idx_create+0x2f)[0x458caf]
/home/e14317/Workspace/DeepSelectNet/tools/slow5tools-v0.3.0/slow5tools(_Z10index_mainiPPcP12program_meta+0x296)[0x43a076]
/home/e14317/Workspace/DeepSelectNet/tools/slow5tools-v0.3.0/slow5tools(main+0x6fb)[0x4343eb]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f3e1c3e7c87]
/home/e14317/Workspace/DeepSelectNet/tools/slow5tools-v0.3.0/slow5tools[0x4344c5]

To reproduce

Execute slow5tools index or similar command with output file writing, in a directory which has no write-access.

hasindu2008 commented 1 year ago

Thanks @AnjanaSenanayake, will handle this case in the next version

hasindu2008 commented 11 months ago

This is fixed in the latest version in dev branch now.