caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Obj.out_of_heap_tag, out of minor heap or memory corruption?
@ 2016-04-29 11:04 Markus Weißmann
  2016-04-29 13:17 ` Gerd Stolpmann
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Weißmann @ 2016-04-29 11:04 UTC (permalink / raw)
  To: caml-list

Hello,

I have a server program that crashes after some time with a very 
strange error:
The (=) comparison of two values returns false, even though they are 
pretty identical.
They are of type { a : int; b : int } and the comparison always fails 
on the second integer.
When printing the compared integers, they are always 0 (as expected) -- 
both of them; but are not equal (=).
I started inspecting the values with the "Obj.tag" and found them to be 
always of type Obj.int_tag -- until the non-equalness strikes:
One of the compared integers then always has Obj.out_of_heap_tag. This 
value surprisingly behaved like an integer unless compared to another:

let (x : int) =
   print_int x; (* "0" *)
   assert (x = 0) (* fails! *)

Can someone explain what this tag means exactly and if this 
works-as-intended or if my heap must have gotten hit by some faulty C 
bindings?
Is this some out-of-memory handling of the minor heap? If I set 
Gc.minor_heap_size to 4 MByte I don't get the Obj.out_of_heap_tag -- or 
at least haven't yet.

This is ocaml 4.02.3 on amd64.

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/


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-05-03 15:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29 11:04 [Caml-list] Obj.out_of_heap_tag, out of minor heap or memory corruption? Markus Weißmann
2016-04-29 13:17 ` Gerd Stolpmann
2016-04-29 14:14   ` Markus Weißmann
2016-04-29 14:25     ` Gerd Stolpmann
2016-05-02  8:27       ` Sébastien Hinderer
2016-05-02 14:30         ` Gabriel Scherer
2016-05-03 15:59           ` Boris Yakobowski
2016-04-29 14:57     ` Mark Shinwell
2016-04-29 15:41       ` Markus Weißmann
2016-04-29 16:41         ` Adrien Nader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).