Ok, I have this more strange case (julia 0.4)
In the following X is a pointer to an array of structures (From the C side)
X = GMT_Encode_Options(API, "blockmean", '$', pointer([LL]), n_items);
julia> X
Ptr{GMT.GMT_RESOURCE} @0x0000000018df0740
Now, in this case I know there are 2 of those structs/composite types and
indeed I can access the data with
julia> z =unsafe_load(X)
GMT.GMT_RESOURCE(0x00000000,0x00000001,0x00000000,Ptr{GMT.GMT_OPTION}
@0x00000000035fc3e0,0,0,Ptr{Void} @0x0000000000000000)
julia> z =unsafe_load(X,2)
GMT.GMT_RESOURCE(0x00000000,0x00000001,0x00000001,Ptr{GMT.GMT_OPTION}
@0x00000000035fcf80,0,0,Ptr{Void} @0x0000000000000000)
but if I do
XX = pointer_to_array(X,2)
it instantaneously kills Julia with out any error message.
(sorry, to provide an example case one would need to install developing
versions of GMT and GMT.jl)