<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/6778b4e18c4db55e7461cb9af43857ef"
  from="Blair Zajac &lt;blair@o...&gt;"
  author="Blair Zajac"
  date="2003-11-25T00:31:29"
  subject="[Caml-list] Ocaml and Samba function name collisions"
  prev="2003/11/98f4e5ad6d2d610665f49b28f351ad5e"
  next="2003/11/837fcd4c3c00ccfcd0571db7f70ba7ae"
  next-in-thread="2003/11/453654183c3d05b2466c29cbfbc028cd"
  prev-thread="2003/11/04de2adad170aa7cd1c0961e4ed73162"
  next-thread="2003/11/837fcd4c3c00ccfcd0571db7f70ba7ae"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Ocaml and Samba function name collisions">
<msg 
  url="2003/11/6778b4e18c4db55e7461cb9af43857ef"
  from="Blair Zajac &lt;blair@o...&gt;"
  author="Blair Zajac"
  date="2003-11-25T00:31:29"
  subject="[Caml-list] Ocaml and Samba function name collisions">
<msg 
  url="2003/11/453654183c3d05b2466c29cbfbc028cd"
  from="Stefano Zacchiroli &lt;zack@b...&gt;"
  author="Stefano Zacchiroli"
  date="2003-11-25T07:38:29"
  subject="Re: [Caml-list] Ocaml and Samba function name collisions">
<msg 
  url="2003/11/97251759b76a4f2b13826f9a50b18c00"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-11-25T07:52:36"
  subject="Re: [Caml-list] Ocaml and Samba function name collisions">
<msg 
  url="2003/11/a3a7ab4e74ebbf072bc450a95a4ba3a7"
  from="Samuel Mimram &lt;samuel.mimram@e...&gt;"
  author="Samuel Mimram"
  date="2003-11-25T12:55:49"
  subject="Re: [Caml-list] Ocaml and Samba function name collisions">
<msg 
  url="2003/11/92e66679ae28e4de54ec97394dfbd22f"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-11-25T14:32:18"
  subject="Re: [Caml-list] Ocaml and Samba function name collisions">
<msg 
  url="2003/11/4a128889eaa8ec56c6743f2f44a7612e"
  from="Blair Zajac &lt;blair@o...&gt;"
  author="Blair Zajac"
  date="2003-11-26T07:17:30"
  subject="Re: [Caml-list] Ocaml and Samba function name collisions">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/babbf41d038dd6ec6ad2c115fbe68680"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-25T09:21:49"
  subject="Re: [Caml-list] Ocaml and Samba function name collisions">
</msg>
</msg>
</msg>
</thread>

<contents>
Hello,

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.

http://www.tekrat.com/smbauth.php

When mod_caml.so 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 &lt;Address 0x1
out of bounds&gt;) at lib/util_str.c:1142
1142      l = strlen(src);
(gdb) bt
#0  0x40b8a9cc in string_init (dest=0x40cb146c, src=0x1
&lt;Address 0x1 out of bounds&gt;) 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
/opt/i386-linux/installed/apache-1.3.29-g/libexec/mod_caml.so
#3  0x40c265b1 in caml_main () from
/opt/i386-linux/installed/apache-1.3.29-g/libexec/mod_caml.so
#4  0x40c22ff4 in init () at mod_caml_c.c:80
#5  0x40c36975 in __do_global_ctors_aux () from
/opt/i386-linux/installed/apache-1.3.29-g/libexec/mod_caml.so
#6  0x40c20b95 in _init () from
/opt/i386-linux/installed/apache-1.3.29-g/libexec/mod_caml.so
...

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 mod_smbauth.so instead of the name in mod_caml.so, but then
I'm not an expert in shared library binding.

% nm mod_caml.so | grep string_set
00019846 T string_set
% nm mod_smbauth.so | 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.

Best,
Blair

-- 
Blair Zajac &lt;blair@orcaware.com&gt;
Plots of your system's performance - http://www.orcaware.com/orca/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

