Hi Jiri, You are right . I only checked "root -b start.C" which is ok and .L start.C; start() has a problem. Eddy --- Jiri Masik <masik@fzu.cz> wrote: > Edmond Offermann <edmondoffermann@yahoo.com> writes: > > > Hi Mathieu, > > > > I guess scoping issues in CINT . Bring the TCut > > declarations out of the loop: > > > > void start() > > { > > int max=30; > > int iterator=0; > > TCut cut1; > > TCut cut2; > > TCut cut; > > while(iterator!=max) > > { > > if(iterator<10 || iterator>20) // <--- > ********* > > { > > cout<<"hello: "<<iterator<<endl; > > TString str_cut1="detCEL==1"; > > cut1=str_cut1; > > TString str_cut2="sampCEL==2"; > > cut2=str_cut2; > > cut = cut1 && cut2; // <--- ********* > > } > > ++iterator; > > } > > } > > > > Hi Eddy, Mathieu, > > I agree that it is better to move the declarations > above the loop. > However it does not solve the problem in this > particular case (if you > load the file via .L and then run start()). It looks > like an > optimization error in Cint. The segmentation > violation occurs for > iterator==11 in pcode.c:1685 where G__p_tempbuf is > freed (I was > running Root in valgrind). It does not happen if you > run with .O0 or > if you rewrite the loop to use for statement instead > of while. > > cheers > Jiri > >
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET