hasindu2008/slow5tools

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

AnjanaSenanayake opened this issue · 2 comments

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.

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

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