Re: debugging a seg fault

From: Roger Mason <rmason_at_esd.mun.ca>
Date: Thu, 6 Nov 2008 15:13:33 -0330


Hello John,

John <idarraga_at_cern.ch> writes:

> You are probably blowing the stack defining that matrix in that way.
>

> Move your stuff to the heap memory, it means ... allocate your "word"
> matrix using the "new" operator. If you don't know how to implement it
> let me know.

Many thanks. At the back of my mind after I sent the message the words "heap" and "stack" appeared, but too late!

I now have

  Int_t (*word)[48];
  word = new Int_t[nenergies][48];

and it compiles and runs, at least when the value of nenergies is only 6.

Thanks again,
Roger Received on Thu Nov 06 2008 - 19:48:41 CET

This archive was generated by hypermail 2.2.0 : Thu Nov 06 2008 - 23:50:02 CET