fProof Process - Including file with map

Hello All,

I am running a macro that launches a Process through TProof. The structure is basically:

auto parameters = new Parameters("test");
fProof->AddInput(parameters);
fProof->Load("methods.h+");
fProof->Load("parameters.h+");
fProof->Process(dset,"ReaderClass.C++");

Basically, I have a ReaderClass that gets information from a Parameters class that I input to the TProof file.

In my parameters.h I have these sort of includes:

#include "methods.h"
#include "testImport.h"

And inside my testImport.h I have:

#ifndef testImport_h
#define testImport_h

#include <TString.h>
#include <map>
#include "methods.h"

namespace testImport {
    map<TString,vector<int>> testmap = {
                                            {"test",{1,2,3}}
    };

    map<int,string> testmap2 = {
                                    {1,"test"},

    };
}

#endif

If I include the testImport.h in the Parameters.h, I get errors when my Process end with quite a large stackTrace. It begins with:

*** Error in `python’: double free or corruption (fasttop): 0x0000000006301d00 ***

Since the problem is to include “testImport.h”, I thought that the problem where the maps, so I tried having:

gInterpreter->GenerateDictionary("map<TString,vector<int>>","vector;map;TString.h");
gInterpreter->GenerateDictionary("map<int,string>","");
fProof_channel->Load("testImport.h+");

But still the problem persisted. Is there something I should do if I want to add as an #include, something to my Parameters.h?

Thanks!

It seems that if I change testImport.h to be a class instead of a namespace; the error disappears…

#ifndef testImport_h
#define testImport_h

#include <TString.h>
#include <map>
#include "methods.h"

class testImport {

    public:

    static map<TString,vector<int>> testmap() {
        return {
                                            {"test",{1,2,3}}
        };
    };

    static map<int,string> testmap2() {
        return {
                                    {1,"test"},
        };
    };
};

#endif

PS. I also noticed that if I add //!

map<TString,PlotTools> map_plotTools; //!

The error does not appear, but then in my TReader class, the map is empty; even though when AddInput(parameters) is called, the map is not empty.

Sorry isn’t this the same discussion as here:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.