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
Dynamically loaded BSS not initialised to 0.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Guillaume Yziquel <guillaume.yziquel@c...>
Subject: Re: [Caml-list] Dynamically loaded BSS not initialised to 0.
Guillaume Yziquel a écrit :
> Hello.
> I encountered a rather weird issue. A binding of mine works fine when 
> bundled as a .cmxa, but fails when bundled as a .cma. I'm running a 
> Linux Debian amd64.
> I've tracked down the issue to the following point: it seems that when 
> the BSS (uninitialised data section) of is dynamically 
> loaded, it doesn't get initialised to 0. And the code in 
> relies on the fact that BSS gets initialised to 0 when dynamically loaded.
> So: is ocaml failing to initialise memory to 0 when is 
> dynamically loaded?

Problem solved: This is in fact a symbol collision problem on the symbol 
'box'. There's one in libncurses, which is loaded by ocamlrun.

Thanks to Csaba Halasz (Jester01 on ##asm) for help with binary debugging.

All the best,

      Guillaume Yziquel