hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "He Liangliang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-9893) Incorrect assert condition in OrderedBytes decoding
Date Tue, 12 Nov 2013 02:26:17 GMT

    [ https://issues.apache.org/jira/browse/HBASE-9893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13819744#comment-13819744
] 

He Liangliang commented on HBASE-9893:
--------------------------------------

When the length is 7 (or multiples of 7), and the 1st bit of the last byte is 1 the assertion
will fail, because t will be ended with 128 instead of 0.
For example:
{code}
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java
b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java
index 1050e88..b99f55b 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestOrderedBytes.java
@@ -872,7 +872,7 @@ public class TestOrderedBytes {
     byte[][] vals =
         { "".getBytes(), "foo".getBytes(), "foobarbazbub".getBytes(),
           { (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa,
-            (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa
},
+            (byte) 0xaa/*, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa, (byte) 0xaa*/
},
           { (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55,
             (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55, (byte) 0x55
},
           "1".getBytes(), "22".getBytes(), "333".getBytes(), "4444".getBytes(),
{code}

> Incorrect assert condition in OrderedBytes decoding
> ---------------------------------------------------
>
>                 Key: HBASE-9893
>                 URL: https://issues.apache.org/jira/browse/HBASE-9893
>             Project: HBase
>          Issue Type: Bug
>          Components: Client
>    Affects Versions: 0.96.0
>            Reporter: He Liangliang
>            Assignee: Nick Dimiduk
>            Priority: Minor
>         Attachments: HBASE-9893.patch
>
>
> The following assert condition is incorrect when decoding blob var byte array.
> {code}
>     assert t == 0 : "Unexpected bits remaining after decoding blob.";
> {code}
> When the number of bytes to decode is multiples of 8 (i.e the original number of bytes
is multiples of 7), this assert may fail.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message