{"action":"created","issue":{"url":"https://api.github.com/repos/CorfuDB/CorfuDB/issues/305","repository_url":"https://api.github.com/repos/CorfuDB/CorfuDB","labels_url":"https://api.github.com/repos/CorfuDB/CorfuDB/issues/305/labels{/name}","comments_url":"https://api.github.com/repos/CorfuDB/CorfuDB/issues/305/comments","events_url":"https://api.github.com/repos/CorfuDB/CorfuDB/issues/305/events","html_url":"https://github.com/CorfuDB/CorfuDB/issues/305","id":190263663,"number":305,"title":"Stream Read NullPointerException","user":{"login":"Maithem","id":7818642,"avatar_url":"https://avatars.githubusercontent.com/u/7818642?v=3","gravatar_id":"","url":"https://api.github.com/users/Maithem","html_url":"https://github.com/Maithem","followers_url":"https://api.github.com/users/Maithem/followers","following_url":"https://api.github.com/users/Maithem/following{/other_user}","gists_url":"https://api.github.com/users/Maithem/gists{/gist_id}","starred_url":"https://api.github.com/users/Maithem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maithem/subscriptions","organizations_url":"https://api.github.com/users/Maithem/orgs","repos_url":"https://api.github.com/users/Maithem/repos","events_url":"https://api.github.com/users/Maithem/events{/privacy}","received_events_url":"https://api.github.com/users/Maithem/received_events","type":"User","site_admin":false},"labels":[{"id":57187517,"url":"https://api.github.com/repos/CorfuDB/CorfuDB/labels/bug","name":"bug","color":"fc2929","default":true},{"id":214476411,"url":"https://api.github.com/repos/CorfuDB/CorfuDB/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"Maithem","id":7818642,"avatar_url":"https://avatars.githubusercontent.com/u/7818642?v=3","gravatar_id":"","url":"https://api.github.com/users/Maithem","html_url":"https://github.com/Maithem","followers_url":"https://api.github.com/users/Maithem/followers","following_url":"https://api.github.com/users/Maithem/following{/other_user}","gists_url":"https://api.github.com/users/Maithem/gists{/gist_id}","starred_url":"https://api.github.com/users/Maithem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maithem/subscriptions","organizations_url":"https://api.github.com/users/Maithem/orgs","repos_url":"https://api.github.com/users/Maithem/repos","events_url":"https://api.github.com/users/Maithem/events{/privacy}","received_events_url":"https://api.github.com/users/Maithem/received_events","type":"User","site_admin":false},"assignees":[{"login":"Maithem","id":7818642,"avatar_url":"https://avatars.githubusercontent.com/u/7818642?v=3","gravatar_id":"","url":"https://api.github.com/users/Maithem","html_url":"https://github.com/Maithem","followers_url":"https://api.github.com/users/Maithem/followers","following_url":"https://api.github.com/users/Maithem/following{/other_user}","gists_url":"https://api.github.com/users/Maithem/gists{/gist_id}","starred_url":"https://api.github.com/users/Maithem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maithem/subscriptions","organizations_url":"https://api.github.com/users/Maithem/orgs","repos_url":"https://api.github.com/users/Maithem/repos","events_url":"https://api.github.com/users/Maithem/events{/privacy}","received_events_url":"https://api.github.com/users/Maithem/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/CorfuDB/CorfuDB/milestones/1","html_url":"https://github.com/CorfuDB/CorfuDB/milestones/v1.0%20Release","labels_url":"https://api.github.com/repos/CorfuDB/CorfuDB/milestones/1/labels","id":2048118,"number":1,"title":"v1.0 Release","description":"This is the feature complete milestone for version 1.0.\r\n\r\n1.       Check pointing / disaster recovery\r\n2.       Security for Corfu (> TLS 1.1 and AAA)\r\n3.       Runtime Metrics/Stats\r\n4.       Corfu command line interface\r\n5.       Range indexes \r\n6.       Failure Detector\r\n7.       Lifecycle Management\r\n8.       Data checksum","creator":{"login":"no2chem","id":6496984,"avatar_url":"https://avatars.githubusercontent.com/u/6496984?v=3","gravatar_id":"","url":"https://api.github.com/users/no2chem","html_url":"https://github.com/no2chem","followers_url":"https://api.github.com/users/no2chem/followers","following_url":"https://api.github.com/users/no2chem/following{/other_user}","gists_url":"https://api.github.com/users/no2chem/gists{/gist_id}","starred_url":"https://api.github.com/users/no2chem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/no2chem/subscriptions","organizations_url":"https://api.github.com/users/no2chem/orgs","repos_url":"https://api.github.com/users/no2chem/repos","events_url":"https://api.github.com/users/no2chem/events{/privacy}","received_events_url":"https://api.github.com/users/no2chem/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":21,"state":"open","created_at":"2016-10-04T22:17:52Z","updated_at":"2016-11-18T22:02:01Z","due_on":"2017-01-31T00:00:00Z","closed_at":null},"comments":1,"created_at":"2016-11-18T08:38:27Z","updated_at":"2016-11-19T03:00:59Z","closed_at":null,"body":"Reading a stream address by address serially throws a null pointer exception.\r\n\r\nCode:\r\n\r\n    @Test\r\n    public void SimpleStreamTest() throws Exception {\r\n\r\n        CorfuRuntime rt = new CorfuRuntime(layoutServers).connect();\r\n        rt.setCacheDisabled(true);\r\n\r\n        UUID streamId = UUID.nameUUIDFromBytes(\"stream1\".getBytes());\r\n\r\n        StreamView s1 = rt.getStreamsView().get(streamId);\r\n\r\n        // Verify that the stream is empty\r\n        //assertThat(s1.check()).isEqualTo(-1);\r\n\r\n\r\n        // Generate and write random data. Write 100 entries, each entry is 2mb\r\n        int entrySize = 200;\r\n        int numEntries = 100;\r\n        byte[][] data = new byte[numEntries][entrySize];\r\n\r\n        Random rand = new Random();\r\n\r\n        for(int x = 0; x < numEntries; x++) {\r\n            rand.nextBytes(data[x]);\r\n            s1.write(data[x]);\r\n        }\r\n\r\n        // Read back the data and verify it is correct\r\n        for(int x = 0; x < numEntries; x++) {\r\n            LogData entry = s1.read(x);\r\n            byte[] tmp = (byte[]) entry.getPayload(rt);\r\n            \r\n            assertThat(tmp).isEqualTo(data[x]);\r\n        }\r\n    }\r\n\r\n\r\n\r\nstack trace\r\n\r\njava.lang.NullPointerException\r\n\tat org.corfudb.protocols.logprotocol.LogEntry.deserialize(LogEntry.java:68)\r\n\tat org.corfudb.util.serializer.CorfuSerializer.deserialize(CorfuSerializer.java:41)\r\n\tat org.corfudb.protocols.wireprotocol.LogData.getPayload(LogData.java:39)\r\n\tat org.corfudb.runtime.view.StreamView.read(StreamView.java:292)\r\n\tat org.corfudb.StreamIT.SimpleStreamTest(StreamIT.java:61)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\r\n\tat org.junit.runner.JUnitCore.run(JUnitCore.java:137)\r\n\tat com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)\r\n\tat com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)\r\n\tat com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:253)\r\n\tat com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)"},"comment":{"url":"https://api.github.com/repos/CorfuDB/CorfuDB/issues/comments/261688968","html_url":"https://github.com/CorfuDB/CorfuDB/issues/305#issuecomment-261688968","issue_url":"https://api.github.com/repos/CorfuDB/CorfuDB/issues/305","id":261688968,"user":{"login":"Maithem","id":7818642,"avatar_url":"https://avatars.githubusercontent.com/u/7818642?v=3","gravatar_id":"","url":"https://api.github.com/users/Maithem","html_url":"https://github.com/Maithem","followers_url":"https://api.github.com/users/Maithem/followers","following_url":"https://api.github.com/users/Maithem/following{/other_user}","gists_url":"https://api.github.com/users/Maithem/gists{/gist_id}","starred_url":"https://api.github.com/users/Maithem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maithem/subscriptions","organizations_url":"https://api.github.com/users/Maithem/orgs","repos_url":"https://api.github.com/users/Maithem/repos","events_url":"https://api.github.com/users/Maithem/events{/privacy}","received_events_url":"https://api.github.com/users/Maithem/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T03:00:59Z","updated_at":"2016-11-19T03:00:59Z","body":"Update.The null pointer exception is because bad serializer types are being read. I don't know if its improperly written, or if on the read the buffer pointer is not incremented properly, so when serializing a LogEntryType the wrong offset is read."}}
{"actor":{"display_login":"Maithem"}}