Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 22880 invoked from network); 23 Sep 2005 20:45:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Sep 2005 20:45:45 -0000 Received: (qmail 2783 invoked by uid 500); 23 Sep 2005 20:45:44 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 2709 invoked by uid 500); 23 Sep 2005 20:45:43 -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 2683 invoked by uid 99); 23 Sep 2005 20:45:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2005 13:45:43 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_50_60,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.181.189.72] (HELO sdcedge02.siebel.com) (64.181.189.72) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2005 13:45:48 -0700 Received: from sdcemf02.siebel.com (unknown [64.181.189.70]) by sdcedge02.siebel.com (Tumbleweed MailGate Edge) with ESMTP id EE904F008A; Fri, 23 Sep 2005 14:44:24 -0600 (MDT) Received: from 172.20.161.77 by sdcemf02.siebel.com with ESMTP (Siebel SMTP Gateway); Fri, 23 Sep 2005 14:45:12 -0600 X-Server-Uuid: 1FB0656C-79C5-42BA-BF56-5D596D382C6F Received: from SDCEXMB01.corp.siebel.com ([172.20.161.13]) by sdcexbh01.corp.siebel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 23 Sep 2005 14:45:12 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: /MD and /MT compiler options on MSVC6 Date: Fri, 23 Sep 2005 14:45:11 -0600 Message-ID: <74944BBAF3F91D43A029BC42B11B800429F5FAFD@SDCEXMB01.corp.siebel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: /MD and /MT compiler options on MSVC6 thread-index: AcXAMGmZY0NZOkWZQv6REGiCDccR6QAN5dyQ From: "Lilantha Darshana" To: "Apache AXIS C User List" , axis-c-dev@ws.apache.org X-OriginalArrivalTime: 23 Sep 2005 20:45:12.0153 (UTC) FILETIME=[B1841490:01C5C07F] X-WSS-ID: 6F2AB6D22B8141741-01-01 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C5C07F.B12FF3CF" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C5C07F.B12FF3CF Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable =46irst question is why are you trying to link with both msvcrt and msvcr71 CRT libs at the same time=3F=20 =20 If we use /MT option that mean we link statically to multi-threaded library so the generated object file size=20 is large. But if we use /MD we link to a static lib - having LoadLibrary() method and respective code to get the ProcAddress() of called functions - that is having only the tiny code =66or loading functions from a=20 shared lib at runtime. So the final object code is small. =20 Check your lib path and linker path to see whether you are using anything from .NET instead of all libs from MDVC6. =20 Thanks -Lilantha =20 =20 =20 _____ =20 =46rom: Fred Preston [mailto:PRESTONF@uk.ibm.com]=20 Sent: Friday, September 23, 2005 7:16 AM To: axis-c-dev@ws.apache.org; axis-c-user@ws.apache.org Subject: /MD and /MT compiler options on MSVC6 =20 Hi All,=20 I'd like to discuss the /MD and /MT compiler options available on MSVC6.=20 The AxisClient DLLs are built with the /MD option that instructs the DLLs to use both multi-threaded and DLL specific options within the standard header files. It also tells the compiler to put the MSVCRT.lib into the object file and applications are statically linked to it. The DLLs are dynamically linked to msvcprt.lib while still dynamically linked to the main C runtime via msvcrt.lib.=20 Now, If I use the ant scripts to build one of the tests (such as AxisBench) it will build and run successfully. What I hadn't realised up to now is that when I use the ant scripts, it uses the same compiler options to build the tests as it does to build the Axis DLLs and so the tests are being built with the /MD compiler option. I am looking at AXISCPP-149, trying to work out the best way to clean up the 'delete ' problems with complex objects and needed to debug a couple of tests to see what is missing in the delete (this is a bit of an aside, but helps set the context). So I created a new MSVC project using the test generated framework for AxisBench and compiled the project using the 'normal' application build options (i.e. /MT for multi-threaded application). Now, using the /MT option causes the compiler to place the LIBCMT.lib into the object file. When the 'release' version of the application was built, it was immediately obvious that I had two different exe's because the ant built one was 56K whilst the MSVC built one was 208K. So what does this mean=3F Well, I've already said that the ant built exe runs, but the MSVC built one with the /MT option failed with the following messages:-=20 Unknown Exception occurred.=20 Unknown Exception occurred.=20 Unknown Exception on clean up:=20 Unknown Exception occurred.=20 Unknown Exception on clean up:=20 It is failing inside BenchDataType::Axis_Deserialize_BenchDataType( BenchDataType * param, IWrapperSoapDeSerializer * pIWSDZ) at the beginning of the method when it tries to delete 'count' which is an object that is passed back after being created within the deserialiser (across the DLL boundary=3F - more on this later...). This is because 'count' is not known to the heap and it reports the following error:-=20 HEAP[AxisBench.exe]: Invalid Address specified to RtlFreeHeap( 00340000, 0057B2D8) <-- obviously the numbers will change!=20 So, I looked at the compiler options and discovered that ant was building the applications with the /MD option. When I tried this option, the exe size was the same and the application ran without a problem.=20 So, what does this mean=3F I started with the libraries... Looking at http://msdn.microsoft.com/library/default.asp=3Furl=3D/library/en-us/vccore/ html/_core_.2f.MD.2c_2f.ML.2c_2f.MT.2c_2f.LD.asp and http://msdn.microsoft.com/library/default.asp=3Furl=3D/library/en-us/vclib/h tml/_crt_c_run.2d.time_libraries.asp, the LIBCMT.lib is a multi-threaded, static link library and MSVCRT.lib is a multi-threaded dynamic link library... "Humm, so what=3F", I thought, but I kept reading... The very last sentence of the "What problems exist if an application uses both msvcrt and msvcr71=3F" is very revealing, "...If your DLLs pass CRT resources across the library boundary, you will encounter issues with mismatched CRTs...". I would take this to be memory issues, such as heap, etc. And it finishes with "...recompile your project with Visual C++ .NET.".=20 So, we have potential problems with different libraries using MSVC6 and Microsoft is suggesting that if we are finding problems, then we need to move to '.NET' which I think implies that we should move to MSVC7 (which can be found on MSVC 2003 .NET). Interesting...=20 RECOMMENDATIONS:=20 1. If you are having similar problems as I did running AxisClient, try using the /MD rather than /MT compiler flag.=20 2. AxisClient should be built using MSVC7 to avoid future library inconsistencies.=20 Regards, =46red Preston. _______________ Siebel IT'S ALL ABOUT THE CUSTOMER Visit www.siebel.com This e-mail message is for the sole use of the intended recipient(s) and = contains confidential and/or privileged information belonging to Siebel = Systems, Inc. or its customers or partners. Any unauthorized review, use, = copying, disclosure or distribution of this message is strictly prohibited.= = If you are not an intended recipient of this message, please contact the = sender by reply e-mail and destroy all soft and hard copies of the message = and any attachments. Thank you for your cooperation. ------_=_NextPart_001_01C5C07F.B12FF3CF Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable

First question is why are you trying= = to link with both msvcrt and msvcr71 CRT libs at the same time=3F =

 

If we use /MT option that mean we link statically to multi-threaded library so the generated object file size

is large. But if we use /MD we link to a static lib – = having LoadLibrary() method and respective code to get the

ProcAddress() of called functions = – that is having only the tiny code for loading functions from a =

shared lib at runtime. So the final object code is small.

 

Check your lib path and linker path = to see whether you are using anything from .NET instead of all libs from = MDVC6.

 

Thanks

-Lilantha

 

 

 


From: Fred = Preston [mailto:PRESTONF@uk.ibm.com]
Sent: Friday, September 23, = 2005 7:16 AM
To: axis-c-dev@ws.apache.org; axis-c-user@ws.apache.org
Subject: /MD and /MT compiler options on MSVC6

 


Hi All,
        I'd like to discuss the /MD and /MT = compiler options available on MSVC6.

        The AxisClient DLLs are built with the = /MD option that instructs the DLLs to use both multi-threaded and DLL specific options within the standard header files.  It also tells the compiler = to put the MSVCRT.lib into the object file and applications are statically = linked to it.  The DLLs are dynamically linked to msvcprt.lib while still dynamically linked to the main C runtime via msvcrt.lib.

        Now, If I use the ant scripts to build = one of the tests (such as AxisBench) it will build and run successfully. =  What I hadn't realised up to now is that when I use the ant scripts, it uses the same compiler options to build the tests as it does to build the Axis DLLs = and so the tests are being built with the /MD compiler option.  I am = looking at AXISCPP-149, trying to work out the best way to clean up the 'delete <stub_generatred_object>' problems with complex objects and needed to debug a couple of tests to see what is missing in the delete (this is a bit= = of an aside, but helps set the context).  So I created a new MSVC project using the test generated framework for AxisBench and compiled the project = using the 'normal' application build options (i.e. /MT for multi-threaded application).  Now, using the /MT option causes the compiler to place = the LIBCMT.lib into the object file.  When the 'release' version of the application was built, it was immediately obvious that I had two different exe's because the ant built one was 56K whilst the MSVC built one was 208K.  So what does this mean=3F  Well, I've already said that the ant = built exe runs, but the MSVC built one with the /MT option failed with the = =66ollowing messages:-
Unknown Exception occurred.
Unknown Exception occurred.
Unknown Exception on clean up:
Unknown Exception occurred.
Unknown Exception on clean up:

        It is failing inside BenchDataType::Axis_Deserialize_BenchDataType( BenchDataType * param, IWrapperSoapDeSerializer * pIWSDZ) at the beginning of the method when it = tries to delete 'count' which is an object that is passed back after being created within the deserialiser (across the DLL boundary=3F - more on this = later...).  This is because 'count' is not known to the heap and it reports the =66ollowing error:-
HEAP[AxisBench.exe]: Invalid Address specified to RtlFreeHeap( = 00340000, 0057B2D8)  <-- obviously the numbers will change!

        So, I looked at the compiler options and discovered that ant was building the applications with the /MD option.  When I tried this option, the exe size was the same and the = application ran without a problem.

        So, what does this mean=3F  I = started with the libraries... Looking at = http://msdn.microsoft.com/library/default.asp=3Furl=3D/library/en-us/vccore= /html/_core_.2f.MD.2c_2f.ML.2c_2f.MT.2c_2f.LD.asp and http://msdn.microsoft.com/library/default.asp=3Furl=3D/library/en-us/vclib/= html/_crt_c_run.2d.time_libraries.asp, the LIBCMT.lib is a multi-threaded, static link library and MSVCRT.lib is a multi-threaded dynamic link library...  "Humm, so what=3F", I thought, but I kept reading...  The very last sentence of the = "What problems exist if an application uses both msvcrt and msvcr71=3F" is = very revealing, "...If your DLLs pass CRT resources across the library boundary, you will encounter issues with mismatched CRTs...".  I would take this to be memory issues, such as heap, etc.  And it = =66inishes with "...recompile your project with Visual C++ = .NET.".

        So, we have potential problems with different libraries using MSVC6 and Microsoft is suggesting that if we are =66inding problems, then we need to move to '.NET' which I think implies = that we should move to MSVC7 (which can be found on MSVC 2003 .NET).  Interesting...

RECOMMENDATIONS:
1.        If you are having similar problems as I did running AxisClient, try using the /MD rather than /MT compiler = =66lag.
2.        AxisClient should be built using MSVC7= = to avoid future library inconsistencies.

Regards,

=46red Preston.

_______________
Siebel
IT'S ALL ABOUT THE CUSTOMER
Visit www.siebel.com

This e-mail message is for the sole use of the intended recipient(s) and = contains confidential and/or privileged information belonging to Siebel = Systems, Inc. or its customers or partners. Any unauthorized review, use, = copying, disclosure or distribution of this message is strictly prohibited.= = If you are not an intended recipient of this message, please contact the = sender by reply e-mail and destroy all soft and hard copies of the message = and any attachments. Thank you for your cooperation.

------_=_NextPart_001_01C5C07F.B12FF3CF--