Karim Belabas on Mon, 06 Feb 2012 14:21:58 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: PARI and valgrind |
* Bill Allombert [2012-02-06 14:16]: > 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. Note that this is mentioned in the (short) slide http://pari.math.u-bordeaux1.fr/Events/PARI2012/talks/new.pdf which is part of the webpage dedicated to the PARI/GP Atelier 2012 http://pari.math.u-bordeaux1.fr/Events/PARI2012/ already posted on this list :-) Cheers, K.B. -- Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17 Universite Bordeaux 1 Fax: (+33) (0)5 40 00 69 50 351, cours de la Liberation http://www.math.u-bordeaux1.fr/~belabas/ F-33405 Talence (France) http://pari.math.u-bordeaux1.fr/ [PARI/GP] `