axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samisa Abeysinghe (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Commented: (AXISCPP-359) Param destructor cause apache2 segv when receiving message.
Date Mon, 31 Jan 2005 14:05:17 GMT
     [ http://issues.apache.org/jira/browse/AXISCPP-359?page=comments#action_58309 ]
     
Samisa Abeysinghe commented on AXISCPP-359:
-------------------------------------------

This seems to be a memory management problem.
I will look into it.

> Param destructor cause apache2 segv when receiving message.
> -----------------------------------------------------------
>
>          Key: AXISCPP-359
>          URL: http://issues.apache.org/jira/browse/AXISCPP-359
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: current (nightly)
>  Environment: Debian GNU/Linux unstable
> apache 2.0.52
> Axis CPP CVS HEAD of today.
> Xerces
>     Reporter: Johan Fischer
>     Assignee: Samisa Abeysinghe

>
> After a few messages (around 5) received and processed correctly, apache process crash
with a segfault. 
> a gdb backtrace indicate that during the SOAPSerializer::init (line 275) delete the SOAPEnveloppe
-> then SOAPBody -> SOAPMethod -> Param and then crash.
> There seems to be a problem in the Param destructor. The problem disappear if I comment
the following delete lines as shown in the diff below:
> Index: common/Param.cpp
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/c/src/common/Param.cpp,v
> retrieving revision 1.46
> diff -a -u -r1.46 Param.cpp
> --- common/Param.cpp    23 Nov 2004 17:21:02 -0000      1.46
> +++ common/Param.cpp    6 Jan 2005 08:11:10 -0000
> @@ -35,7 +35,7 @@
>  
>  Param::~Param ()
>  {
> -    int i;
> +    int i = 0;
>      XML_String pStr = 0;
>      AnyType* pAny = 0;
>      switch (m_Type)
> @@ -53,19 +53,22 @@
>          case XSD_NOTATION:
>              if (AxisEngine::m_bServer)
>              {
> -                delete [] const_cast<char*>(m_Value.pStrValue);
> +//             if (m_Value.pStrValue)
> +//                    delete [] const_cast<char*>(m_Value.pStrValue);
>              }
>              break;
>          case XSD_BASE64BINARY:
>              if (AxisEngine::m_bServer)
>              {
> -                delete [] m_Value.b64bValue.__ptr;
> +//             if (m_Value.b64bValue.__ptr)
> +//                    delete [] m_Value.b64bValue.__ptr;
>              }
>              break;
>          case XSD_HEXBINARY:
>              if (AxisEngine::m_bServer)
>              {
> -                delete [] m_Value.hbValue.__ptr;
> +               //if (m_Value.hbValue.__ptr)
> +                //    delete [] m_Value.hbValue.__ptr;
>              }
>              break;
>          case XSD_ANY:
> Since I'm not really good at that, could you have a look ?
> Also, during my backtrace, I noticed another small thing in the delete process that might
be wrong, but it doesn't hurt to look at it right :)
> another quick patch :
> Index: soap/SoapMethod.cpp
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/c/src/soap/SoapMethod.cpp,v
> retrieving revision 1.29
> diff -a -u -r1.29 SoapMethod.cpp
> --- soap/SoapMethod.cpp 23 Nov 2004 17:21:04 -0000      1.29
> +++ soap/SoapMethod.cpp 6 Jan 2005 08:11:11 -0000
> @@ -33,15 +33,20 @@
>  SoapMethod::~SoapMethod()
>  {
>      list<Param*>::iterator itParam;
> -    for (list<Attribute*>::iterator it = m_attributes.begin();
> +    list<Attribute*>::iterator it;
> +    for (it = m_attributes.begin();
>      it != m_attributes.end(); it++)
>      {
> -        delete (*it);
> +       if(*it)
> +           delete (*it);
>      }
> +    m_attributes.clear();
> +    
>      for (itParam = m_OutputParams.begin(); 
>      itParam != m_OutputParams.end(); itParam++)
>      {
> -        delete (*itParam);
> +       if(*itParam)
> +            delete (*itParam);
>      }
>      m_OutputParams.clear();
>  }
> Anyway, I also have tons of question not related to that, so I'll talk to you later guys
:)
> Cheers.
> PS: great project, I think I'll really use it :)
> If you need any other information about configuration, wsdl, message received, I'm ready
to send it to you, I just wanted to avoid sending a 3 page long bug report :)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message