[redland-dev] Subtle error in Redland or Ada bindings

Victor Porton porton at narod.ru
Tue Aug 5 12:17:29 EDT 2014


In
https://github.com/vporton/redland-bindings/tree/e0d5aa40de42fb1aad4cecb27e59c8dd566cc84a
the Ada program src/test/special_test.adb prints '0' as the value of a pointer which is created by raptor_new_uri_from_counted_string() and must not be NULL.

I suspect that this is an error in Raptor itself not my Ada code.

Investigating this error is specifically difficult. I will try more, but it is hard.

It is also weird that replacing

   URI_1_Handle: constant RDF.Raptor.URI.Handle_Type := Get_Handle(From_String(World, URI_1));
--     URI_1_Handle: constant RDF.Raptor.URI.Handle_Type :=
--       C_Raptor_New_Uri_From_Counted_String(Get_Handle(World), To_C(URI_1, Append_Nul=>True), URI_1'Length);

with equivalent code

--     URI_1_Handle: constant RDF.Raptor.URI.Handle_Type := Get_Handle(From_String(World, URI_1));
   URI_1_Handle: constant RDF.Raptor.URI.Handle_Type :=
     C_Raptor_New_Uri_From_Counted_String(Get_Handle(World), To_C(URI_1, Append_Nul=>True), URI_1'Length);

eliminates the error. I have no idea why.

--
Victor Porton - http://portonvictor.org


More information about the redland-dev mailing list