Crash in TProfile BuildOptions

Hi all,

This is probably an error of my own fault, but I’m not seeing what goes wrong currently.
I’m creating a TProfile from a th2d Histogram. Then I want to change the errors to RMS errors instead :

TProfile* projection_mc_sm_x_1=mc_sm->ProjectionY("mc_sm_px_1",1,1,"eo");
projection_mc_sm_x_1->BuildOptions(0,0,"s");

I get an crash, which either displays:

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00002abf3c06bb4c in __libc_waitpid (pid=44876, stat_loc=stat_loc
entry=0x7fff5f2e1040, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:31
#1  0x00002abf3bff12e2 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2  0x00002abf3b12b893 in TUnixSystem::StackTrace() () from /scratch/jvamen/root/lib/libCore.so
#3  0x00002abf3b12d59c in TUnixSystem::DispatchSignals(ESignals) () from /scratch/jvamen/root/lib/libCore.so
#4  <signal handler called>
#5  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:33
#6  0x00002abf3b0d21d2 in TArrayD::Set(int) () from /scratch/jvamen/root/lib/libCore.so
#7  0x00002abf3eef7a23 in void TProfileHelper::BuildArray<TProfile>(TProfile*) () from /scratch/jvamen/root/lib/libHist.so
#8  0x00002abf3eef2af4 in TProfile::BuildOptions(double, double, char const*) () from /scratch/jvamen/root/lib/libHist.so
#9  0x00002abf3f0832bb in G__G__Hist_334_0_27(G__value*, char const*, G__param*, int) () from /scratch/jvamen/root/lib/libHist.so
#10 0x00002abf3ca3594d in Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) () from /scratch/jvamen/root/lib/libCint.so
#11 0x00002abf3cad9bc7 in G__execute_call () from /scratch/jvamen/root/lib/libCint.so
#12 0x00002abf3cad9f85 in G__call_cppfunc () from /scratch/jvamen/root/lib/libCint.so
#13 0x00002abf3cab94ff in G__interpret_func () from /scratch/jvamen/root/lib/libCint.so
#14 0x00002abf3caa6c89 in G__getfunction () from /scratch/jvamen/root/lib/libCint.so
#15 0x00002abf3cb8ffd5 in G__getstructmem(int, G__FastAllocString&, char*, int, char*, int*, G__var_array*, int) () from /scratch/jvamen/root/lib/libCint.so
#16 0x00002abf3cb874ce in G__getvariable () from /scratch/jvamen/root/lib/libCint.so
#17 0x00002abf3ca80b0f in G__getitem () from /scratch/jvamen/root/lib/libCint.so
#18 0x00002abf3ca864b5 in G__getexpr () from /scratch/jvamen/root/lib/libCint.so
#19 0x00002abf3cb0948d in G__exec_statement () from /scratch/jvamen/root/lib/libCint.so
#20 0x00002abf3ca6d421 in G__exec_tempfile_core () from /scratch/jvamen/root/lib/libCint.so
#21 0x00002abf3ca6e98b in G__exec_tempfile () from /scratch/jvamen/root/lib/libCint.so
#22 0x00002abf3cb1b002 in G__process_cmd () from /scratch/jvamen/root/lib/libCint.so
#23 0x00002abf3b0f3530 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /scratch/jvamen/root/lib/libCore.so
#24 0x00002abf3b0ec4ab in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /scratch/jvamen/root/lib/libCore.so
#25 0x00002abf3b05a80c in TApplication::ExecuteFile(char const*, int*, bool) () from /scratch/jvamen/root/lib/libCore.so
#26 0x00002abf3b059d40 in TApplication::ProcessLine(char const*, bool, int*) () from /scratch/jvamen/root/lib/libCore.so
#27 0x00002abf3b86e1bd in TRint::Run(bool) () from /scratch/jvamen/root/lib/libRint.so
#28 0x0000000000400fdc in main ()
===========================================================


The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:33
#6  0x00002abf3b0d21d2 in TArrayD::Set(int) () from /scratch/jvamen/root/lib/libCore.so
#7  0x00002abf3eef7a23 in void TProfileHelper::BuildArray<TProfile>(TProfile*) () from /scratch/jvamen/root/lib/libHist.so
#8  0x00002abf3eef2af4 in TProfile::BuildOptions(double, double, char const*) () from /scratch/jvamen/root/lib/libHist.so
===========================================================

Or:

*** Error in `/scratch/jvamen/root/bin/root.exe': double free or corruption (out): 0x00002aeec5489210 ***

Who knows why this doesn’t work, what I’m doing wrong and how I should do it to change the errors to rms errors?
ROOT VERSION
Version 5.34/22 10 October 2014

Hi,

You are calling the wrong method, you should use TH2::ProfileY to get a Profile, TH2::ProjectionY returns a TH1D histogram.
This is a limitation of CINT, if you use ROOT 6, you would get a correct error when doing
TProfile * p = TH2::ProjectionY()

Best Regards

Lorenzo