Harmony
  1. Harmony
  2. HARMONY-6327

[classlib][nio]FileChannelTest failed on z/OS

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M11
    • Fix Version/s: 5.0M12
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      z/OS platform
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Moderate

      Description

      Failed on FileChannelTest.test_transferToJJLWritableByteChannel_SocketChannel
      Both line 3062 & 3063 failed
      Line 3062: 36 is expected but it gets 0
      Line 3063: 10 is expected but it gets 38

      Bug in modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
      send_file() function returns 0 if success
      However it should return the count of trasfered bytes
      And transefer should not change the position value

      1. 6327_v2.diff
        1 kB
        Ray Chen
      2. 6327.diff
        2 kB
        Ray Chen

        Activity

        Hide
        Oliver Deakin added a comment -

        Hi Ray,

        Does AIX also need the same changes? I have had a look for the technical documentation on this function and the only resources I can find seem to indication that send_file always returns 0 on success and -1 on failure:
        http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/commtrf2/send_file.htm

        Do you think we should change the AIX block also?

        Also, since positionBack is only used in the zOS block, it should probably only be defined and set there, rather than for all platforms. Do you agree?

        Show
        Oliver Deakin added a comment - Hi Ray, Does AIX also need the same changes? I have had a look for the technical documentation on this function and the only resources I can find seem to indication that send_file always returns 0 on success and -1 on failure: http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/commtrf2/send_file.htm Do you think we should change the AIX block also? Also, since positionBack is only used in the zOS block, it should probably only be defined and set there, rather than for all platforms. Do you agree?
        Hide
        Ray Chen added a comment -

        Hi Oliver,
        I found some links of AIX, it says the send_file function is not implemented
        on AIX. So I separate the code into two blocks for AIX and z/OS.
        I don't have AIX machine right now, may be we can test it later.
        Here is the link I refer to
        http://www1.hrz.tu-darmstadt.de/hhlr/doku/sw/apidiffs.html#sendfile


        Ray Chen
        MSN:clraychen@hotmail.com <MSN%3Aclraychen@hotmail.com>
        Email:clarychen@gmail.com <Email%3Aclarychen@gmail.com>

        Show
        Ray Chen added a comment - Hi Oliver, I found some links of AIX, it says the send_file function is not implemented on AIX. So I separate the code into two blocks for AIX and z/OS. I don't have AIX machine right now, may be we can test it later. Here is the link I refer to http://www1.hrz.tu-darmstadt.de/hhlr/doku/sw/apidiffs.html#sendfile – Ray Chen MSN:clraychen@hotmail.com <MSN%3Aclraychen@hotmail.com> Email:clarychen@gmail.com <Email%3Aclarychen@gmail.com>
        Hide
        Oliver Deakin added a comment -

        Hi Ray,
        I think the sendfile function you have found there is a different system call to the send_file we are using in the AIX block - it takes 4 parameters and returns a size value, where as send_file takes 3 parameters and returns 0 or -1.

        I found this thread on an AIX user group:
        http://unix.derkeiler.com/Newsgroups/comp.unix.aix/2003-07/0645.html

        Which has the same link I gave above for the AIX reference, so I think the zOS and AIX send_file functions behave in the same way and should have the same code.

        Show
        Oliver Deakin added a comment - Hi Ray, I think the sendfile function you have found there is a different system call to the send_file we are using in the AIX block - it takes 4 parameters and returns a size value, where as send_file takes 3 parameters and returns 0 or -1. I found this thread on an AIX user group: http://unix.derkeiler.com/Newsgroups/comp.unix.aix/2003-07/0645.html Which has the same link I gave above for the AIX reference, so I think the zOS and AIX send_file functions behave in the same way and should have the same code.
        Hide
        Ray Chen added a comment -

        Hi Oliver,
        I think you are right. I am trying to find some manual of AIX to make sure
        the send_file return value.
        I will update the patch when I am sure.
        If you got some, let me know.
        Thank you.


        Ray Chen
        MSN:clraychen@hotmail.com <MSN%3Aclraychen@hotmail.com>
        Email:clarychen@gmail.com <Email%3Aclarychen@gmail.com>

        Show
        Ray Chen added a comment - Hi Oliver, I think you are right. I am trying to find some manual of AIX to make sure the send_file return value. I will update the patch when I am sure. If you got some, let me know. Thank you. – Ray Chen MSN:clraychen@hotmail.com <MSN%3Aclraychen@hotmail.com> Email:clarychen@gmail.com <Email%3Aclarychen@gmail.com>
        Hide
        Ray Chen added a comment -

        Move z/OS and AIX to the same block because send_file() acts same on both platform

        Show
        Ray Chen added a comment - Move z/OS and AIX to the same block because send_file() acts same on both platform
        Hide
        Oliver Deakin added a comment -

        Thanks Ray - patch applied at repo revision r810468. I made a slight modification - I moved the declaration and initialisation of positionBack inside the AIX/ZOS block as it is not used outside, and I also added the declaration of the result variable as it was missing. Please check that changes applied are as expected.

        Show
        Oliver Deakin added a comment - Thanks Ray - patch applied at repo revision r810468. I made a slight modification - I moved the declaration and initialisation of positionBack inside the AIX/ZOS block as it is not used outside, and I also added the declaration of the result variable as it was missing. Please check that changes applied are as expected.
        Hide
        Ray Chen added a comment -

        Patch verified, Thank you,Oliver

        Show
        Ray Chen added a comment - Patch verified, Thank you,Oliver

          People

          • Assignee:
            Oliver Deakin
            Reporter:
            Ray Chen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 48h
              48h
              Remaining:
              Remaining Estimate - 48h
              48h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development