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

Percolator: input error under win (v 1.17) (Carmen, Thermo) #15

Closed
mattiat opened this issue Jan 18, 2011 · 8 comments
Closed

Percolator: input error under win (v 1.17) (Carmen, Thermo) #15

mattiat opened this issue Jan 18, 2011 · 8 comments
Labels

Comments

@mattiat
Copy link

mattiat commented Jan 18, 2011

No description provided.

@mattiat
Copy link
Author

mattiat commented Jan 18, 2011

_ the provided input.xml file works in linux but not under windows
_ "something" happens at the level of Caller::xv_step() (but only once the code is compiled for windows??)
_ under windows, the error disappears if and extra "featureDescription" is added in the input.xml

@mattiat
Copy link
Author

mattiat commented Jan 20, 2011

_last bit of code that gets executed is ssl::CGLS() (line 323), right before releasing some dynamic memory. Seems to be a memory allocation problem

@mattiat
Copy link
Author

mattiat commented Jan 25, 2011

_ error occurs if input.xml if number of "featureDescription"<=9
_ (on cerr) FeatureNames::getNumFeatures reports the correct value

@mattiat
Copy link
Author

mattiat commented Jan 27, 2011

_ removing empty "FragmentSpecturmScan"s in input.xml has no effect

@mattiat
Copy link
Author

mattiat commented Jan 28, 2011

_ cross-debugging: minGW debugger + Wine (on Fedora): -G"Eclipse CDT4 - Unix Makefiles" flag combined with minGW toolchain generates an eclipse project with .exe binaries!

@mattiat
Copy link
Author

mattiat commented Feb 1, 2011

Reached Wine through remote debugging with gdbserver (http://mingw-cross.sourceforge.net/cross_debug.html). gdbserver.exe distributed with minGW for windows.
_ percolator.exe now crashes at the return 0 statement of Caller::run() (executable shows different behavior on windows and emulated under wine)

@mattiat
Copy link
Author

mattiat commented Feb 3, 2011

_ Memory allocated by in Caller::readFiles() line 489 by xercesc::XMLPlatformUtils::Initialize() was not being freed: added call to method xercesc::XMLPlatformUtils::Terminate() in destructor of Caller object! -> SOLVED 99% of memory leaks!
http://stackoverflow.com/questions/4680191/when-calling-xmlplatformutilsinitialize-on-xerces

@mattiat
Copy link
Author

mattiat commented Feb 8, 2011

SOLVED: after svn training, a check of correctness is performed by Caller::pCheck, an object of static type SanityCheck. It should purposively be instantiated according to type of file used in creating the pin file given in input to Percolator. Instead, it is always assigned an object of dynamic type SqtSanityCheck. As a consequence the following implementation of function getDefaultDirection is used which assumes an sqt file was used.

SqtSanityCheck::getDefaultDirection() {
// some code
for (unsigned int ix = 0; ix < numFeatures + 1; ++ix) {
    w[set][ix] = 0;
}
// some more code
w[set][10] = -0.156; // writing to uninitialized vector position

The problem is that the above instructions assume that the pin file contains at least 10 features (as any pin file generate from sqt would). If it does not, an uninitialized position of the std::vector w[set] is accessed and a memory fault might occur (it is up to the operating system to decide how to handle the basic data structure underlying a vector).

The solution I implemented adds a method to the class Caller that takes care of initializing its SanityCheck field to the appropriate value; it does this through a (potentially extendible series of) if statement(s) so that an object of the most suitable dynamic type is instantiated. I decided not to do this inside the SanityCheck class because the information that is needed to decide which subclass to instantiate is available at the level of the Caller object. In case nothing more specific seems to apply, I instantiate an object of base class SanityCheck().

void Caller::initializeSanityCheck() {
if(otherCall.find(SqtSanityCheck::fingerPrint)!= string::npos)
    pCheck = new SqtSanityCheck();
else // if (SomeOtherSanityCheck) 
      // {pCheck = new SomeOtherSanityCheck();} else
    pCheck = new SanityCheck();
}

Resolved with commit 2b79177

EDIT: eventually moved initialization logic inside SanityCheck, commit aac5107

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

No branches or pull requests

1 participant