Operating System - Linux
1752808 Members
5942 Online
108789 Solutions
New Discussion

Program terminated with signal 10, Bus error.

 
Rena_1
New Member

Program terminated with signal 10, Bus error.

Hello. I have some trouble. Soft work under HP-UX 11.11, compiled by aCC. Soft worked correctly. Now soft always create core file and it's state "killed by 10".

Data from core file:

nat@whrhouse $/home/nat/langtools/bin/gdb64 /home/nat/bin/reg-el-server /home/nat/var/reg-el-server/core HP gdb 2.1 Copyright 1986 - 1999 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 2.1 (based on GDB 5.0-hpwdb-20000630) Wildebeest is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for Wildebeest. Type "show warranty" for details.
Wildebeest was built for PA-RISC 2.0 (wide), HP-UX 11.00.
..
Core was generated by `binserver'.
Program terminated with signal 10, Bus error.

warning: The shared libraries were not privately mapped; setting a breakpoint in a shared library will not work until you rerun the program.


warning: section .data not found in /opt/ids940fc5/lib/esql/libifglx.sl
#0 0xc00000000029b0ec in .stub () from /lib/pa20_64/libc.2
(gdb) ba
#0 0xc00000000029b0ec in .stub () from /lib/pa20_64/libc.2
#1 0xc00000000029dec8 in free () from /lib/pa20_64/libc.2
#2 0xc0000000000b494c in operator delete () from /lib/pa20_64/libCsup.2
#3 0xc000000337137ddc in M_New_Doc_Ureg::sendAnswer (this=0x80000001000b67d0, doc=0x80000001006ac918, mi=@0x800003fff7ff17d0)
at m_new_doc_ureg.cpp:67109083
#4 0xc000000336bdf6f8 in DocumentProcessor::putInDB (this=0x80000001000b67d0, doc=0x80000001006ac918, mi=@0x800003fff7ff17d0)
at doc_processor.cpp:67109485
#5 0xc000000336bd8884 in DocumentProcessor::run (this=0x80000001000b67d0, doc=0x80000001006ac918, mi=@0x800003fff7ff17d0)
at doc_processor.cpp:67109164
#6 0xc000000336b87fc0 in SProcessor::run (this=0x80000001000b67d0, mes=@0x800003fff7ff16b0, mi=@0x800003fff7ff17d0)
at processor.cpp:67109043
#7 0xc000000336b8fe88 in Server::run (this=0x80000001000c3c48) at
server.cpp:67109146
#8 0xc000000336b8a270 in Server::setup (_info=@0x800003fff7ff11d0) at
server.cpp:67108929
#9 0xc000000336b6be50 in MessageDispetcher::setup_server (this=0x800000010009e788, num=22) at msg_dispetch.cpp:67109523 #10 0xc000000336b6d598 in MessageDispetcher::run (this=0x800000010009e788) at msg_dispetch.cpp:67109629
#11 0xc000000336b66e80 in MessageDispetcher::setup
(_info=@0x800003fff7ff0b88) at msg_dispetch.cpp:67109300
#12 0x400000000002ac94 in main (argc=2, argv=0x800003fff7ff07e0) at
binserver.cpp:67109002


M_New_Doc_Ureg::sendAnswer code:

unsigned char * send_buf = new unsigned char[sgds_name.size()];
send_buf = (unsigned char *)sgds_name.c_str();
AMessageInfo ami;
ami.SetFromClient(crypto_name);
ami.SetFromApplication(crypto_app);
ami.SetFromSession(crypto_inst);
ami.SetMsgCrypto("none");
ami.SetDocType("CRYPTO_REVOKECERT");
ami.SetDocVersion("1");
ami.SetDocId(currreferens);
ami.SetMsgSysSource("SGDS_3");
Log::message("Sending Message", DEBUG_LOG);
Log::message("DocType"+ami.GetDocType(), DEBUG_LOG);
CustomServer::instance()->send_message(send_buf, sgds_name.size(), ami);
if(send_buf != NULL) delete send_buf;
Log::message("Message Sent", DEBUG_LOG);

I need help.
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: Program terminated with signal 10, Bus error.

#0 0xc00000000029b0ec in .stub .../libc.2
#1 0xc00000000029dec8 in free .../libc.2

This indicates heap corruption. You need to download the latest gdb and enable heap checking:
(gdb) set heap-check on string on
http://www.hp.com/go/wdb

unsigned char *send_buf = new unsigned char[sgds_name.size()];

Do you need to use sgds_name.size() + 1?
It appears send_message doesn't range check properly?