{"action":"closed","issue":{"url":"https://api.github.com/repos/jnr/jnr-ffi/issues/36","labels_url":"https://api.github.com/repos/jnr/jnr-ffi/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/jnr/jnr-ffi/issues/36/comments","events_url":"https://api.github.com/repos/jnr/jnr-ffi/issues/36/events","html_url":"https://github.com/jnr/jnr-ffi/issues/36","id":63224823,"number":36,"title":"jnr.ffi on ppc64le ubuntu 14.10 and IBM JDK fails PointerTest.","user":{"login":"ralphbellofatto","id":4139514,"avatar_url":"https://avatars.githubusercontent.com/u/4139514?v=3","gravatar_id":"","url":"https://api.github.com/users/ralphbellofatto","html_url":"https://github.com/ralphbellofatto","followers_url":"https://api.github.com/users/ralphbellofatto/followers","following_url":"https://api.github.com/users/ralphbellofatto/following{/other_user}","gists_url":"https://api.github.com/users/ralphbellofatto/gists{/gist_id}","starred_url":"https://api.github.com/users/ralphbellofatto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralphbellofatto/subscriptions","organizations_url":"https://api.github.com/users/ralphbellofatto/orgs","repos_url":"https://api.github.com/users/ralphbellofatto/repos","events_url":"https://api.github.com/users/ralphbellofatto/events{/privacy}","received_events_url":"https://api.github.com/users/ralphbellofatto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-20T13:11:49Z","updated_at":"2015-04-23T21:00:55Z","closed_at":"2015-04-23T21:00:55Z","body":"Under the IBM JDK we get the following error:\r\n\r\n```\r\n------------------------------------------------------\r\n T E S T S\r\n-------------------------------------------------------\r\nRunning jnr.ffi.PointerTest\r\nRB: PointerTest::pointerArraySetElement\r\nptr_set_array_element (nil), 0\r\nUnhandled exception\r\nType=Segmentation error vmState=0x00040000\r\nJ9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001\r\n```\r\n\r\nI added instrumentation to isolate the problem:\r\n````\r\ndiff --git a/libtest/PointerTest.c b/libtest/PointerTest.c\r\nindex ce642bb..c291c6e 100644\r\n--- a/libtest/PointerTest.c\r\n+++ b/libtest/PointerTest.c\r\n@@ -54,12 +54,15 @@ TEST(pointer);\r\n void*\r\n ptr_return_array_element(void **ptrArray, int arrayIndex)\r\n {\r\n+    printf(\"ptr_return_array_element %p, %d\\n\", ptrArray, arrayIndex);  fflush(stdout);\r\n     return ptrArray[arrayIndex];\r\n }\r\n\r\n void\r\n ptr_set_array_element(void **ptrArray, int arrayIndex, void *value)\r\n {\r\n+       printf(\"ptr_set_array_element %p, %d\\n\", ptrArray, arrayIndex);  fflush(stdout);\r\n+       printf(\"ptr_set_array_element *%p, %d\\n\", *ptrArray, arrayIndex);  fflush(stdout);\r\n     ptrArray[arrayIndex] = value;\r\n }\r\n\r\ndiff --git a/src/test/java/jnr/ffi/PointerTest.java b/src/test/java/jnr/ffi/PointerTest.java\r\nindex ac6afbf..faa2a18 100644\r\n--- a/src/test/java/jnr/ffi/PointerTest.java\r\n+++ b/src/test/java/jnr/ffi/PointerTest.java\r\n@@ -381,6 +381,7 @@ public class PointerTest {\r\n\r\n     @Test\r\n     public void pointerArraySetElement() {\r\n+        System.out.print(\"RB: PointerTest::pointerArraySetElement\\n\");\r\n         Pointer[] ary = new Pointer[10];\r\n         Pointer p1 = runtime.getMemoryManager().newPointer(0xdeadbeef & runtime.addressMask());\r\n         Pointer p2 = runtime.getMemoryManager().newPointer(0xfee1dead & runtime.addressMask());\r\n@@ -388,6 +389,7 @@ public class PointerTest {\r\n         assertEquals(p1, ary[0]);\r\n         testlib.ptr_set_array_element(ary, 9, p2);\r\n         assertEquals(p2, ary[9]);\r\n+        System.out.print(\"RB: PointerTest::pointerArraySetElement-\\n\");\r\n     }\r\n\r\n     @Test public void mixObjectsAndPrimitives() {\r\n````\r\n\r\nThe telemetry above shows that we enter the \"ptr_set_array_element\" function but our pointer is nill.\r\n\r\nThis is similar to [https://github.com/jnr/jnr-ffi/issues/32,](https://github.com/jnr/jnr-ffi/issues/32,_https://github.com/jnr/jnr-ffi/issues/32, but not quite the same,  \r\n\r\nWe get through the pointerSetArrayElement test, but fail on the pointerGetArrayElement test for that one.\r\n\r\n\r\n\r\n"}}