You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by sharon liang <sh...@sbcglobal.net> on 2005/03/15 09:04:00 UTC

Bug in AxisEngineException with fix

Hi,

I am testing clients on Windows platform. The test1 crahed when it was 
not able to load a DLL. Here is the call stack:

_free_dbg_lk(void * 0x1006a36c `string', int 1) line 1044 + 48 bytes
_free_dbg(void * 0x1006a36c `string', int 1) line 1001 + 13 bytes
free(void * 0x1006a36c `string') line 956 + 11 bytes
operator delete(void * 0x1006a36c `string') line 7 + 9 bytes
axiscpp::AxisEngineException::processException(const int 27, char * 
0x1006a36c `string') line 89 + 15 bytes
axiscpp::AxisEngineException::AxisEngineException(const int 27, char * 
0x1006a36c `string') line 46
axiscpp::XMLParserFactory::loadLib() line 106 + 15 bytes
axiscpp::XMLParserFactory::initialize() line 56 + 5 bytes
initialize_module(int 0) line 306
axiscpp::Call::Call() line 58 + 7 bytes
axiscpp::Stub::Stub(const char * 0x0012fe08, AXIS_PROTOCOL_TYPE 
APTHTTP1_1) line 31 + 31 bytes
InteropTestPortType::InteropTestPortType(const char * 0x0012fe08, 
AXIS_PROTOCOL_TYPE APTHTTP1_1) line 23 + 45 bytes
main(int 1, char * * 0x00311280) line 56 + 20 bytes
mainCRTStartup() line 206 + 25 bytes
KERNEL32! 7c59893d()


In int XMLParserFactory::loadLib(), when PLATFORM_LOADLIB() fails, it 
tries to do "throw 
AxisEngineException(SERVER_ENGINE_LOADING_PARSER_FAILED, PLATFORM_LOADLIB_ERROR);" 

The second parameter PLATFORM_LOADLIB_ERROR will be deleted in 
void AxisEngineException::processException(const int iExceptionCode, 
char* pcMessage)

However PLATFORM_LOADLIB_ERROR  was defined as empty string "" in   
src\platforms\windows\PlatformSpecificWindows.hpp. 

#define PLATFORM_LOADLIB_ERROR     ""

Therefore it crashed.

The fix will be define it as NULL:
#define PLATFORM_LOADLIB_ERROR     NULL

And change function void AxisEngineException::processException(const 
int iExceptionCode, char* pcMessage)

To
void AxisEngineException::processException(const int iExceptionCode, 
char* pcMessage)
{
AxisString sMessage ="";
if (pcMessage)
  AxisString sMessage = pcMessage;
    m_sMessage = getMessage(iExceptionCode) + " " + sMessage;
    if(pcMessage)
        delete pcMessage;
}

Let me if it make sense.

Thanks

David