English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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.