Re: std::vector crash

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Fri, 17 Aug 2007 12:43:48 +0200


Hi Ilya,

please create a dictionary for vector<tR>. Totally independent remark: type names should not start with an underscore in C(++). See e.g. http://root.cern.ch/phpBB2/viewtopic.php?t=2369 on how to create that dictionary.

Cheers, Axel.

Ilya Orlov wrote:
> Hello ROOT people!
>
> I've unfortunately encountered a problem with std::vectors in CINT.
> I'm trying to fill a std::vector with a small structures in a following
> simple script:
>
> =========================================
> #include <stdlib>
> #include <vector>
>
> typedef struct _rrr {
> int s1;
> int s2;
> } tR;
>
> void VectorCrash() {
> tR r1;
> std::vector<tR> vr2;
>
> for(int i=0;i<1000;i++) {
> r1.s1=i;
> r1.s2=i/3;
> vr2.push_back(r1);
> }
> }
> =========================================
>
> The script together with ROOT itself fall down in Segmentation fault
> after near 500 cycle iterations.
> The same program compiled and run outside ROOT (with plain gcc) works
> perfectly.
>
> The ROOT version used is 5.10.
>
> Maybe I don't understand something? :)
>
> Thanks in advance.
>
> --
> Best regards,
> Ilya Orlov.
>
>
Received on Fri Aug 17 2007 - 12:43:55 CEST

This archive was generated by hypermail 2.2.0 : Fri Aug 17 2007 - 17:50:02 CEST