You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Stadelmann Josef <jo...@axa-winterthur.ch> on 2007/11/22 18:02:59 UTC

Long names and sharable images ... dll's

Hi all,

I run into the following problem and would like to know your good approch.

I have managed and built the apache axis2/c webservice engine and all arround it on OpenVMS

However I run into the following problem when the server populates its conf_ctx .

File-name-length and lengt of function names and procedure names are the cause.
Together the two should never be more then what OpenVMS old DECC compiler allowes without the /name=shorten switch (31 chars)

why.

as all works nice for static linking, the trouble starts when one has a sharable images with a symbol vector based on a analysis of object files.

names are in this case cryptic I give you the example here


AXP1>pipe ana/image [-.deploy.lib]axis2_http_sender.exe | search sys$input "symbol:"
                symbol: ".$$ABS$$."
                symbol: "AXIS2_HTTP_TRANSPORT_SE300LI1H$"
                symbol: "AXIS2_HTTP_TRANSPORT_SE185ELDT$"
                symbol: "AXIS2_HTTP_TRANSPORT_SE1MJIDMO$"
                symbol: "AXIS2_HTTP_TRANSPORT_SE319PT59$"
                symbol: "AXIS2_HTTP_TRANSPORT_SE3J664R4$"
                symbol: "AXIS2_HTTP_TRANSPORT_SE328OQAQ$"
                symbol: "AXIS2_HTTP_TRANSPORT_SE241Q8CN$"
                symbol: "AXIS2_HTTP_TRANSPORT_SE04VT8SN$"
                symbol: "AXIS2_HTTP_SENDER_CREATE"
                symbol: "AXIS2_HTTP_SENDER_GET_P12FME5A$"
                symbol: "AXIS2_HTTP_SENDER_GET_T04IVVRJ$"
                symbol: "AXIS2_HTTP_SENDER_PROCE15NNCDV$"
                symbol: "AXIS2_HTTP_SENDER_GET_H0P3EPDO$"
                symbol: "AXIS2_HTTP_SENDER_FREE"
                symbol: "AXIS2_HTTP_SENDER_SET_H0U4U5JE$"
                symbol: "AXIS2_HTTP_SENDER_SET_OM_OUTPUT"
                symbol: "AXIS2_HTTP_SENDER_SET_CHUNKED"
                symbol: "AXIS2_HTTP_SENDER_UTIL_2HCJ96K$"
                symbol: "AXIS2_HTTP_SENDER_SEND"
                symbol: "AXIS2_HTTP_CLIENT_FREE_VOID_ARG"
                symbol: "AXIS2_HTTP_CLIENT_CREATE"
                symbol: "AXIS2_HTTP_CLIENT_FREE"
                symbol: "AXIS2_HTTP_CLIENT_GET_KEY_FILE"
                symbol: "AXIS2_HTTP_CLIENT_SET_KEY_FILE"
                symbol: "AXIS2_HTTP_CLIENT_GET_S2M8KNFD$"
                symbol: "AXIS2_HTTP_CLIENT_SET_S1H999U1$"
                symbol: "AXIS2_HTTP_CLIENT_SET_D02SRHTO$"
                symbol: "AXIS2_HTTP_CLIENT_CONNE3HJ4AKO$"
                symbol: "AXIS2_HTTP_CLIENT_GET_PROXY"
                symbol: "AXIS2_HTTP_CLIENT_SET_PROXY"
                symbol: "AXIS2_HTTP_CLIENT_GET_TIMEOUT"
                symbol: "AXIS2_HTTP_CLIENT_SET_TIMEOUT"
                symbol: "AXIS2_HTTP_CLIENT_GET_URL"
                symbol: "AXIS2_HTTP_CLIENT_SET_URL"
                symbol: "AXIS2_HTTP_CLIENT_GET_RESPONSE"
                symbol: "AXIS2_HTTP_CLIENT_RECIE1MRKQ8Q$"
                symbol: "AXIS2_HTTP_CLIENT_SEND"
AXP1>

What you see are all the symbolic names mangeled by compiler when the /NAME switch is in use. 

They are a construct of the object file name such as http_client.obj, http_sender.obj and http_transport_sender.obj 
used as prefix for the symbolic name to avoid name clashes among files, wel done, and then followed by the often very 
long function name i.e. "axis2_remove_instance()" as used with our axis2_http_sender.exe 
which is a DLL in OpenVMS called a shareable image.

And we are going to write web services which will all become sharable images !!!!

To load a DLL in OpenVMS I use dlopen() and to get the procedure address I use dlsym(). 
as dlopen() works and returns a handel to the DLL's name, keept for use by dlsym(), 
dlsym() falls flat as the axis2.log for the axis2_http_server NOW shows. 

[Thu Nov 22 16:06:50 2007] [debug] DSA5:[webservices.axis2.trunk.c.src.core.deployment]conf_builder.c;4(220) no custom dispa?
[Thu Nov 22 16:07:54 2007] [debug] DSA5:[webservices.axis2.trunk.c.src.core.deployment]conf_builder.c;4(672) dam_transport_n?
[Thu Nov 22 16:09:46 2007] [debug] DSA5:[webservices.axis2.trunk.c.util.src]class_loader.c;10(101) IB-E-KEYNOTFOU, key not found

The error gets NOT reported in ordinary axis2/C implementations, because there is a bug. 
But after I've found it, I have enhanced the code of the class_loader.c as follow using dlerro() to return the status of dlsym().


#if !defined ( VMS )
        create_funct = (CREATE_FUNCT) AXIS2_PLATFORM_GETPROCADDR(dl_handler,
                AXIS2_CREATE_FUNCTION);
        if (!create_funct)
        {
            return NULL;	// +++> returning here without a debug log entry is an error! 
					// +++> given the case that dlsym() can not locate the function for what ever reason i.e. my case
        }
#else
        create_funct = (CREATE_FUNCT) dlsym(dl_handler,"axis2_get_instance");
        if (!create_funct)
        {
            // lets at least log the bug and then return -
            // how gets the bug one of the true causes logged below in code
            // if we return here with 0 to our caller
            // this bug was costly
            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, dlerror());		// +++> now the error gets logged at least
            return NULL;
        }
#endif


Any hint very wellcome! 

object file name of any loadable component including function/procedure names should never be more then 31 characters.

How is that with axis2/C

On Open VMS 

AXP> HELP / NAME  shows us

CC

  /NAMES

        /NAMES=(option1,option2)
        /NAMES=(UPPERCASE,TRUNCATED) (D)

     Option1 converts all definitions and references of external symbols
     and psects to the specified case:

      o  /NAMES=UPPERCASE (default) converts to uppercase.

      o  /NAMES=AS_IS leaves the case unchanged.

     Option2 controls whether or not long external names greater than 31
     characters get truncated or shortened:

      o  /NAMES=TRUNCATED (default) truncates long external names

      o  /NAMES=SHORTENED shortens long external names.

         A shortened name consists of the first 23 characters of the
         name followed by a 7-character Cyclic Redundancy Check (CRC)
         computed by looking at the full name, and then a "$".

         The CRC is generated by calling lib$crc as follows:

         long       initial_crc = -1;
         crc_result = lib$crc(good_crc_table,
                              &initial_crc,
                              <descriptor of string to CRC>);

         where good_crc_table is:

         /*
         ** Default CRC table:
         **
         **  This table was taken from Ada's generalized name generation
         **  algorithm.  It represents a commonly used CRC polynomial
         **  known as AUTODIN-II.  For more information see the VAX
         **  Macro OpenVMS documentation under the CRC VAX instruction.
         */

             static const unsigned int good_crc_table[16] =
                      {0x00000000, 0x1DB71064, 0x3B6E20C8, 0x26D930AC,
                       0x76DC4190, 0x6B6B51F4, 0x4DB26158, 0x5005713C,
                       0xEDB88320, 0xF00F9344, 0xD6D6A3E8, 0xCB61B38C,
                       0x9B64C2B0, 0x86D3D2D4, 0xA00AE278, 0xBDBDF21C};

     By default, the compiler issues a warning and truncates the name to
     31 characters.

     The /NAMES qualifier does not affect the names of the $ABS$, $BSS$,
     $CODE$, $DATA$, $LINK$, $LITERAL$, and $READONLY$ psects.


Topic?


Any hint wellcome. Is this my show-stopper for OpenVMS?
Regards
Josef.Stadelmann
@axa-winterthur.ch



Re: Long names and sharable images ... dll's

Posted by Senaka Fernando <se...@wso2.com>.
Hi Dinesh/Josef,

> Hi Josef,
>
>    Were you able to get through this problem. I see that you have a
>    problem with name length.
>
> SJ>"object file name of any loadable component including
> function/procedure names
> SJ> should never be more then 31 characters."
>
>    I think this is a OpenVMS problem, AFAIK, in standard C
>    implementation there is no such a restriction regarding function
>    names. Did I miss something here?

There is something like that in the C Standard I guess, if I'm not mistaken.

Refer, http://c0x.coding-guidelines.com/5.2.4.1.html

Regards,

Senaka


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


AW: AW: Long names and sharable images ... dll's

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Hi Dinesh

	I have no time yet to have a closer look why my simple http axis2 C
	server runs with all the clients on OpenVMS but crashes as sson as
	
	some ...DUAL... client comes into the game at client sides.

	I think you can not help me on that unless you have access
	to an OpenVMS system, get my ported code/dev-environment
	and start debugging.

	My architecture for the near future is now 


	user PC -> VB 6.0 -> Client -> PocketSOAP -> Soap-XML-HTTP -> Wire

					tcp/ip network

	Wire -> Axis2/Java -> JavaBean -> HP/WSIT TK -> JVM -> 
	WSIT generated Server Wrapper -> C Legacy Code -> Wrapper ->
	OpenVMS Pascal Code Base (Business Logic, not thread safe) 
	-> MQ to IBM and /or -> Oracle DB all on OpenVMS 7.3
	
	In case Axis2/C will handle scope=soapsession the way Axis2/Java
	supports it or what ever Axis2/C comes up with to have a 1 session 
	to 1 process relation, we migth change away from Java stuff and use 
	Axis2/C instead for several reasons.

Josef.Stadelmann@
axa-winterthur.ch



-----Ursprüngliche Nachricht-----
Von: Dinesh Premalal [mailto:premalal@gmail.com]Im Auftrag von Dinesh
Premalal
Gesendet: Mittwoch, 5. Dezember 2007 07:04
An: axis-c-user@ws.apache.org
Betreff: Re: AW: Long names and sharable images ... dll's


Hi Stadelmann,

"Stadelmann Josef" <jo...@axa-winterthur.ch> writes:
> 	For my axis2/c port to OpenVMS, axis2_get_instance() and axis2_remove_instance() 
> 	both names are less then 31 characters. Hence are available in non-cryptic normal form 
> 	within the object and can therefor be used by dlsym().
>
> 	So my axis2/c server works now with all the services and teste. This beeing true except 
> 	for the xyz_DUAL_xyz clients. Those make the server crash.

Do you see any point that we could help you to fix this problem?

thanks,
Dinesh


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: AW: Long names and sharable images ... dll's

Posted by Dinesh Premalal <xy...@gmail.com>.
Hi Stadelmann,

"Stadelmann Josef" <jo...@axa-winterthur.ch> writes:
> 	For my axis2/c port to OpenVMS, axis2_get_instance() and axis2_remove_instance() 
> 	both names are less then 31 characters. Hence are available in non-cryptic normal form 
> 	within the object and can therefor be used by dlsym().
>
> 	So my axis2/c server works now with all the services and teste. This beeing true except 
> 	for the xyz_DUAL_xyz clients. Those make the server crash.

Do you see any point that we could help you to fix this problem?

thanks,
Dinesh


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


AW: Long names and sharable images ... dll's

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Hi Dinesh

	The name lengt problem is with HP/DEC-C Compiler for OpenVMS only.

	However, when I use /name=(short,as_is) then ...

	names longer then 31 character will be cut after 23 characters and the 
	rest will be replaced by a unique CRC something entity. normal full lenght
	name and cryptic name are then kept in a demangler database und by the linker
	to get to the correct symbols.

	So compiling / linking is not a problem in this case.

	The problem starts if I use sharable images which are in OpenVMS the equivalent 
	for DLL's or sharable libraries under Unix. 

	In this case I can not use names by dlsym() which are longer then 31 characters.
	Just because they do not exist in this form in the object files.

	Such names must be shortened manually to be meaningfull to 31 or less characters, 
	prior to be used by dlsym();

	For my axis2/c port to OpenVMS, axis2_get_instance() and axis2_remove_instance() 
	both names are less then 31 characters. Hence are available in non-cryptic normal form 
	within the object and can therefor be used by dlsym().

	So my axis2/c server works now with all the services and teste. This beeing true except 
	for the xyz_DUAL_xyz clients. Those make the server crash.

Josef.Stadelmann@
axa-winterthur.ch
	
 

-----Ursprüngliche Nachricht-----
Von: Dinesh Premalal [mailto:premalal@gmail.com]Im Auftrag von Dinesh
Premalal
Gesendet: Samstag, 1. Dezember 2007 06:30
An: axis-c-user@ws.apache.org
Cc: Meg Watson (E-Mail); Powell Hazzard (E-Mail); Phil Hunt (E-Mail)
Betreff: Re: Long names and sharable images ... dll's


Hi Josef,

   Were you able to get through this problem. I see that you have a
   problem with name length.

SJ>"object file name of any loadable component including function/procedure names
SJ> should never be more then 31 characters."

   I think this is a OpenVMS problem, AFAIK, in standard C
   implementation there is no such a restriction regarding function
   names. Did I miss something here?

thanks,
Dinesh

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: Long names and sharable images ... dll's

Posted by Dinesh Premalal <xy...@gmail.com>.
Hi Josef,

   Were you able to get through this problem. I see that you have a
   problem with name length.

SJ>"object file name of any loadable component including function/procedure names
SJ> should never be more then 31 characters."

   I think this is a OpenVMS problem, AFAIK, in standard C
   implementation there is no such a restriction regarding function
   names. Did I miss something here?

thanks,
Dinesh

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org