-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
While running the following program, it hangs at delete multiIndex; and won't finish. Valgrind gives me the following error:
==13922== Conditional jump or move depends on uninitialised value(s)
==13922== at 0x4E8DFA0: pocolog_cpp::MultiFileIndex::~MultiFileIndex() (MultiFileIndex.cpp:24)
==13922== by 0x4058CE: main (in /home/dfki.uni-bremen.de/afabisch/tmp/test/tools/pocolog2hdf5/build/pocolog2hdf5)
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include <pocolog_cpp/MultiFileIndex.hpp>
#include <pocolog_cpp/Stream.hpp>
#include <pocolog_cpp/InputDataStream.hpp>
std::vector<std::string> getFilenames(int argc, char *argv[])
{
const int numFiles = argc - 1;
std::vector<std::string> filenames(numFiles);
for(int i = 0; i < numFiles; i++)
filenames[i] = argv[i + 1];
return filenames;
}
int main(int argc, char *argv[])
{
if(argc == 1)
{
std::cerr << "No logfile given" << std::endl;
return EXIT_FAILURE;
}
pocolog_cpp::MultiFileIndex* multiIndex = new pocolog_cpp::MultiFileIndex();
std::vector<std::string> filenames = getFilenames(argc, argv);
multiIndex->createIndex(filenames);
const size_t numSamples = multiIndex->getSize();
std::vector<pocolog_cpp::Stream*> streams = multiIndex->getAllStreams();
const size_t numStreams = streams.size();
std::vector<pocolog_cpp::InputDataStream*> dataStreams(numStreams);
for(size_t i = 0; i < numStreams; i++)
dataStreams[i] = dynamic_cast<pocolog_cpp::InputDataStream*>(streams[i]);
std::cout << numSamples << " samples X " << numStreams << std::endl;
for(size_t t = 0; t < numSamples; t++)
{
for(size_t i = 0; i < numStreams; i++)
{
std::cout << "t = " << t << ", column = " << i << std::endl;
std::cout << dataStreams[i]->getName() << std::endl;
}
}
delete multiIndex;
std::cout << "deleted" << std::endl;
return EXIT_SUCCESS;
}Metadata
Metadata
Assignees
Labels
No labels