Page 1 of 2

MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 1:45 pm
by CaptFrito
Greetings all

I am in the middle of refactoring a project and I get the following error when I build in debug mode (using RealICE):

Code: Select all
*** Error in `fixDeps': munmap_chunk(): invalid pointer: 0x09f41598 ***
make[2]: *** [build/default/debug/src/commands.o] Segmentation fault
make[2]: *** Deleting file 'build/default/debug/src/commands.o'
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-default.mk:443: recipe for target 'build/default/debug/src/commands.o' failed
make[2]: Leaving directory '/home/dbishop/MPLABXProjects/XBF32.X'


I am stumped, I have never seen this kind of error before. It doesn't exist in the original project. Any suggestions?

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 2:04 pm
by ric
What PIC are you using, and what are the versions of all the toolchain you are using?
Are you willing & able to upload the full project?

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 2:22 pm
by CaptFrito
I am using a PIC32MX795F512L, XC32 1.32, MPLABX IDE v2.15, Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01, System: Linux version 3.12.21-gentoo-r1 running on amd64; UTF-8; en_US (mplab)

I have copied the project over to my older development machine that runs a slightly older MPLABX and XC32 compiler and it has the same problem.

I can post my entire project, it is far from secret, but this code is my protyping framework. It is beastly adaptaion of the old MLA code that I inherited. It's always worked though, I created a new project ona new machine with the updated MPLAB/XC codes, moved the file locations a bit (subdirectory reorg). That's when I noticed the problem (a 'release build' does not report this error).

Where can I upload the code? I suppose I'd need to tar/bzip/gzip it...?

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 2:25 pm
by Tom Maier
munmap_chunk(): invalid pointer:


Looks like new compiler doesn't like this pointer.

Or maybe the target chip is different than before.

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 2:30 pm
by CaptFrito
Same target chip, same problem with a slightly older compiler... It's more-or-less the same code with a new file structure layout (new project, imported old files, added them to the new project). It bbuilds about 30 files before it slams into this error.

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 2:39 pm
by Tom Maier
Then my next guess would be that when the code was reshuffled it made the object pointed to become far, and the pointer type is not long enough to reach it.

I don't have a lot of big experience with the pic32, so this is just a guess based on seg faults I've gotten on other architectures.

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 2:45 pm
by CaptFrito
Shouldn't have, but that's a reasonable supposition. I will keep hammering on it... should know something in an hour. The obejective is to reorg this and start migrating it to harmony

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 4:56 pm
by jtemples
That's a bug in the tools; it means fixDeps is crashing.

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 5:20 pm
by CaptFrito
It aopears to be... I am trying to track it down so there's something to report, by it seems that it's relative path problem with fixDeps. I started out with a number of header and source files that were in directories three deep. I moved the directory that was the third level down up one level so it was a little clearer where all the files in the directory structure were. ince there was only a handful on includes to change I thought this would be a no-brainer. Maybe it's soeehting I am doing, or a sequencing thing, but we'll see. More to follow. Thanks for all the help everyone.

Re: MPLABX munmap makefle recipe error

PostPosted: Thu Jul 17, 2014 8:00 pm
by CaptFrito
This seems to be a bug in MPLABX and this fixDeps process. I ended up getting everything compiling, but I had to start all over again and change one file at a time and cause MPLABX to fix its own makefile one step at a time. I have one issue that remains: Whenever I move a single specific source/header file pair from down (up) one directory level and fix the #include's accordingly, it stops working. The errors do change too, sometimes it's the one I originally posted, other times it's not.

I still don't know why this is happening. On one hand, I guess I don't have to care anymore, but at another level I know I am working with a buggy toolchain that cost me an entire day.