Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproducible Segmentation fault in 2 seconds #21

Closed
vnaum opened this issue Jan 20, 2021 · 3 comments
Closed

reproducible Segmentation fault in 2 seconds #21

vnaum opened this issue Jan 20, 2021 · 3 comments

Comments

@vnaum
Copy link

vnaum commented Jan 20, 2021

input files / command line:
marafail3.zip

tested with latest version 1.01.1 as well as GIT HEAD 1.01.nightly-20-ab4aad8 on Xenial and Bionic Ubuntu releases.

GDB stacktrace:

#0  0x00000000004ecd17 in maracluster::PvalueVectors::writePvalueVectors(std::string const&, bool) ()
No symbol table info available.
#1  0x00000000004e5b9a in maracluster::MaRaCluster::run() ()
No symbol table info available.
#2  0x00000000004dc228 in main ()
No symbol table info available.
@MatthewThe
Copy link
Contributor

Thanks for reporting this issue!

The problem is that both of your spectra contain less than 15 peaks under 2000 m/z, which is the default number of minimum peaks. Therefore these spectra are not considered for clustering and the code tries to get the first element of an empty vector.

Of course it should give a more informative error than a segmentation fault, I will fix that.

@MatthewThe
Copy link
Contributor

I added a check to detect this situation and give a better error message. Currently, this minimum number of peaks has to be adjusted in the code

unsigned int PvalueCalculator::kMinScoringPeaks = 15u;

We have plans to change this into a command line parameter, but for the moment changing this variable would be a workaround if one really needs to compare spectra with fewer than 15 peaks.

@vnaum
Copy link
Author

vnaum commented Jan 20, 2021

Thanks for rapid response!

I will check number of peaks before passing it to maracluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants