[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference tuxedo::dce-products

Title:DCE Product Information
Notice:Kit Info - See 2.*-4.*
Moderator:TUXEDO::MAZZAFERRO
Created:Fri Jun 26 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2269
Total number of notes:10003

2262.0. "conformant array OpenVMS 7.1 Alpha" by HOUBA::MEHERS (Damian, http://bigbird.geo.dec.com/) Thu May 22 1997 11:58

    
    I have a customer running DCE V1.3B on OpenVMS Alpha 7.1
    
    He is getting strange behaviour when returning a structure containing a
    length field, and a conformant array.  It looks like the return values
    are getting corrupted.  I've tried the example on WNT
    and on OpenVMS 6.2 and have not been able to reproduce the problem.
    I suspect a bug in the martialling on OpenVMS Alpha 7.1
    
    In the first instance, if anyone has access to OpenVMS 7.1 Alpha with
    DCE installed, I'd be gratefull if you could try out the example, and
    see if you get the same results.
    
    In the second instance, has anyone seen anything like it?  My initial
    thoughts were alignment issues - but tests would have appeared to rule
    them out.
    
    Below please find the client and the server - it took me under five
    minutes to try it out.
    
    	Thanks,
    		Damian
    
    (testdef.acd should be testdef.acf)
    
    
    From:   Grips Software Info
    Sent:   Thursday, May 22, 1997 1:26:36 PM
    To:     Damian Mehers
    Subject:        GRIPS Software BmbH DCE Conforment Array Problem
    Auto forwarded by a Rule
    
    Hello Mr. Mehers,
    
    here is the letter containing the directory structure and all files to
    reproduce the problem.
    
    The directory tree is as follows:
    
    /Client/build.com
    /Client/client.c
    /Server/build.com
    /Server/server.c
    /Server/Testdef/build.com
    /Server/Testdef/testdef.acd
    /Server/Testdef/testdef.idl
    
    
    The contents of the files are as follows:
    
    *****************************************************************************
    
    1) /Client/build.com
    
    $ cc/nowarn client.c
    $ link client, [-.server.testdef]testdef_cstub,
    sys$library:dce_posix/opt
    
    *****************************************************************************
    
    2) /Client/client.c
    
    #include        <sys$common:[dce$library]rpc.h>
    
    #include        "../server/testdef/testdef.h"
    
    #define LogError(a) printf ("Error: %ld in %s, %ld", a, __FILE__,
    __LINE__);
    
    #include        <stdio.h>
    
    void main ()
    {
            unsigned long   ulStatus;
            int     i;
            char*   pszBinding;
            char*   pszNode = "";
            TST     *ptst;
    
            rpc_string_binding_compose(
                                    NULL,
                                    "ncacn_ip_tcp",
                                    pszNode,
                                    NULL,
                                    NULL,
                                    &pszBinding,
                                    &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            rpc_binding_from_string_binding (
                            pszBinding, 
                            &TEST_IfHandle,
                            &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
            
            rpc_string_free (&pszBinding,
                            &ulStatus);
    
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            rpc_ep_resolve_binding (TEST_IfHandle, 
                                    TEST_v1_0_c_ifspec,
                                    &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            } 
    
            rpc_mgmt_is_server_listening (TEST_IfHandle,
                                          &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            ptst = NULL;
    
            if ((ulStatus = TestReceive (
                                    &ptst)) != 0) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            for (i = 0; i < ptst->lLength; i++) {
                    printf ("%s\n", ptst->amsg [i].achMessage);
            }
    
            rpc_binding_free (
                              &TEST_IfHandle,
                              &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            exit (0);
    }
    
    *****************************************************************************
    
    3) /Server/build.com
    
    $ cc/nowarn server.c
    $ link server, [.testdef]testdef_sstub, sys$library:dce_posix/opt
    
    *****************************************************************************
    
    4) /Server/server.c
    
    #include        <sys$common:[dce$library]rpc.h>
    
    #include        "../server/testdef/testdef.h"
    
    #include        <stdio.h>
    
    #define LogError(a) printf ("Error: %ld in %s, %ld", a, __FILE__,
    __LINE__);
    #define COUNT   20
    
    void main ()
    {
            unsigned long   ulStatus;
            rpc_binding_vector_t *pBindingVector;                          
    // The server binding vector for an interface
    
            rpc_server_use_protseq (
                                    "ncacn_ip_tcp",
                                    rpc_c_protseq_max_reqs_default,
                                    &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);            
                    exit (ulStatus);
            }
    
            rpc_server_register_if (TEST_v1_0_s_ifspec,
                                                 NULL,
                                                 NULL,
                                                 &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            rpc_server_inq_bindings (
                                    &pBindingVector,
                                    &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            rpc_ep_register (
                                            TEST_v1_0_s_ifspec,
                                            pBindingVector,
                                            NULL,
                                            NULL,
                                            &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
            rpc_server_listen (
                                    rpc_c_listen_max_calls_default,
                                    &ulStatus);
            if (ulStatus != rpc_s_ok) {
                    LogError (ulStatus);
                    exit (ulStatus);
            }
    
    }
    
    error_status_t TestReceive (
                    TST **pptst)
    {
            unsigned long   ulStatus;
            int     i;
            
            *pptst = rpc_ss_allocate (COUNT * sizeof(MSG) + sizeof(long));
    
            memset (*pptst, 0, COUNT * sizeof(MSG) + sizeof(long));
    
            (*pptst)->lLength = COUNT;
    
            for (i = 0; i < COUNT; i++) {
                    sprintf ((*pptst)->amsg [i].achMessage, "%2.2d. time:
    Hello world !", i + 1);
            }
    
            return (0);
    }
    
    *****************************************************************************
    
    5) /Server/Testdef/build.com
    
    $ idl testdef -i[benxi.idl] -keepall
    
    *****************************************************************************
    
    6) /Server/Testdef/testdef.acd
    
    [ 
            implicit_handle(handle_t TEST_IfHandle)
    ]
    
    interface TEST
    {
            [comm_status, enable_allocate]  TestReceive (
              );
    }
    
    *****************************************************************************
    
    7) /Server/Testdef/testdef.idl
    
    [       uuid (f696d1f9-6741-11d0-b26c-000001098274),
            version(1.0),
            pointer_default(unique)
    ]
    
    interface TEST
    {
    
            typedef struct _MSG {
                    char    achMessage [32];
            } MSG;
    
            typedef struct _TST {
                    long    lLength;
                    [size_is (lLength)] MSG amsg [*];
            } TST;
    
            error_status_t  TestReceive (
              [out] TST **pptst);
    
    }
    
    *****************************************************************************
    
    The output of the client looks like this:
    
    $ run client
    01. time: Hello world !
    02. time: Hello world !
    03. time: Hello world !
    04. time: Hello world !
    05. time: Hello world !
    06. time: Hello world !
    07. time: Hello world !
    
    01. time: Hello world !
    02. time: Hello world !
    03. time: Hello world !
    04. time: Hello world !
    05. time: Hello world !
    06. time: Hello world !
    07. time: Hello world !
    16. time: Hello world !
    17. time: Hello world !
    18. time: Hello world !
    19. time: Hello world !
    20. time: Hello world !
    $ 
    
    *****************************************************************************
    
    Our system configurations consists of a DEC Aplpha Server running
    OpenVMS Version 7.1 using DCE for OpenVMS V1.3B.
    
    Please let us know as soon as possible what might be the problem.
    Our phone number is: Germany 0201-8127-176
    Fax number: Germany 0201-8127-282
    E-mail:     [email protected]
    
    Thank you for your help,
    
    Ttyl,
            Kalle Pause
T.RTitleUserPersonal
Name
DateLines
2262.1Logged as QAR 771HOUBA::MEHERSDamian, http://bigbird.geo.dec.com/Fri May 23 1997 08:511
    Logged as QAR 771
2262.2Problem remains with DCE 1.4HOUBA::MEHERSDamian, http://bigbird.geo.dec.com/Tue May 27 1997 05:4815
    
    Daan Jongh gave me a 'phone call last week to say that he had tried out
    the problem on an Alpha running OpenVMS 7.1 and DCE 1.4, and that he
    had not been able to repeat the problem, although he stressed that the
    machine had lots of other patches.
    
    Nevertheless I suggested to the customer that he try and upgrade to DCE
    1.4, which he did, but the problem did not go away :-(
    
    So, if anyone else has accesss to DCE 1.3 or 1.4 running on OpenVMS 7.1
    Alpha, then I'd be very greateful if you would give the example a go - 
    it really won't take more than 15 minutes of your time,
    
    	Cheers,
    		/Damian
2262.3Example worked on V7.1 Alpha and V6.2 Alpha with DCE 1.4STAR::SWEENEYTue May 27 1997 15:206
I ran the client and server code on Alpha V7.1 and DCE 1.4 and did not see the problem.  DCE 1.4 also worked fine
on Alpha V6.2.  DCE V1.3B is not supported on V7.1 VAX or Alpha OpenVMS.  Since no one seems to be able to 
reproduce this, a closer look at the customer configuration is in order.  

Dave
2262.4DEC C V5.6?HLFS00::JONGH_DDaan de JonghThu May 29 1997 09:175
    
    I'm using DEC C V5.6 maybe that's the difference.
    
    Daan