0

I'm tryning to build a service con gsoap. The code is:

ArchivatorCoreService server;
ArchivatorCoreService *tserver;
int port = 8080;
SOAP_SOCKET m, s;
m = server.bind(NULL, port, 100);
if (!soap_valid_socket(m))
{
      exit(1);
}
else
{
  qDebug() << "Info: Bind: Succesfully socket connection: " << m << ". Port " << port 
}
for (;;)
{
  qDebug() << "waiting...";
  s = server.accept();

  if (!soap_valid_socket(s))
  {
    if (server.errnum)
    {
       qDebug() << "1"; << "Error: Failed accept: " << messagec;
       exit(1);
  }
  else
  {
    qDebug() << "Info: Thread " << i << " accepts socket " << s << " connection from   IP " << ((server.ip >> 24)&0xFF) << "." << ((server.ip >> 16)&0xFF) << "." << ((server.ip >> 8)&0xFF) << "." << ((server.ip)&0xFF);

}
qDebug() << "2";
tserver = server.copy(); // make a safe copy
qDebug() << "3";

In line tserver = server.copy(); error sigsegv.

ArchivatorCoreService heracly of soap;

Thanks you very much

Jjreina
  • 2,633
  • 6
  • 33
  • 54

1 Answers1

0

You don't say which version of gsoap you are using; however versions prior to 2.8.5 have an issue with memory leaks and SIGSEGVs with the C++ code that is generated. See my previous answer here for a few more details.

Community
  • 1
  • 1
Jackson
  • 5,627
  • 2
  • 29
  • 48