Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Segfault using malloc within stubs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Garry Belka <garry@N...>
Subject: Re: [Caml-list] Segfault using malloc within stubs
In our case the problem was in an interaction of interface definition 
and run-time system, so to say.

The memory we were allocating within stub was described as an Ocaml 
string, and so Ocaml was trying to check its size at first access, and 
failing with segfault.
As soon as we defined access functions for the string based on 
unsafe_get instead of naively using x.(i) notation, we stopped seeing
Segfault. Other option it to compile code with -unsafe turned on.

Garry