sib-swiss / pftools3

A suite of tools to build and search generalized profiles
GNU General Public License v2.0
10 stars 7 forks source link

Increase maximum filename size #8

Closed duboism closed 4 years ago

duboism commented 4 years ago

As reported here, pfscan generates a segmentation fault when the path of the input files exceeds a certain number of characters. It seems to be related to the use of fixed size strings (length 512) for filenames in pfscan.f (and probably other programs).

A common (but not perfect) practice is to rely on the value of MAX_PATH from <limits.h> (see here). I don't know how to get this value in Fortran (maybe detecting it from CMake and passing it to the compiler is the best option).

smoretti commented 4 years ago

Hi pfscanV3 (pfscan rewritten in C++ with heuristic improvements) should not have such issue. Could you use that one or the old pfscan is mandatory for you?

duboism commented 4 years ago

Hi,

Thanks for your suggestion. In fact, most of the time, we don't use use pfscan directly but we use interproscan which in turns use ps_scan.pl which in turns use pfscan (hence we also reported #9).

Is there a way to force interproscan to use v3 ?

smoretti commented 4 years ago

Development of pftools V3 started years ago following a request of interproscan to speed up queries on Prosite. So interproscan should have a way to switch to pftools v3 somewhere

duboism commented 4 years ago

AFAICS, pftoolsV3 is not in the binaries provided by interproscan so I think that this is not possible right now. I have asked them.

gsn7 commented 4 years ago

@duboism thanks for this update. We had tested pfsearchV3 in InterProScan probably at v3.0 when it was at ftp://ftp.lausanne.isb-sib.ch/pub/software/unix/pftools/pftoolsV3, but we found it wasn't stable enough to include in InterProScan for public use. We had identified errors which were fixed and the fixed version sent to us but the files and the documentation at ftp://ftp.lausanne.isb-sib.ch/pub/software/unix/pftools/pftoolsV3 were not updated.

We will now test the new version

smoretti commented 4 years ago

Hi @duboism Patches have been applied to increase the filename size for pftools v2. The new size follows today usage on Linux.

Could you let us know if it works for you? This is in the master branch.

duboism commented 4 years ago

Sorry, I missed the notification. I will be happy to help but I don't know how to use pfscan. Can you provide a simple example ? I will then test with increasing file name length.

smoretti commented 4 years ago

Here are two examples coming from the test suite (files are in the tests/examples/ folder)

pfscan -s GTPA_HUMAN.dat prosite13.prf
pfscan -by -C 2 CVPBR322.embl ecp.prf
duboism commented 4 years ago

I tested pfscan with longer and longer filename. For the tag v3.2.5 (before #12), pfscan starts to fail if the filename is longer than 512: one can clearly see that filename truncated to 512 in pfscan and it returns 1. For the current master, the shell will start to fail when the filename is longer that 4096.

So I can confirm that it works now. :+1:

smoretti commented 4 years ago

Great! Thank you for testing