Glibc error

Hi all,

i do not understand why this code is throwing a problem of

jgomez2@jg-mini-linux:~/Desktop$ root EPFinalKolja.C
root [0]
Processing EPFinalKolja.C…

*** Error in `/usr/bin/root.exe’: free(): invalid next size (fast): 0x08dc4498 ***

On my machine but is working on my friends. I did not want to post the whole stack on here but i can if it will help.

      sprintf(res9title,"SO resolution HFPMINUSTRACK %i-%i %%",centlo[i],centhi[i]);
      SecondHFPMinusTrack[i]= new TProfile(res9name,res9title,1,0,1);

These are the lines that are messing up, I used to have %1.0f and changed that to %i just in case it was because i was running out of memory or something.

thanks to all for taking the time,

EPFinalKolja.C (31.1 KB)


this really seems to be a memory corruption unrelated to root. I would check the presence of out-of-bounds read/writes and maybe run valgrind to spot any bogus memory manipulation.


You misspelled HFSMinusTrack on line 69.

I suggest you try compiling your code to identify these issues. You can invoke the compiler by adding a plus sign after your macro name:.L EPFinalKolja.C+You will notice that you use the wrong type for sprintf and that you forgot the ‘.h’ after some of the ROOT headers.

Thanks very much that did it. I will remember that plus sign trick from now on.