caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] memory corruption using C stub
@ 2017-06-10 15:33 Alexey Egorov
  2017-06-10 15:40 ` Viet Le
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Alexey Egorov @ 2017-06-10 15:33 UTC (permalink / raw)
  To: caml-list

Hello,

I have an OCaml application with some C code which (I believe) is the
reason of some random crashes.

Here is the code - https://pastebin.com/FVtLphZu
This function reads file at given offset, divides data into chunks and
compute checksums and compression ratio:
  external compute_data_props
    : string -> int -> int -> int -> (int * int * float) list =
"compute_data_props"

The problem is, after some calls to this stub, application is crashing
at random places in OCaml code.
I can't figure out what's going wrong, but replacing this stub with
dummy function (which does nothing but returns some predefined list)
eliminates the problem.

What can we do to debug it? We are using OCaml 4.04.1 and Windows 10,
and there is no other C stubs in our codebase.

Thanks!

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

end of thread, other threads:[~2017-06-11 19:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-10 15:33 [Caml-list] memory corruption using C stub Alexey Egorov
2017-06-10 15:40 ` Viet Le
2017-06-10 17:00   ` Alexey Egorov
2017-06-10 15:44 ` Daniel Bünzli
2017-06-10 15:50   ` Daniel Bünzli
2017-06-10 16:01   ` Daniel Bünzli
2017-06-11 11:37 ` Alexey Egorov
2017-06-11 11:45   ` David Allsopp
2017-06-11 11:54     ` Alexey Egorov
2017-06-11 12:07       ` David Allsopp
2017-06-11 15:26         ` Alexey Egorov
2017-06-11 18:49 ` Alexey Egorov
2017-06-11 19:20   ` David Allsopp

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).