I’m trying to port a library, which correctly works in Windows, to Linux.
In these lines of code I get an error:
long* permutation = new long[result->getGeneListCount()];
for(long i=0; i<result->getGeneListCount(); i++)
permutation[i]=i;
Util::ArrayUtil::DurstenfeldArrayPermutation<long>(permutation, result->getGeneListCount());
//result->PerformGenePermutation(permutation);
std::cout << "Just skipped the permutation" << std::endl;
delete[] permutation;
The error seems, to me, to occur during the deletion. I know that, since I have commented the PerformGenePermutation(), I could simply comment also the other lines, but similar problem could appear again in the other code, so I would like to understand the error.
The error-output which I get is:
*** glibc detected *** /usr/lib/jvm/java-7-oracle/bin/java: munmap_chunk(): invalid pointer: 0x09f287f8 ***
Can anyone help me, please?
Please, ask me if you need further details.
The given code & info is not sufficient to nail down the cause of the problem, but you can do the following:
replace the code
with
Note that the
deleteis removed sincestd::vectordoes that automatically for you.If this now throws an exception from range error from
std::vector::at, well then you know that the size is probably zero. Anyway you can now very simply check that in your debugger. And more importantly, if it does not throw an exception, then you know that all’s well and good with this code (becausestd::vectoris reliable), so the problem is then elsewhere.Unfortunately this was too long to post as a comment, but it’s not really an answer. This is a problem with SO. Since it’s designed for pure answers it doesn’t support general help.