Hi,
I am trying to generate a TTree with a HepMC::GenEvent branch in my application. However it crashes with “Program received signal SIGBUS, Bus error”
0x00007ffff4a78701 in TEmulatedMapProxy::WriteMap(int, TBuffer&) () from /opt/root/lib/root/libRIO.so.5.30
This is a standalone application so I created a dictionary with
where ROOTFLAGS=$(root-config --cflags), and linked this into my application.
Then in my code I set the branch with
HepMC::GenEvent *m_myEvent=new HepMC::GenEvent();
TTree* m_myTree=new TTree("hepMCTree","A simple tree containing HepMC::GenEvent's. load libHepMCDict.so to use");
m_myTree->Branch("evnt","HepMC::GenEvent",&m_myEvent);
Then I construct m_myEvent and the code crashes when I call m_myTree->Fill();
I checked m_myEvent and it is a valid HepMC::GenEvent. I also tried adding the branch with
m_myTree->Branch("evnt","HepMC::GenEvent",m_myEvent);
or
m_myTree->Branch("evnt","HepMC::GenEvent",*m_myEvent);
without any change
I attached the hepmc_linkdef file. I tried it with and without “using namespace HepMC;” as well as with and without #include statements.
I am using root version 5.30. and according the posts and the example in this forum, it should work.
Can somebody tell me if I am making a mistake in dictionary generation or somewhere else?
[quote]0x00007ffff4a78701 in TEmulatedMapProxy::WriteMap(int, TBuffer&) () from [/quote]The fact that it use s the emulatedMapProxy indicates that somehow it is missing at least the dictionary for one of the std::map used in HepMC. I think that there is now a supported (by HepMC) way of generating the dictionary (i.e. at the very least an official linkdef file), did you start from that?
Did you compile, link and load the result of rootcint.cxx?
I couldn’t be able to find official HepMC linkdef file. I saw it mentioned but it seems that it is not there yet. I am using HepMC-2.06.05 and it doesn’t seem to contain any linkdef file. Just to be sure I did another search on the internet and failed to find anything again. A grep -ir "#pragma " in source folder also doesn’t return anything. Do you know where can I find it?
creating libHepMCDict.so and then I link it with my program. Isn’t that the correct approach?
I added pragma statements for all std:map types and std::pair types that are used in the HepMC sources to linkdef file and it is still failing with
#0 0x00007ffff4a78701 in TEmulatedMapProxy::WriteMap(int, TBuffer&) () from /opt/root/lib/root/libRIO.so.5.30
I attached the uploaded linkdef file. Do you have any idea why could this be happening? If needed I can provide a stack trace, unfortunately without debug symbols.