Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2005-02-25 (00:37)
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.