# Segmentation violation when deleting object

**URL:** <https://root-forum.cern.ch/t/segmentation-violation-when-deleting-object/49935>\
**Category:** Newbie\
**Created:** [May 11, 2022, 7:40am UTC](https://root-forum.cern.ch/t/segmentation-violation-when-deleting-object/49935 "2022-05-11T07:40:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amelia](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@amelia](https://root-forum.cern.ch/u/amelia)\
**Post date:** [May 11, 2022, 7:40am UTC](https://root-forum.cern.ch/t/segmentation-violation-when-deleting-object/49935/1 "2022-05-11T07:40:31Z")

</div>

Dear experts,

I try to delete a TTreeSRedirector object in the destructor but it gives a segmentation violation:

#6 0x00007ffb8e9b809a in TTreeSRedirector::Close() () from ~/alice/sw/ubuntu2004\_x86-64/AliRoot/222b69b9f193abd33c5e7b71e91e21ae1816bcc5\_O2-local1/lib/libSTAT.so  
#7 0x00007ffb8e9b8197 in TTreeSRedirector::~TTreeSRedirector() () from ~/alice/sw/ubuntu2004\_x86-64/AliRoot/222b69b9f193abd33c5e7b71e91e21ae1816bcc5\_O2-local1/lib/libSTAT.so  
#8 0x00007ffb8e9b81d9 in TTreeSRedirector::~TTreeSRedirector() () from ~/alice/sw/ubuntu2004\_x86-64/AliRoot/222b69b9f193abd33c5e7b71e91e21ae1816bcc5\_O2-local1/lib/libSTAT.so

Can you please tell me some useful tips on how to proceed with the debugging?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 11, 2022, 7:57am UTC](https://root-forum.cern.ch/t/segmentation-violation-when-deleting-object/49935/2 "2022-05-11T07:57:13Z")

</div>

`TTreeSRedirector ` is not part of ROOT. I guess it is an Alice’s object ? you may ask the author in that case ?

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [May 11, 2022, 3:14pm UTC](https://root-forum.cern.ch/t/segmentation-violation-when-deleting-object/49935/3 "2022-05-11T15:14:13Z")

</div>

> [@amelia](#):
>
> Can you please tell me some useful tips on how to proceed with the debugging?

Maybe it is useful if you set up an IDE as debugger, see e.g. [Coding in ROOT with the horsepower of an F1 - ROOT](https://root.cern/blog/code-horsepower-f1/)
