Problem 2065

Summary: P02 crashes at runtime with "read" parameter
Product: Examples/Extended Reporter: Zoltan <zepofi>
Component: persistency/P01,P02Assignee: Witold.Pokorski
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 10.4   
Hardware: PC   
OS: Linux   
Attachments: fix diff

Description Zoltan 2018-06-07 22:05:13 CEST
Hello,

The example runs without error messages using "write" parameter but it crashes using "read parameter" when macro reaches "/run/beamOn" command. The message thrown on screen is:

 terminate called after throwing an instance of 'std::out_of_range'
   what():  vector::_M_range_check
 Aborted (core dumped)

Regards,
Zoltan
Comment 1 Witold.Pokorski 2018-06-15 17:15:56 CEST
Created attachment 498 [details]
fix diff
Comment 2 Witold.Pokorski 2018-06-15 17:16:36 CEST
Hi,

thanks for spotting that. The crash was due to the fact that for some reason two copies of the materials where being saved to the root file. To fix it, I removed the explicit pointer to the material table from ExP02GeoTree class (a helper class used to write the geometry tree + materials + elements to the root file). 
There was also an update needed in the selection.xml file due to some changes in the G4MaterialPropertiesTable class.

You can find the diffs in the attached file.

Cheers,
Witek