Project

General

Profile

Bug #1580

Writing scifi noise creates seg fault

Added by Heidt, Christopher almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Tracker
Target version:
-
Start date:
31 October 2014
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

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.


Files

MapCppTrackerMCDigitization.hh (3.67 KB) MapCppTrackerMCDigitization.hh Heidt, Christopher, 31 October 2014 16:18
MapCppTrackerMCDigitization.cc (11 KB) MapCppTrackerMCDigitization.cc Heidt, Christopher, 31 October 2014 16:18
simulate_scifi.py (1.61 KB) simulate_scifi.py Heidt, Christopher, 31 October 2014 16:18
#1

Updated by Heidt, Christopher almost 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.

#2

Updated by Heidt, Christopher almost 8 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
#3

Updated by Rogers, Chris almost 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.

Also available in: Atom PDF