You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org> on 2005/06/28 04:56:58 UTC

[jira] Reopened: (AXISCPP-707) Incorrect use of delete in AxisEngineException::processException()

     [ http://issues.apache.org/jira/browse/AXISCPP-707?page=all ]
     
Samisa Abeysinghe reopened AXISCPP-707:
---------------------------------------


Henrik wrote:

There are a few things wrong here. First the two problems I am sure of:
 
A constant character array is passed to the ctor of AxisSoapException. This array is passed to the processException() method, which destroys it using operator delete. 
 
Dev team, please switch to using std::string instead of char*. You can still pass in constant char* if you have your arguments be const std::string&.
Currently there are many places in the code where "some constant" is passed to the ctors of various exceptions. Then those exceptions delete the strings and the server crashes (if we are lucky), as happened in this case.
 
I have reported this bug (which really is several bugs) to JIRA: http://issues.apache.org/jira/browse/AXISCPP-707
But only a very small part of the problem was addressed and then the bug was closed. This bug needs to be re-opened and fixed completely by removing the delete/delete[] in processException() and having the ctor take a const std::string& instead of char*. We also need to remove the places where new[] was used to create the argument to the ctor, but this is a small price to pay to avoid a crashing server.
 
The other aspect is the cause of your exception. I am not as sure about this one, but would guess that the client and server are using different SOAP encodings (Doc literal vs. RPC).
 
 - Henrik


> Incorrect use of delete in AxisEngineException::processException()
> ------------------------------------------------------------------
>
>          Key: AXISCPP-707
>          URL: http://issues.apache.org/jira/browse/AXISCPP-707
>      Project: Axis-C++
>         Type: Bug
>   Components: Server - Engine
>     Versions: current (nightly)
>  Environment: Windows XP Pro, VS2003
>     Reporter: Henrik Nordberg
>     Assignee: Dushshantha Chandradasa
>     Priority: Critical

>
> There is a delete statement in AxisEngineException::processException() which 
> has a couple of problems:
> First, if you were supposed to delete the pointer passed in, delete[] should 
> be used (in C++). But, at least in the case of the exception thrown when a 
> library fails to load, a constant character pointer is passed in (in this 
> case "") -- see this line in XMLParserFactory::loadLib():
> throw AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, 
> PLATFORM_LOADLIB_ERROR);
> Why not just use a const std::string& instead of char*?

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira