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