You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Dustin (JIRA)" <ji...@apache.org> on 2017/11/28 20:42:00 UTC

[jira] [Updated] (HIVE-18142) Data corruption can cause SerializationUtils.readRemainingLongs() function hang

     [ https://issues.apache.org/jira/browse/HIVE-18142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dustin updated HIVE-18142:
--------------------------
    Description: 
Similar to the SerializationUtils.readLongBE() function reported in [HIVE-13397|https://issues.apache.org/jira/browse/HIVE-13397], when Instream is corrupted, the following loop can become infinite, too.


{code:java}
  private void readRemainingLongs(long[] buffer, int offset, InStream input, int remainder,
      int numBytes) throws IOException {
    final int toRead = remainder * numBytes;
    // bulk read to buffer
    int bytesRead = input.read(readBuffer, 0, toRead);
    while (bytesRead != toRead) {
      bytesRead += input.read(readBuffer, bytesRead, toRead - bytesRead);
    }
    ...
}
{code}



  was:
Similar to the SerializationUtils.readLongBE() function reported in [HIVE-13255|https://issues.apache.org/jira/browse/HIVE-13255], when Instream is corrupted, the following loop can become infinite, too.


{code:java}
  private void readRemainingLongs(long[] buffer, int offset, InStream input, int remainder,
      int numBytes) throws IOException {
    final int toRead = remainder * numBytes;
    // bulk read to buffer
    int bytesRead = input.read(readBuffer, 0, toRead);
    while (bytesRead != toRead) {
      bytesRead += input.read(readBuffer, bytesRead, toRead - bytesRead);
    }
    ...
}
{code}




> Data corruption can cause SerializationUtils.readRemainingLongs() function hang
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-18142
>                 URL: https://issues.apache.org/jira/browse/HIVE-18142
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Dustin
>             Fix For: 2.0.1, 2.1.0
>
>
> Similar to the SerializationUtils.readLongBE() function reported in [HIVE-13397|https://issues.apache.org/jira/browse/HIVE-13397], when Instream is corrupted, the following loop can become infinite, too.
> {code:java}
>   private void readRemainingLongs(long[] buffer, int offset, InStream input, int remainder,
>       int numBytes) throws IOException {
>     final int toRead = remainder * numBytes;
>     // bulk read to buffer
>     int bytesRead = input.read(readBuffer, 0, toRead);
>     while (bytesRead != toRead) {
>       bytesRead += input.read(readBuffer, bytesRead, toRead - bytesRead);
>     }
>     ...
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)