Read_MPS_Mesg function (AS_MSG_pmesg1.c:892) crashes on line 913 due to overlapping memory provided by the GetMemory function (AS_MSG_pmesg.c:30). The img struct and imp->delta was overlapping (when asmOutputFasta was executed on a metagenomic dataset) causing imp->delta[i++] = n; (ln 913) to eventually overwrite the delta pointer causing undefined behavior and crash.
The problem is solved by increasing the memory pool allocated through changing line 303 in AS_MSG_pmesg1.c from:
AS_MSG_globals->msgMax = 256;
to
AS_MSG_globals->msgMax = 512;
I was running v 6.1. It took me a whole afternoon to locate this bug as I have not previously had a look at the celera-wgs code-base and I must say I am not used to getting overlapping memory through a GetMemory function. Hopefully this is helpful and could save some time to others
Best Regards,
Fredrik Lysholm
IFM Bioinformatics
Linköping University
Sweden
A recompile of buildPosMap with above fix solved a crash of the consequent buildPosMap run. Thus without examining any source code I am guessing buildPosMap suffer from the same issue.
Thank you for this detailed report. It is related to other problems with record size exceeding the buffer. We should fix or document the whole collection in our next release.
Thanks for finding, fixing and reporting. The GetMemory() function in the CVS version should not suffer from this problem. I'll leave the case open until we get a new release out.
Unless show-stopping bugs are found, the new release will be out this week.