Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 68691 invoked from network); 9 Feb 2007 15:05:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2007 15:05:25 -0000 Received: (qmail 10893 invoked by uid 500); 9 Feb 2007 15:05:24 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 10842 invoked by uid 500); 9 Feb 2007 15:05:24 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 10766 invoked by uid 99); 9 Feb 2007 15:05:24 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2007 07:05:23 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of PRESTONF@uk.ibm.com designates 195.212.29.141 as permitted sender) Received: from [195.212.29.141] (HELO mtagate8.uk.ibm.com) (195.212.29.141) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2007 07:05:11 -0800 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate8.uk.ibm.com (8.13.8/8.13.8) with ESMTP id l19F4naH172566 for ; Fri, 9 Feb 2007 15:04:49 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v8.2) with ESMTP id l19F4o201814746 for ; Fri, 9 Feb 2007 15:04:50 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l19F4nL0016284 for ; Fri, 9 Feb 2007 15:04:49 GMT Received: from d06ml068.portsmouth.uk.ibm.com (d06ml068.portsmouth.uk.ibm.com [9.149.38.194]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l19F4nZK016277 for ; Fri, 9 Feb 2007 15:04:49 GMT In-Reply-To: <716CAD1CA091914D9F9489398A8AE8550659AC@mail01.pararede.int> X-Disclaimed: 33682 To: "Apache AXIS C User List" MIME-Version: 1.0 Subject: Re: Invalid access to memory location X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Fred Preston Date: Fri, 9 Feb 2007 15:04:48 +0000 X-MIMETrack: Serialize by Router on D06ML068/06/M/IBM(Release 7.0.2HF71 | November 3, 2006) at 09/02/2007 15:04:49, Serialize complete at 09/02/2007 15:04:49 Content-Type: multipart/alternative; boundary="=_alternative 0052D6478025727D_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 0052D6478025727D_= Content-Type: text/plain; charset="US-ASCII" Hi Tobias, You must use the /MD flag when building any application or DLL that will use the Axis code. Given that everything is built with the /MD flag, everything will work fine. If you get a DLOPEN FAILED error when loading the parser library this must be because you have either changed the PATH environment variable, moved a 'dependent' library or altered the contents of axiscpp.conf file. You may also need to check that the xerces and parser DLLs are both on the path. I'm not quite sure what you are referring to when you say in item 2 that "We built a dll version with __stdcall convention which causes problems.". Have you changed something inside the axis build? If you modify the calling convention for any method/function within axis, you are almost certain to run into problems. Have you tried turning on trace to see if that gives you any additional information? Regards, Fred Preston. "Tobias Schoofs" 09/02/2007 11:33 Please respond to "Apache AXIS C User List" To cc Subject Invalid access to memory location Hi, we're facing strange problems with a dll using axis-c (1.6b) on win32 machine. 1) We built a simple exe using the Calculator client class which works well. 2) We built a dll version with __stdcall convention which causes problems. - We first built the dll without the /MD compiler flag. It worked but with strange effects. (Memory was overwritten during the instantiation of the Calculator class.) - we than built the dll with /MD flag which resulted in the following error: exception in calclib: DLOPEN FAILED in loading parser library Failed to load parser within server engine: Error Message='Invalid access to memory location. ' Error Code='998' Load lib error='' The code of the dll is: int __stdcall add(int pOne, int pTwo) { char *tst = NULL; Calculator *calc = NULL; // static memory overwrites the stack!!! int rc = 0; try { calc = new Calculator(); rc = calc->add(pOne, pTtwo); delete calc; return rc; } catch (exception &e) { printf("exception in calclib: %s\n", e.what()); return -1; } } Caller: int main() { int rc = 0; int one = 10; int two = 35; try { rc = add(one, two); } catch (exception &e) { printf("Exception in calc: %s\n", e.what()); return -1; } if (rc > 0) { // it's just a simple test, so we're using values > 0 only printf("Result: %d\n", rc); return 0; } else { printf("Error: %d\n", rc); return -1; } } The header for both: extern "C" int __stdcall add(int, int); >From the makefile: calclib.obj: calclib.cpp Calculator.hpp cl -c /MD /DWIN32 -GX /Ic:\ts\axis\include calclib.cpp calc.obj: calc.cpp cl -c -GX /MD /DWIN32 \ calc.cpp Calculator.obj: Calculator.cpp Calculator.hpp cl -c -GX /MD /DWIN32 /Ic:\ts\axis\include Calculator.cpp calclib: calclib.obj Calculator.obj cl /LD /MD calclib.obj \ Calculator.obj \ c:\\ts\\axis\\lib\\axis\\axis_client.lib \ /link /EXPORT:add \ /NODEFAULTLIB:"libc.lib" calc: calc.obj cl /MD \ calclib.lib calc.obj \ /link /NODEFAULTLIB:"libc.lib" Any ideas? Tank you, Tobias --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-user-help@ws.apache.org Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU --=_alternative 0052D6478025727D_= Content-Type: text/html; charset="US-ASCII"
Hi Tobias,
        You must use the /MD flag when building any application or DLL that will use the Axis code.  Given that everything is built with the /MD flag, everything will work fine.  If you get a DLOPEN FAILED error when loading the parser library this must be because you have either changed the PATH environment variable, moved a 'dependent' library or altered the contents of axiscpp.conf file.  You may also need to check that the xerces and parser DLLs are both on the path.  I'm not quite sure what you are referring to when you say in item 2 that "We built a dll version with __stdcall convention which causes problems.".  Have you changed something inside the axis build?  If you modify the calling convention for any method/function within axis, you are almost certain to run into problems.  Have you tried turning on trace to see if that gives you any additional information?

Regards,

Fred Preston.



"Tobias Schoofs" <tobias.schoofs@pararede.com>

09/02/2007 11:33
Please respond to
"Apache AXIS C User List" <axis-c-user@ws.apache.org>

To
<axis-c-user@ws.apache.org>
cc
Subject
Invalid access to memory location





Hi,
 
we're facing strange problems with a dll using axis-c (1.6b) on win32 machine.
 
1) We built a simple exe using the Calculator client class which works well.
2) We built a dll version with __stdcall convention which causes problems.
- We first built the dll without the /MD compiler flag. It worked but with strange effects. (Memory was overwritten during the instantiation of the Calculator class.)
- we than built the dll with /MD flag which resulted in the following error:
exception in calclib: DLOPEN FAILED in loading parser library Failed to load parser within server engine:
                Error Message='Invalid access to memory location.
'                Error Code='998'
                Load lib error=''

 
The code of the dll is:
 
int __stdcall add(int pOne, int pTwo) {
 char *tst = NULL;
 Calculator *calc = NULL; // static memory overwrites the stack!!!
 int rc = 0;

 try {
   calc = new Calculator();

    rc = calc->add(pOne, pTtwo);
   delete calc;    
   return rc;
 } catch (exception &e) {
   printf("exception in calclib: %s\n", e.what());
   return -1;
 }

}
 
Caller:
 
int main() {
 int rc = 0;
 int one = 10;
 int two = 35;
 try {

    rc = add(one, two);
 } catch (exception &e) {
   printf("Exception in calc: %s\n", e.what());
   return -1;
 }  
 if (rc > 0) { // it's just a simple test, so we're using values > 0 only
   printf("Result: %d\n", rc);
   return 0;

  } else {
   printf("Error: %d\n", rc);
   return -1;
 }
}

 
The header for both:
extern "C" int __stdcall add(int, int);
 
From the makefile:
calclib.obj: calclib.cpp Calculator.hpp
cl -c /MD /DWIN32 -GX /Ic:\ts\axis\include calclib.cpp

 
calc.obj: calc.cpp
 cl -c -GX /MD /DWIN32 \
 calc.cpp

 
Calculator.obj: Calculator.cpp Calculator.hpp
 cl -c -GX /MD /DWIN32 /Ic:\ts\axis\include Calculator.cpp

 
calclib: calclib.obj Calculator.obj
cl /LD /MD calclib.obj \
 Calculator.obj \
 c:\\ts\\axis\\lib\\axis\\axis_client.lib \
 /link /EXPORT:add \
 /NODEFAULTLIB:"libc.lib"

calc: calc.obj
cl  /MD \
 calclib.lib calc.obj \
/link /NODEFAULTLIB:"libc.lib"

 
Any ideas?
 
Tank you,
 
Tobias
 ---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org







Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU






--=_alternative 0052D6478025727D_=--