I have a problem of memory with vector<> class and i hope you can help me.
I am using ROOT 5.26 and the problem is the following:
When i use the syntax
std::vector< std::vector< CLASS > > v;,
I have a memory map and backtrace error when my vectors have many elements.
I tried to do the same with some elements in my vector and it worked.
I did not use table because i do not know the size of my table: i read a XML file and that is why i choose vector class.
Is it possible to go throught this error ?
Do you have solutions ?
Assuming that ‘i’ is correctly tracked and the ‘Element’ constructor is correctly implemented, this long fine. What is the stack trace? Did you try running with valgrind? What was the valgrind report?
But i tried at home with the last version.
It is really different.
And many other text really hard to read.
Here is a little part ot the text:
First part with this kind of error
/home/froz/CoeurHomoPasdéplacement/AutoDict_vector_vector_TString_allocator_TString______cxx_ACLiC_dict.cxx:72:4: erreur: stray ‘\303’ in program
/home/froz/CoeurHomoPasdéplacement/AutoDict_vector_vector_TString_allocator_TString______cxx_ACLiC_dict.cxx:72:4: erreur: stray ‘\251’ in program
Second part with
/home/froz/CoeurHomoPasdéplacement/AutoDict_vector_vector_TString_allocator_TString______cxx_ACLiC_dict.cxx:48:16: attention : ‘void ROOT::destruct_vectorlEvectorlETStringcOallocatorlETStringgRsPgRcOallocatorlEvectorlETStringcOallocatorlETStringgRsPgRsPgRsPgRcLcLiterator(void*)’ declared ‘static’ but never defined [-Wunused-function]
g++: erreur: /home/froz/CoeurHomoPasdéplacement/AutoDict_vector_vector_TString_allocator_TString______cxx_ACLiC_dict.o: Aucun fichier ou dossier de ce type
Error in <ACLiC>: Compilation failed!
/home/froz/CoeurHomoPasdéplacement/AutoDict_random_access_iterator_vector_TString_allocator_TString____long__cxx_ACLiC_dict.cxx:82:4: erreur: stray ‘\303’ in program
This is just piece of error message. It is really long
After it builds the geometry, I have break segmentation violation and geometry is correctly printed…
[quote]So, on 5.26 version, i have this kind of error[/quote]The problem is due to a weakness in CINT template instantiation and is ‘fixed’ by generating the dictionary for the template instance.
This is what the latest version tries to do automatically.
/home/froz/CoeurHomoPasdéplacement/AutoDict_vector_vector_TString_allocator_TString______cxx_ACLiC_dict.cxx:72:4: erreur: stray ‘\303’ in programis … indeed fatal and is due to the é character in the directory name. Simply rename this directory with any accent and it will work nicely.
Seriously ???
I destroyed my brain all the day because of accent
Thank you very much.
Is it going to work on the 5.26 version ?
It fixed the problem, i can print geometry but unfortunately, i still have an error message which is
[code] *** Break *** segmentation violation
===========================================================
There was a crash (#7 0xb729e93b in SigHandler(ESignals) () from /home/froz/root/lib/libCore.so).
This is the entire stack trace of all threads:
#0 0xb781f424 in __kernel_vsyscall () #1 0xb6e6c043 in waitpid () from /lib/i386-linux-gnu/libc.so.6 #2 0xb6e0d6e3 in ?? () from /lib/i386-linux-gnu/libc.so.6 #3 0xb6f5bebb in system () from /lib/i386-linux-gnu/libpthread.so.0 #4 0xb729783b in TUnixSystem::Exec(char const*) () from /home/froz/root/lib/libCore.so #5 0xb729bd20 in TUnixSystem::StackTrace() () from /home/froz/root/lib/libCore.so #6 0xb729e827 in TUnixSystem::DispatchSignals(ESignals) () from /home/froz/root/lib/libCore.so #7 0xb729e93b in SigHandler(ESignals) () from /home/froz/root/lib/libCore.so #8 0xb7295a72 in sighandler(int) () from /home/froz/root/lib/libCore.so #9 0xb72c8d05 in textinput::TerminalConfigUnix::HandleSignal(int) () from /home/froz/root/lib/libCore.so #10 0xb72c8d44 in (anonymous namespace)::TerminalConfigUnix__handleSignal(int) () from /home/froz/root/lib/libCore.so #11 #12 0xb7401225 in G__G__Base2_15_0_178(G__value*, char const*, G__param*, int) () from /home/froz/root/lib/libCore.so #13 0xb681a46c in Cint::G__ExceptionWrapper(int ()(G__value, char const*, G__param*, int), G__value*, char*, G__param*, int) () from /home/froz/root/lib/libCint.so #14 0xb682e7c8 in G__exec_asm () from /home/froz/root/lib/libCint.so #15 0xb690898c in G__exec_loop () from /home/froz/root/lib/libCint.so #16 0xb6906bf6 in G__exec_statement () from /home/froz/root/lib/libCint.so #17 0xb690812a in G__exec_loop () from /home/froz/root/lib/libCint.so #18 0xb6906bf6 in G__exec_statement () from /home/froz/root/lib/libCint.so #19 0xb69031f6 in G__exec_statement () from /home/froz/root/lib/libCint.so #20 0xb68a8fd9 in G__interpret_func () from /home/froz/root/lib/libCint.so #21 0xb68959e8 in G__getfunction () from /home/froz/root/lib/libCint.so #22 0xb686c955 in G__getitem () from /home/froz/root/lib/libCint.so #23 0xb6873440 in G__getexpr () from /home/froz/root/lib/libCint.so #24 0xb687f3bb in G__calc_internal () from /home/froz/root/lib/libCint.so #25 0xb690f32e in G__process_cmd () from /home/froz/root/lib/libCint.so #26 0xb7262c9a in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /home/froz/root/lib/libCore.so #27 0xb72585af in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /home/froz/root/lib/libCore.so #28 0xb71b9907 in TApplication::ExecuteFile(char const*, int*, bool) () from /home/froz/root/lib/libCore.so #29 0xb71b9cec in TApplication::ProcessFile(char const*, int*, bool) () from /home/froz/root/lib/libCore.so #30 0xb71b846f in TApplication::ProcessLine(char const*, bool, int*) () from /home/froz/root/lib/libCore.so #31 0xb7091a7f in TRint::Run(bool) () from /home/froz/root/lib/libRint.so #32 0x08048c8f in main ()
Root > Function AssemblageThomas() busy flag cleared[/code]
[quote]Is it going to work on the 5.26 version ?[/quote]In 5.26, you need to semi-manually generate the dictionary by write a small script like:[code]#include #include “TString.h” #ifdefMAKECINT #pragma link C++ class vector<vector >+; #endif[code] and compile this script via ACLiC.
[quote]Is it a real probleme ?[/quote]Probably. The easiest way to see whether this problem is induce by a deficiency in CINT is to compile the script/command with ACLiC.
[quote]Can I write it on the top of my .C file ?[/quote]Yes.
[quote]And about the last error ? Do you know what it is ?[/quote]No, I do not have enough information (which version of ROOT, which code, does it work when compiled with ACLiC) to make a determination.
I am using last version of root (5.32).
That does not work with Aclic
The following message appears:
root [0]
Processing AssemblageThomas.C+...
Info in <TUnixSystem::ACLiC>: creating shared library /home/froz/CoeurHomoPasdeplacement/./AssemblageThomas_C.so
In file included from /home/froz/CoeurHomoPasdeplacement/AssemblageThomas_C_ACLiC_dict.h:34:0,
from /home/froz/CoeurHomoPasdeplacement/AssemblageThomas_C_ACLiC_dict.cxx:17:
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:40:15: attention : converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C: In function ‘void DOMRecursiveNode(const char*, const char*)’:
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:66:28: erreur: ‘ParseContext’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C: In function ‘char ParseContext(TXMLNode*, const char*)’:
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:79:8: erreur: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C: In function ‘void DOMRecursiveAttribute(const char*)’:
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:94:20: erreur: ‘ParseContext2’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C: In function ‘char ParseContext2(TXMLNode*)’:
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:113:9: erreur: cannot convert ‘std::vector<TString>’ to ‘char’ in return
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C: In function ‘void AssemblageThomas()’:
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:122:1: erreur: ‘gSystem’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:123:1: erreur: ‘TGeoManager’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:123:14: erreur: ‘geom’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:123:25: erreur: expected type-specifier before ‘TGeoManager’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:123:25: erreur: expected ‘;’ before ‘TGeoManager’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:134:8: erreur: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:135:27: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:168:41: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:223:17: attention : NULL utilisé en arithmétique [-Wpointer-arith]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:224:9: attention : unused variable ‘Temp’ [-Wunused-variable]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:241:1: erreur: ‘TGeoMaterial’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:241:15: erreur: ‘vacuum’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:241:28: erreur: expected type-specifier before ‘TGeoMaterial’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:241:28: erreur: expected ‘;’ before ‘TGeoMaterial’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:243:1: erreur: ‘TGeoMedium’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:243:13: erreur: ‘Sodium’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:243:26: erreur: expected type-specifier before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:243:26: erreur: expected ‘;’ before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:245:13: erreur: ‘ASA’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:245:23: erreur: expected type-specifier before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:245:23: erreur: expected ‘;’ before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:247:13: erreur: ‘ARA’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:247:23: erreur: expected type-specifier before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:247:23: erreur: expected ‘;’ before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:249:13: erreur: ‘BDC’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:249:23: erreur: expected type-specifier before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:249:23: erreur: expected ‘;’ before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:252:13: erreur: ‘Fuel’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:255:16: erreur: expected type-specifier before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:255:16: erreur: expected ‘;’ before ‘TGeoMedium’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:268:9: attention : unused variable ‘SolutionPositive’ [-Wunused-variable]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:272:17: erreur: ‘SolutionPositive’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:290:1: erreur: ‘TGeoPgon’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:290:11: erreur: ‘hexaW’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:290:23: erreur: expected type-specifier before ‘TGeoPgon’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:290:23: erreur: expected ‘;’ before ‘TGeoPgon’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:293:1: erreur: ‘TGeoVolume’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:293:13: erreur: ‘world’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:293:25: erreur: expected type-specifier before ‘TGeoVolume’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:293:25: erreur: expected ‘;’ before ‘TGeoVolume’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:328:13: erreur: ‘AssCoeur’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:333:13: erreur: ‘PgonShape’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:333:36: erreur: expected primary-expression before ‘)’ token
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:333:37: erreur: expected ‘;’ before ‘AssCoeur’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:337:41: erreur: expected type-specifier before ‘TGeoTranslation’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:337:41: erreur: expected ‘)’ before ‘TGeoTranslation’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:347:13: erreur: ‘hexaR’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:347:25: erreur: expected type-specifier before ‘TGeoPgon’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:347:25: erreur: expected ‘;’ before ‘TGeoPgon’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:350:15: erreur: ‘boitierR’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:350:30: erreur: expected type-specifier before ‘TGeoVolume’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:350:30: erreur: expected ‘;’ before ‘TGeoVolume’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:353:36: erreur: expected type-specifier before ‘TGeoTranslation’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:353:36: erreur: expected ‘)’ before ‘TGeoTranslation’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:397:56: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:399:43: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:409:113: attention : left operand of comma operator has no effect [-Wunused-value]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:419:43: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:431:10: erreur: ‘in’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:432:9: erreur: expected ‘;’ before ‘else’
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:143:5: attention : unused variable ‘NombreElementsAx’ [-Wunused-variable]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:264:8: attention : unused variable ‘RayonCercleCirconscrit’ [-Wunused-variable]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:282:11: attention : unused variable ‘NbReflecteurs’ [-Wunused-variable]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:377:5: attention : unused variable ‘compteur’ [-Wunused-variable]
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C: In function ‘char ParseContext2(TXMLNode*)’:
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:114:1: attention : contrôle a atteint la fin non void de la fonction [-Wreturn-type]
g++: erreur: /home/froz/CoeurHomoPasdeplacement/AssemblageThomas_C_ACLiC_dict.o: Aucun fichier ou dossier de ce type
Error in <ACLiC>: Compilation failed!
Error: Function AssemblageThomas() is not defined in current scope :0:
*** Interpreter error recovered ***
[quote]/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C:66:28: erreur: ‘ParseContext’ was not declared in this scope
/home/froz/CoeurHomoPasdeplacement/./AssemblageThomas.C: In function ‘char ParseContext(TXMLNode*, const char*)’:[/quote]You need to declare this function (and/or include the header file that does) before using it.