1
我沒有出車禍,從我的日誌:奇怪段違規
15:21:12 1645 Wrk-0.14 | *** Break ***: segmentation violation
堆棧跟蹤是:
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
...
#4 <signal handler called>
#5 0x00002b5eeef98865 in HiggsSelector::RejectBadJet (this=0x1de241a0,
index_jet=0, index_leading=0, index_subleading=1) at HiggsSelector.C:2375
的功能是:
bool HiggsSelector::RejectBadJet(int index_jet, int index_leading, int index_subleading) const
{
assert(index_jet >= 0);
assert(index_leading >= 0);
assert(index_subleading >= 0);
assert(PV_z);
int index_PV_ID_chosen=0; //<-----in your header
double DiPhoton_zcommon=z_common_corrected(index_leading,index_subleading,false);
float minimal_distance=9999;
for (unsigned int index_PV=0;index_PV<PV_z->size()-1;index_PV++) {
if (fabs((*PV_z)[index_PV]-DiPhoton_zcommon)<minimal_distance) {
的最後一行是號碼2375.我真的不知道這次撞車是如何發生的,我想我已經用assert
來檢查一切。 PV_z
是*std::vector<float>
只是好奇,如果你通過(PV_z->(index_PV)''來訪問該數組會發生什麼? – chrisaycock
指針可以是'> = 0',但可以同時被刪除 - 如果它在刪除後沒有被設置爲NULL。那麼你會犯一個訪問衝突。 –
檢查指針是否有效,而不僅僅是指針是否爲空,如果你刪除了PV_z並忘記取消它,它將指向垃圾。 – SingerOfTheFall