Writing scifi noise creates seg fault
It appears that writing data into the scifi noise data class will cause a seg fault. I'm running the current tracker devel version, and when I add the mapper SciFiTrackerMCNoise to the running python script, it will run, along with the rest of the mappers, but when all the scripts have run it will crash. When object SciFiNoise is empty everything appears to run fine. Attached are the relevant files. My gut reaction is that the problem is something to do with how the spill information is passed, but I don't know, I could really use some help hunting this down.
Updated by Heidt, Christopher about 8 years ago
I think the problem is in the destructor. If SciFiNoiseHits != NULL then at the end of the spill it will be set to NULL for the next spill, I think. Anway when the Spill object tries to delete SciFiNoiseHit the seg fault occurs. I don't know why, it seems like a pretty straight forward thing to do, but I'm going to keep on looking around.
Updated by Rogers, Chris about 8 years ago
For the record - the issue was that tracker initialised a single std::vector of noise hits and then allocated this using MCEvent::SetNoiseHits to several MCEvents. When the MCEvents were deleted, the std::vector was deleted several times - leading to double free and memory corruption, resulting in a segmentation fault.