RE:[Fwd: [ROOT] Segentation violation with

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Sat Jun 09 2001 - 15:08:21 MEST


Hello Aurelien,

Now, I fixed this problem in Cint5.15.03.  It is likely that 
this version won't be exposed until after ROOT2001 workshop.
Please wait for a while.

Thank you
Masaharu Goto


>-----------------------------------------------------------------------------
-
--
>Date: Wed, 06 Jun 2001 18:22:30 +0200
>From: Aurelien COTTRANT <cottrant@lapp.in2p3.fr>
>To: roottalk@pcroot.cern.ch
>Subject: [ROOT] Segentation violation with calloc
>
> Hello,
> 
> When I try this single sample of code, CINT crash with a segmentation
> violation error. Without the references to massmatrn[i][j], it works
> fine. I use ROOt ver 3.00/06. Could anyone help me
> 
> void test()
> {
> 
> double ***massmatrn;
> massmatrn =(double ***) calloc (2, sizeof(double**));
> 
> for (int i = 0; i<2 ; i=i+1)
>         massmatrn[i] = (double **) calloc (2, sizeof(double*));
> 
> for (int j = 0; j<2 ; j=j+1)
>         for (int i = 0; i<2 ; i=i+1)
>                 massmatrn[i][j] = (double *) calloc (2,
>sizeof(double));
> 
> for (int i = 0; i<2 ; i=i+1)
>         for (int j = 0; j<2 ; j=j+1)
>                 free(massmatrn[i][j]);
> 
> for (int i = 0; i<2 ; i=i+1)
>         free(massmatrn[i]);
> 
> free(massmatrn);
> 
> }
> 
> Aur駘ien Cottrant
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:49 MET