【急】多线程运行错误
当只启动1个线程的时候,运行一天都不会报错,
当启动2个以上线程的时候,偶尔会报下面的错误,具体如下:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1502136640 (LWP 31183)]
0x00002b6f86bd5138 in sltstcu () from /opt/oracle/products/11.2.0-beta/db_1/lib/libclntsh.so.11.1
(gdb) where
#0 0x00002b6f86bd5138 in sltstcu () from /opt/oracle/products/11.2.0-beta/db_1/lib/libclntsh.so.11.1
#1 0x00002b6f8816b89e in kpuhhrsp () from /opt/oracle/products/11.2.0-beta/db_1/lib/libclntsh.so.11.1
#2 0x00002b6f8819ab50 in kpuexResPrefRows () from /opt/oracle/products/11.2.0-beta/db_1/lib/libclntsh.so.11.1
#3 0x00002b6f88199cc3 in kpuexec () from /opt/oracle/products/11.2.0-beta/db_1/lib/libclntsh.so.11.1
#4 0x00002b6f88194483 in OCIStmtExecute () from /opt/oracle/products/11.2.0-beta/db_1/lib/libclntsh.so.11.1
#5 0x000000000042237e in otl_cur::exec (this=0xeb94590, iters=0, rowoff=0) at otlv4.h:23546
#6 0x0000000000422c30 in otl_sel::first (this=0xeb94630, cur=@0xeb94590, cur_row=@0xeb9461c, cur_size=@0xeb94620,
row_count=@0xeb94624, eof_data=@0xeb94600, array_size=38) at otlv4.h:24292
#7 0x0000000000422d42 in otl_tmpl_select_cursor<otl_exc, otl_conn, otl_cur, otl_var, otl_sel>::first (this=0xeb94570)
at otlv4.h:6066
#8 0x000000000042951e in otl_tmpl_select_stream<otl_exc, otl_conn, otl_cur, otl_var, otl_sel, otl_datetime>::rewind (
this=0xeb94570) at otlv4.h:6376
#9 0x000000000042996a in otl_tmpl_select_stream (this=0xeb94570, aoverride=0xeac3080, arr_size=38,
sqlstm=0xebb4268 "SELECT COUNT(*) FROM erosa_merge_ctrol", pdb=@0xeac29e8, implicit_select=0, sqlstm_label=0x0) at otlv4.h:6346
#10 0x000000000042c931 in otl_stream::open (this=0xeac2a70, arr_size=38,
sqlstm=0xebb4268 "SELECT COUNT(*) FROM erosa_merge_ctrol", db=@0xeac29e8, ref_cur_placeholder=0x0, sqlstm_label=0x0)
at otlv4.h:29781
#11 0x0000000000415aef in COtlManager::OpenQuery (this=0xeac29e0, szSQL=
{static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x5988b7f0 "hB籠016"}}) at OtlManager.cpp:192
#12 0x0000000000407c28 in CMerge::TestConnected (this=0xeac2810) at merge.cpp:141
#13 0x0000000000408097 in CMerge::RefashOpTime (this=0xeac2810, S_TIME=
{static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x5988c010 "HE籠016"}}, E_TIME=
{static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x5988c000 "\210x篭016"}}) at merge.cpp:642
#14 0x000000000040a5ea in CMerge::OnPre (this=0xeac2810) at merge.cpp:608
#15 0x000000000040d0c5 in CMerge::run (this=0xeac2810, lparam=0x0) at merge.cpp:536
#16 0x0000000000434859 in CThread::thread_func (param=0xeac2828) at Thread.cpp:43
#17 0x00000035f82062f7 in start_thread () from /lib64/libpthread.so.0
#18 0x00000035f76d1b6d in clone () from /lib64/libc.so.6
(gdb) info threads
3 Thread 1921571136 (LWP 31186) otl_column_desc (this=0x2aaaac012550) at otlv4.h:1742
* 2 Thread 1502136640 (LWP 31183) 0x00002b6f86bd5138 in sltstcu ()
from /opt/oracle/products/11.2.0-beta/db_1/lib/libclntsh.so.11.1
1 Thread 47758043154736 (LWP 31174) 0x00000035f7698341 in nanosleep () from /lib64/libc.so.6