string signal segmentation fault

Karl-Heinz Mali karl.heinz.mali@maliair.com
Sat Dec 27 10:12:00 GMT 2003


Hi

How can I solve the following problem with the signal segmentation fault 
runtime error under SuSE Linux 8.2 with g++ (gcc) 3.3-23. What is wrong with 
the constructor string operation _sMergeMin = _sMergeMax = ""; after the 2nd 
instantiation of the template Record<T> db; in a loop? The code is not 
multithreaded.

Tanks
Karl-Heinz

(gdb) bt
#0  0x4013fc27 in std::string::_Rep::_S_create(unsigned, std::allocator<char> 
const&) () from /usr/lib/libstdc++.so.5
#1  0x4013c051 in std::string::_M_mutate(unsigned, unsigned, unsigned) () from 
/usr/lib/libstdc++.so.5
#2  0x401408c4 in std::string& std::string::_M_replace_safe<char 
const*>(__gnu_cxx::__normal_iterator<char*, std::string>, 
__gnu_cxx::__normal_iterator<char*, std::string>, char const*, char const*) 
() from /usr/lib/libstdc++.so.5
#3  0x4013cd51 in std::string::operator=(char const*) () from 
/usr/lib/libstdc++.so.5
#4  0x0808809c in Record (this=0xbfffdc00) at mbcore.h:455
#5  0x0808968b in Record<ODBCRecord>::AddUnique(char const*, std::deque<Field, 
std::allocator<Field> >*, std::deque<Field, std::allocator<Field> >*, bool) 
(this=0xbffff020, cUniqueField=0x80b1b76 "NR", qUniqueReturnValue=0xbfffdd70, 
qCommonField=0x0, bAddPrimaryTable=true) at mbcore.h:603
#6  0x0805f19b in main (argc=1, argv=0xbffffac4, envp=0xbffffacc) at 
travel.cpp:1524
#7  0x401b78ae in __libc_start_main () from /lib/libc.so.6

mbcore.h:455
	Record() { _pv = 0; _iIndex = 0; _sMergeMin = _sMergeMax = ""; }
mbcore.h:603
	Record<T> db;
travel.cpp:1524
	rAutoListe.AddUnique("NR");



More information about the Gcc-help mailing list