Comments (4)
I suspect that the issue caused by an incorrect use of sizeof
:
for (uint32 j = 0; j < sizeof(ri.m_dist); ++j)
ri.m_dist[j] = m_seq[i] == j ? 1 : 0;
m_dist
is declared as follows:
struct MResInfo
{
...
...
uint32 m_dist[23];
...
...
};
sizeof
returns the size in bytes of the entire array, not the length as is assumed. This means that the loop exeeds the end of the array, causing the segmentation fault.
Getting the length of an array is notoriously hard (see: http://stackoverflow.com/questions/874169/how-to-get-the-size-of-an-array). The array is created as a fixed size, so the loop should use this to control when it ends.
from hssp.
This bug was introduced in commit e839fd8 on 01/06/2012.
from hssp.
This bug only happens when compiled with -O2
(optimisation level 2) is used. When -O0
(no optimisations) is used, the program produces output (whether this is correct is now another question) without crashing.
from hssp.
This is definitely a bug. When using the hard-coded array-length, the output is correct for 1f2i
for which the error was raised.
@jonblack Compilation of the bugged code without optimization results in incorrect output for 1f2i
as well.
from hssp.
Related Issues (20)
- Could not link against boost_date_time HOT 14
- Unused function in hssp-convert-3to1.cpp causes error in make on Mac OS 10.14.3
- issue with installation xssp-3.0.2 HOT 6
- Boost Errors When I Try to Run make HOT 37
- Boost error while running make HOT 23
- 503 Service Unavailable HOT 3
- mkhssp does not output HOT 2
- I want to calculate the helix content, so which tool is much better? HSSP or DSSP? HOT 6
- Get HSSP Database HOT 4
- ChecksumError HOT 4
- Access HSSP Database HOT 2
- How HSSP calculates ENTROPY?
- A bug about hssp3.0.0 HOT 1
- Cannot make container from Dockerfile or singularity.sif HOT 2
- Looking for Docker workaround (mac high sierra) HOT 1
- Unable to compile on M1 mac due to libboost dependency HOT 3
- make error for linux @ cbaakman HOT 8
- Issue with compiling in C++14 and std::random_shuffle HOT 1
- Failed to connect to download the data HOT 2
- Failed to compile with boost 1.85.0: missing boost/filesystem/convenience.hpp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hssp.