Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#993 SockGetHostByAddr wont work

v4.1
closed
Mark Miesfeld
5
2012-08-14
2011-03-10
Henning G
No

Hi
I have a dns_responce time monitor (attached file).

This monitor have been working for years using rexx.320.
After upgrading to rexx-4.1-64 the function "SockGetHostByAddr" wont work.

I run on AIX 6.1 TL5SP1 POWER6 Hardware.

Hope ypu can help.

/Henning

Discussion

  • Henning G
    Henning G
    2011-05-05

    Hi

    Do you have any idea when someone can look into this provblem.

    /Henning

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-02-10

    Hi Henning,

    Seems to work fine for me on 64-bit Windows:

    / test.rex /

    ip.1 = 98.137.149.56
    ip.2 = 98.139.183.24
    ip.3 = 209.191.122.70
    ip.4 = 72.30.2.43

    do i = 1 to 4
    ret = SockGetHostByAddr(ip.i, 'st.')
    say 'ret:' ret 'name:' st.name
    end

    ::requires 'rxsock' library

    C:\work.ooRexx\bug.work\sockGetHostByAddr>test.rex
    ret: 1 name: ir1.fp.vip.sp2.yahoo.com
    ret: 1 name: ir2.fp.vip.bf1.yahoo.com
    ret: 1 name: ir1.fp.vip.mud.yahoo.com
    ret: 1 name: ir1.fp.vip.sk1.yahoo.com

    C:\work.ooRexx\bug.work\sockGetHostByAddr>

    Thanks for providing a program, but you really need to provide a simple example and explain what you mean by "the function SockGetHostByAddr won't work."

    Copy and paste the program I have above, run it on your system, and then attach the output here.

    If the above program works on you system, the write a very small program that demonstrates what you mean by won't work and attach it to this bug.

    I'm going to temporarily lower the priority on this until we hear back from you.

     
  • Henning G
    Henning G
    2012-02-14

    Hi

    Testrexx:

    ! /usr/bin/rexx

    / test.rex /

    /**********/
    /
    Initier socket og rexx
    /
    /
    ************/

    call RxFuncAdd "SockLoadFuncs", "rxsock", "SockLoadFuncs"
    say "rc1=" result
    call SockLoadFuncs "nocopyright"
    say "rc2=" result

    ip.1 = 10.4.16.2

    do i = 1 to 1
    ret = SockGetHostByAddr(ip.i, 'st.')
    say 'ret:' ret 'name:' st.name
    end

    REXX 4.1 64 Bit
    root@f11n04:/home/root-> r lslpp
    lslpp -l | grep -i rexx
    ooRexx.64.rte 4.1.0.0 COMMITTED 4.0.1 64 bit for AIX
    root@f11n04:/home/root-> ./hga1
    rc1= 0
    rc2=
    ret: 0 name: ST.NAME

    REXX 4.1 32 Bit
    root@bd100t16:/home/bduhga/rexx-> lslpp -l | grep -i rexx
    ooRexx.32.rte 4.1.0.0 COMMITTED ooRexx 4.1.0 32 bit for AIX
    root@bd100t16:/home/bduhga/rexx-> ./hga1
    rc1= 0
    rc2=
    ret: 1 name: bd000s01.bankdata.lan

    REXX 3.2 32bit
    root@aix003:/home/root-> lslpp -l | grep -i rexx
    ooRexx.rte 3.2.0.0 COMMITTED ooRexx 3.2.0.0 for AIX 5L 5.2
    root@aix003:/home/root-> ./hga1
    rc1= 0
    rc2=
    ret: 1 name: bd000s01.bankdata.lan
    root@aix003:/home/root->

    So rexx 4.1 32 bit works, but it looks like the problem only is seen is in the the 64 bit version.

    /Henning

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-02-14

    Hi Henning

    SockGetHostByAddr() works fine for me on 64-bit Windows, 64-bit Fedora, and 64-bit Ubuntu.

    Would you please execute the test program I provided and give us the output from that program. Thanks.

    I want to see what the output is from this program:

    / test.rex /

    ip.1 = 98.137.149.56
    ip.2 = 98.139.183.24
    ip.3 = 209.191.122.70
    ip.4 = 72.30.2.43

    do i = 1 to 4
    ret = SockGetHostByAddr(ip.i, 'st.')
    say 'ret:' ret 'name:' st.name
    end

    ::requires 'rxsock' library

     
  • Henning G
    Henning G
    2012-02-16

    Hi
    What you ask me to do is what I did yesterday....
    I am running IBM AIX (6.1 og 7.1) (NOT LINUX).

    IN AIX you have to "call RFuncAdd "SockLoadFuncs", "rxsock", "SockLoadFuncs"
    Then the socket lib are available.

    In the response from yesterday I have executed the test-rex 3 times.
    1. REXX 4.1 64 bit. ERROR Do not return the requestet name.
    2. REXX 4.1 32 bit. OK Working.
    3. REXX 3.2 32 bit - OK Working

    The 4.1 64 bit returns
    ret: 0 name: ST.NAME

    rexx 3.2 32 bit and rexx 4.1 32 bit returnes:
    ret: 1 name: bd000s01.bankdata.lan

    As you can see rexx variable ret contains 1 when it works, 0 when it do not work futher stem var "st.name" have no contens.

    /Henning

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-02-16

    Hi Henning,

    I know you are on AIX, not Linux.

    What I don't know is why you refuse to show us the results of using a public IP in a call to SockGetHostByAddr()

    This: bd000s01.bankdata.lan is not a public IP

    C:\work.ooRexx>nslookup
    Default Server: denlic03.xxxx.com
    Address: 10.88.180.24

    bd000s01.bankdata.lan
    Server: denlic03.xxxx.com
    Address: 10.88.180.24

    *** denlic03.xxxx.com can't find bd000s01.bankdata.lan: Non-existent domain

    You say:

    "IN AIX you have to "call RFuncAdd "SockLoadFuncs", "rxsock",
    "SockLoadFuncs"
    Then the socket lib are available."

    That is not true from ooRexx 4.0.0 and on. If you do, then there is something wrong on your system, something wrong in your ooRexx installation. If you do, then maybe you are picking up an old rxsock library.

    Please attach a working program using SockGetHostByAddr() that uses public IP addresses and demonstrates your problem. The program has to run unmodified for any one. It can not be dependent on your private network, or have any other dependencies on your system. If you do, I'll ask Rainer as a favor to try it on an AIX system.

    I think there could be an AIX only bug here. But, so far you haven't shown that. In fact your comment that you have to call RFuncAdd makes it seem more likely you have an installation problem.

     
  • Rick McGuire
    Rick McGuire
    2012-02-16

    Mark, the rxfuncadd approach still works with converted dlls. rxfuncadd recognizes this is a new-form library and loads it using the new mechanism. This was done so people would not need to modify existing programs when libraries got converted to the new APIs. I suspect this is an AIX problem caused by big endian/little endian differences. The Z/OS version might also have the same problem. This might already have been fixed to...I recall having this discussion some time ago.

     
  • Rick McGuire
    Rick McGuire
    2012-02-16

    I think this may have been fixed by commit 6851, We should make sure this is included in the bug fix release.

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-02-16

    Thanks Rick.

    I knew that rxfuncadd approach still works, but Henning shouldn't have to use that approach.

    I think this is probably an AIX only bug, I'd just like Henning to provide a program that will work for anyone, not one that is dependent on his internal network. ;-)

    Oh, I see that as I was typing you added a comment about commit 6851. I'll make sure that is in the bug fix release. Thanks.

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-02-16

    Committed revision 7538.

    r6851 looks like a fix for this. I back ported it to the 4.1 fixes branch and tested it on Linux (fedora.)

    Henning - we will be doing a bug fix release pretty soon. Be sure and test this when we have the beta for 4.1.1. I'm marking it as fixed for now. If it is not fixed in the beta, just put the status back to open.

     
  • Henning G
    Henning G
    2012-02-17

    Hi

    I've done the test with an internal IP address when our environment is a very closed environment without access to public addresses.

    I do not normally have access to external systems, but I have exceptionally been allowed to do a test with my test program (adjusted for public addresses)

    / * Rexx * /
    call RxFuncAdd "SockLoadFuncs" "rxsock" "SockLoadFuncs"
    say 'rc1 = "result
    call SockLoadFuncs "nocopyright"
    say "rc2 =" result

    ip.1 = 98,137,149.56
    ip.2 = 98,139,183.24
    ip.3 = 209,191,122.70
    ip.4 = 72.30.2.43

    do i = 1 to 4
    K = SockGetHostByAddr (ip.i, 'st.')
    say 'right,' right 'name:' st.name
    than

    Answer:

    32 bit rexx 4.1
    ./hga1
    rc1 = 0
    rc2 =
    rules: 1 name: ir1.fp.vip.sp2.yahoo.com
    rules: 1 name: ir2.fp.vip.bf1.yahoo.com
    rules: 1 name: ir1.fp.vip.mud.yahoo.com
    rules: 1 name: ir1.fp.vip.sk1.yahoo.com

    64 bit rexx 4.1
    ./hga1
    rc1 = 0
    rc2 =
    right: 0 name: ST.NAME
    right: 0 name: ST.NAME
    right: 0 name: ST.NAME
    right: 0 name: ST.NAME

    The second part, RexFuncAdd "problem".
    If I remove RexFuncAdd from the program, the program returns the following:
    19 * - * K = SockGetHostByAddr (ip.i, 'st.')
    REX0043E: Error 43 running / home/root/hga1 line 19: Routine not found
    REX0417E: Error 43.1: Could not find routine "SOCKGETHOSTBYADDR"

    Rexx is installed on an "empty" machine from the instructions in the PDF manual downloaded.
    What is missing to be performed (post-install)?
    Is there anything I missed?

    /Henning

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-02-17

    Henning,

    The fix that Rick pointed me to, look like it will fix your problem. In the next release this should be fixed.

    As far as using RxFuncAdd, you don't need to change your programs, as Rick pointed out, that still works.

    If you do take RxFucnAdd out, you need to add a requires directive. You would need to add something like this:

    ::requires 'rxsock' library

    If you did not add the requires directive, then:

    REX0043E: Error 43 running / home/root/hga1 line 19: Routine not found

    is to be expected.

    If you add the requries directive and you get that error, then something is wrong with your installation. I suspect you just forgot to add the directive.

     
  • Henning G
    Henning G
    2012-03-27

    Hi
    Can you say anything about when 4.1.1 will be available on AIX ?
    /HGA

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-03-27

    Rainer will have to do the build, none of the other developers have access to an AIX box. I can't say when he might do that.

    You couold try doing a build yourself from source, it should be relatively simple.

     


Anonymous


Cancel   Add attachments