Hello Greg, About the seg faults problem you reported, For now, I disabled bytecode compilation for this case. Cint 5.14.79 detects array initialization with function argument, and abort bytecode compilation. It slows down execution a little, otherwise, user will not notice it. If you need a speed, I recommend to you to allocate a dynamic memory area for variable size array in that function. Thank you Masaharu Goto >Date: Thu, 1 Mar 2001 23:51:25 +0100 (MET) >From: Rene Brun <Rene.Brun@cern.ch> >To: Gregory Novak <Gregory.Novak@cern.ch> >Cc: roottalk@pcroot.cern.ch, rootdev@pcroot.cern.ch >Subject: CINT: Re: [ROOT] Strange seg faults > >Hi Greg, >This seems to be a CINT optimization problem. >It runs with optimisation level 3 or below but not with level 4 >select >root > .O3 > >I am forwarding the problem to Masa. > >Rene Brun > >On Thu, 1 Mar 2001, Gregory Novak wrote: > >> I'm using Root 2.25.03 and I'm getting segmentation faults I don't >> understand. This has something to do with array allocation and >> function arguments. I'm loading a bunch of c++ code via .L, containing >> the following two functions: >> >> void profMedian2(Float_t x[], Float_t y[], const Int_t nBins) { >> for (Int_t i=0; i<nBins; i++) { >> sliceMedian2(x,y,nBins); >> } >> } >> >> Float_t sliceMedian2(Float_t x[], Float_t y[], const Int_t n) { >> Float_t sortedX[n]; >> return 0; >> } >> >> Then I have the following in a macro. >> { >> Float_t x[500]; >> Float_t y[500]; >> profMedian2(x, y, 500); >> } >> >> When I run the macro, Root gives me a segmentation fault. There are a few >> things that are confusing: The seg fault comes when root tries to call >> sliceMedian2, but I can run it directly without trouble. If I change the >> arguments of sliceMedian2 or profMedian2, the seg fault goes away. Also, >> if I take out the for loop around the call to sliceMedian2, the seg fault >> goes away. This is in spite of the fact that the seg fault comes on the >> first pass through the loop. >> >> So, is there any solution to this? >> >> Thanks! >> Greg >> >> >> >
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:39 MET