Segmentation violation in libCore when filling TTree

I have a custom class, which does not derive from TObject but has a dictionary (ClassDef), so that I can fill it inside a tree through an appropriate branch.

My application runs smoothly in one of my computers, but causes a segmentation violation in other computer when calling tree->Fill(), using the same ROOT version. Here is the output of valgrind, any help understanding the reason would be greatly appreciated.

ROOT version: 5.34.20
Computer where it does work: g++ (Ubuntu/Linaro 12.04) 4.6.4
Computer where it does not work: g++ (Debian 4.7.2-5) 4.7.2

==30325== Process terminating with default action of signal 11 (SIGSEGV)
==30325== Access not within mapped region at address 0x7FE801410
==30325== at 0x4FFCF47: TObject::GetTitle() const (in /opt/root/lib/libCore.so)
==30325== If you believe this happened as a result of a stack
==30325== overflow in your program’s main thread (unlikely but
==30325== possible), you can try to increase the size of the
==30325== main thread stack using the --main-stacksize= flag.
==30325== The main thread stack size used in this run was 8388608.
==30325== Stack overflow in thread 1: can’t grow stack to 0x7fe801f71
==30325==
==30325== Process terminating with default action of signal 11 (SIGSEGV)
==30325== Access not within mapped region at address 0x7FE801F71
==30325== at 0x4A226E0: _vgnU_freeres (vg_preloaded.c:58)
==30325== If you believe this happened as a result of a stack
==30325== overflow in your program’s main thread (unlikely but
==30325== possible), you can try to increase the size of the
==30325== main thread stack using the --main-stacksize= flag.
==30325== The main thread stack size used in this run was 8388608.

See full output in attached file.
valgrind.txt (6.77 KB)

I just figured out by myself why was the reason of the crash:

I had two namespaces A and B, inside each of them a class named Event, both the same name but each of them with a different structure. Dictionaries are generated for each class.

In my rootlogon.C file I call using namespace A; using namespace B;

Then, when filling a tree of Events, I think ROOT gets confused, and uses the “incorrect class” and produces the crash, although with any hint why it has happened. It would be nice to add some automatic warning when the rootlogon is loaded…