Root Crashes when trying to run CORSIKA compiled file

Hello everyone!
I want to use REAS so I need CORSIKA output file that is created with ROOT and COAST option enabled.
I’ve installed ROOT and it runs without problem. COAST also installed perfectly.
corsika is working fine and I’m able to compile corsika file under COAST option.
now when I want to run CORSIKA output file the problem appears.
I don’t know exactly what is the problem and have no idea what should I do!
may you please help me?
Thanks!

OS: Ubuntu 12.10
COAST : v5r2
ROOT: v5.34.05
REAS: 3.1

here is the terminal output of the problem when I run CORSIKA compiled file:

*** Break *** segmentation violation

===========================================================
There was a crash (#7 0xb6cdc7eb in SigHandler(ESignals) () from /root/root/lib/libCore.so).
This is the entire stack trace of all threads:

#0 0xb774a424 in __kernel_vsyscall ()
#1 0xb73fc943 in waitpid () from /lib/i386-linux-gnu/libc.so.6
#2 0xb7383ff3 in ?? () from /lib/i386-linux-gnu/libc.so.6
#3 0xb74fde2b in system () from /lib/i386-linux-gnu/libpthread.so.0
#4 0xb6cd4b5b in TUnixSystem::Exec(char const*) () from /root/root/lib/libCore.so
#5 0xb6cd9b34 in TUnixSystem::StackTrace() () from /root/root/lib/libCore.so
#6 0xb6cdc6d7 in TUnixSystem::DispatchSignals(ESignals) () from /root/root/lib/libCore.so
#7 0xb6cdc7eb in SigHandler(ESignals) () from /root/root/lib/libCore.so
#8 0xb6cd34b2 in sighandler(int) () from /root/root/lib/libCore.so
#9
#10 0xb730e254 in std::string::assign(std::string const&) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#11 0xb76e5528 in operator= (__str=…, this=) at /usr/include/c++/4.7/bits/basic_string.h:544
#12 TPlotter::TPlotter (this=0xb76f92e0 ) at TPlotter.cc:159
#13 0xb76de929 in __static_initialization_and_destruction_0 (__initialize_p=, __priority=) at THRadioInterface.cc:36
#14 _GLOBAL__sub_I_THRadioInterface.cc(void) () at THRadioInterface.cc:136
#15 0xb7759e9b in ?? () from /lib/ld-linux.so.2
#16 0xb7759f84 in ?? () from /lib/ld-linux.so.2
#17 0xb774c20f in ?? () from /lib/ld-linux.so.2

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#10 0xb730e254 in std::string::assign(std::string const&) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#11 0xb76e5528 in operator= (__str=…, this=) at /usr/include/c++/4.7/bits/basic_string.h:544
#12 TPlotter::TPlotter (this=0xb76f92e0 ) at TPlotter.cc:159
#13 0xb76de929 in __static_initialization_and_destruction_0 (__initialize_p=, __priority=) at THRadioInterface.cc:36
#14 _GLOBAL__sub_I_THRadioInterface.cc(void) () at THRadioInterface.cc:136
#15 0xb7759e9b in ?? () from /lib/ld-linux.so.2
#16 0xb7759f84 in ?? () from /lib/ld-linux.so.2
#17 0xb774c20f in ?? () from /lib/ld-linux.so.2

Try to use “valgrind”:

[url]Free(): invalid next size(fast)//malloc(): memory corruption
[url]Upper limit of entries in one bin and in whole histogram
[url]fTotBytes error
[url]Segmentation Fault in Recursive Removement
[url]Memory leak

[quote=“Wile E. Coyote”]Try to use “valgrind”:
[/quote]

Thanks for your quick reply.
OK…now what does it say?
(i used valgrind without [–show-reachable=yes] [–num-callers=50] because it becomes way too long that the page crashes if I try to post it here!)

[code]root@ubuntu:~/corsika-73500/run# valgrind --tool=memcheck --leak-check=full --suppressions=root-config --etcdir/valgrind-root.supp ./corsika73500Linux_QGSII_gheisha < RUNxxxx1.inp > out.txt
==10054== Memcheck, a memory error detector
==10054== Copyright © 2002-2011, and GNU GPL’d, by Julian Seward et al.
==10054== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==10054== Command: ./corsika73500Linux_QGSII_gheisha
==10054==
==10054== Warning: set address range perms: large range [0x8214000, 0x1cbcc000) (defined)
==10054== Invalid read of size 4
==10054== at 0x44E9254: std::string::assign(std::string const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17)
==10054== by 0x408E527: TPlotter::TPlotter() (basic_string.h:544)
==10054== by 0x4087928: _GLOBAL__sub_I_THRadioInterface.cc (THRadioInterface.cc:36)
==10054== by 0x400EEAA: call_init (dl-init.c:85)
==10054== by 0x400EF93: _dl_init (dl-init.c:134)
==10054== by 0x400120E: ??? (in /lib/i386-linux-gnu/ld-2.15.so)
==10054== Address 0xfffffffc is not stack’d, malloc’d or (recently) free’d
==10054==

*** Break *** segmentation violation
#0 0x380d8a74 in ?? ()
==10054== Conditional jump or move depends on uninitialised value(s)
==10054== at 0x4DFD267: G__destroy_upto (in /root/root/lib/libCint.so)
==10054== by 0x4DFDE8B: G__scratch_globals_upto (in /root/root/lib/libCint.so)
==10054== by 0x46D1CD1: TCint::ResetGlobals() (in /root/root/lib/libCore.so)
==10054== by 0x470CB1A: TUnixSystem::Exit(int, bool) (in /root/root/lib/libCore.so)
==10054== by 0x47147AE: TUnixSystem::DispatchSignals(ESignals) (in /root/root/lib/libCore.so)
==10054== by 0x47147EA: SigHandler(ESignals) (in /root/root/lib/libCore.so)
==10054== by 0x470B4B1: sighandler(int) (in /root/root/lib/libCore.so)
==10054== by 0x4280F37: ??? (in /lib/i386-linux-gnu/libpthread-2.15.so)
==10054==
==10054==
==10054== HEAP SUMMARY:
==10054== in use at exit: 1,249,537 bytes in 24,743 blocks
==10054== total heap usage: 52,018 allocs, 27,275 frees, 2,559,851 bytes allocated
==10054==
==10054== 25 bytes in 1 blocks are possibly lost in loss record 12,747 of 18,829
==10054== at 0x402C733: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==10054== by 0x44E7603: std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17)
==10054== by 0x44E9879: char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator const&, std::forward_iterator_tag) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17)
==10054== by 0x44EA035: std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&) (in /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17)
==10054== by 0x6EA692F: ???
==10054==
==10054== LEAK SUMMARY:
==10054== definitely lost: 0 bytes in 0 blocks
==10054== indirectly lost: 120 bytes in 10 blocks
==10054== possibly lost: 25 bytes in 1 blocks
==10054== still reachable: 952,522 bytes in 20,398 blocks
==10054== suppressed: 296,870 bytes in 4,334 blocks
==10054== Reachable blocks (those to which a pointer was found) are not shown.
==10054== To see them, rerun with: --leak-check=full --show-reachable=yes
==10054==
==10054== For counts of detected and suppressed errors, rerun with: -v
==10054== Use --track-origins=yes to see where uninitialised values come from
==10054== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 2 from 2)[/code]

I think your source code needs to be compiled with the debug option (e.g. “-g”) in order to get it really usable with the debugger / valgrind.

Well, judging from your output, I would check:

TPlotter.cc: around line 159 (in the TPlotter constructor)
THRadioInterface.cc: around line 36
THRadioInterface.cc: around line 136

It seems to me that it has something to do with a a null (or an uninitialized / invalid) reference being used while doing a copy of a “std::string” (in the TPlotter constructor).