Am Freitag, den 29.04.2016, 16:14 +0200 schrieb Markus Weißmann: > The value comes from C bindings, but from a string-value via Char.code. > It is then passed through a constructor-function to create the record; > I added a check there to see if the C bindings are to blame: Well, there are other types of errors in C bindings that could also cause this. Imagine what happens when the C bindings do not properly handle pointers (e.g. do not declare them as local roots), and an outdated pointer to an int is followed by the GC because of this. Because the minor GC moves values to the major heap, this could cause that the int is overwritten then. In my experience, it's always the C binding! Unfortunately, there's no code for investigations. Gerd > > type foo = { a : int; b : int } > > let create (a : int) (b : int) = > assert (Obj.is_int (Obj.repr x)); (* always holds *) > { a; b } > > This assertion never triggered so far. > I replaced the equality check by a function which now also asserts the > is_int property: > > let equal (x : foo) (y : foo) = (* y is a static value living through > the entire run; x is from a parse/allocate/compare/throw-away cycle *) > assert (Obj.is_int (Obj.repr x.a)); > assert (Obj.is_int (Obj.repr y.a)); > assert (Obj.is_int (Obj.repr x.b)); (* <- this fails after a while > *) > assert (Obj.is_int (Obj.repr y.b)); > x = y > > and one of these (always the same) triggers after a while (after some > 10.000 calls). > But only with the standard minor heap size, not with a 4 MB sized one. > There are no other functions working on these values; they are parsed, > put through > the constructor function, compared and thrown away. > > Regards > Markus > > -- > Markus Weißmann, M.Sc. > Technische Universität München > Institut für Informatik > Boltzmannstr. 3 > D-85748 Garching > Germany > http://wwwknoll.in.tum.de/ -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------