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
[Caml-list] Ocaml and Samba function name collisions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-25 (00:31)
From: Blair Zajac <blair@o...>
Subject: [Caml-list] Ocaml and Samba function name collisions

The synopsis of this message is to ask that the Ocaml source
code prepend a Ocaml specific string, "ml_", "caml_" or "ocaml_"
to all function names in Ocaml's source code to avoid name
collisions with other packages.  My case is made below :)

I'm using mod_caml and mod_smbauth in an Apache 1 process.
mod_smbauth is used to authenticate access to the web server
using our ActiveDirectory server.

When is enabled in Apache httpd's conf file, it
core dumps with this stack backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1075767456 (LWP 3544)]
0x40b8a9cc in string_init (dest=0x40cb146c, src=0x1 <Address 0x1
out of bounds>) at lib/util_str.c:1142
1142      l = strlen(src);
(gdb) bt
#0  0x40b8a9cc in string_init (dest=0x40cb146c, src=0x1
<Address 0x1 out of bounds>) at lib/util_str.c:1142
#1  0x40b8ab21 in string_set (dest=0x1, src=0x0) at lib/util_str.c:1187
#2  0x40c34a4e in interprete () from
#3  0x40c265b1 in caml_main () from
#4  0x40c22ff4 in init () at mod_caml_c.c:80
#5  0x40c36975 in __do_global_ctors_aux () from
#6  0x40c20b95 in _init () from

Looking at the function names, both the Samba library and the
Ocaml source code have a function named string_set.  It's odd
though that the function name is binding to the Samba function
in instead of the name in, but then
I'm not an expert in shared library binding.

% nm | grep string_set
00019846 T string_set
% nm | grep string_set
00052afe T string_set
000552f9 T string_set_w

Now this may be a bug that can be worked around, but given
Ocaml's popularity in being linked with other packages, it
seems like a good idea to put all the Ocaml names into their
own space via a prepend.

I'd be happy to do some of this work by submitting patches to
the appropriate people/mailing list for review.  Let me know.


Blair Zajac <>
Plots of your system's performance -

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: