Problem 2065 - P02 crashes at runtime with "read" parameter
Summary: P02 crashes at runtime with "read" parameter
Status: RESOLVED FIXED
Alias: None
Product: Examples/Extended
Classification: Unclassified
Component: persistency/P01,P02 (show other problems)
Version: 10.4
Hardware: PC Linux
: P4 normal
Assignee: Witold.Pokorski
URL:
Depends on:
Blocks:
 
Reported: 2018-06-07 22:05 CEST by Zoltan
Modified: 2018-06-15 17:16 CEST (History)
0 users

See Also:


Attachments
fix diff (2.84 KB, text/plain)
2018-06-15 17:15 CEST, Witold.Pokorski
Details

Note You need to log in before you can comment on or make changes to this problem.
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