Bill Allombert on Mon, 06 Feb 2012 14:16:11 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: PARI and valgrind


On Mon, Feb 06, 2012 at 04:51:13PM +0900, Xavier-François Roblot wrote:
> Dear Pari dev,
> 
> I am trying to debug some C-functions that I am using in PARI/GP using the
> install functionality. One of the functions gives the following error:
> 
> malloc: *** error for object 0x1008126c0: pointer being freed was not allocated
> 
> I'd like to use valgrind to find out where the error happens exactly but I
> was not able so far to find any instructions on how to do that. If anybody
> could give me some hints me on how to proceed, I would be very grateful.

First, use a debug build of GP and your code.
Second, use
valgrind --db-attach=yes ./gp.dbg
and valgrind will offer you to use the debugger to investigate the problem.
There, you can use bt and up to locate the issue.

Cheers,
Bill