From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 7031FBBAF for ; Mon, 23 Aug 2010 12:57:18 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMBAGLwcUxKfVK0kGdsb2JhbACTJY0DCBUBAQEBCQkMBxEDH518mhGFNwSJdg X-IronPort-AV: E=Sophos;i="4.56,256,1280700000"; d="scan'208";a="68100890" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 Aug 2010 12:57:18 +0200 Received: by wya21 with SMTP id 21so7769276wya.39 for ; Mon, 23 Aug 2010 03:57:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.145.5 with SMTP id b5mr4297010wbv.189.1282561037864; Mon, 23 Aug 2010 03:57:17 -0700 (PDT) Received: by 10.216.154.79 with HTTP; Mon, 23 Aug 2010 03:57:17 -0700 (PDT) X-Originating-IP: [203.143.161.115] Date: Mon, 23 Aug 2010 20:57:17 +1000 Message-ID: Subject: Segfaults with Dynlink with OCaml 3.11 From: Paul Steckler To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; segfaults:01 dynlink:01 ocaml:01 steckler:01 steck:01 ocaml:01 segfaults:01 dynamically:01 functions:01 functions:01 modifies:02 modifies:02 native:03 seems:03 segmentation:03 I'm getting segmentation faults when using dynamically linked native code in 64-bit OCaml 3.11 running on Linux (Fedora 12 x64). The .cmxs file loads fine. There's a glue module that's "open"d in the code for the dynamic module, and linked against the main program. The dynamic module calls functions that modifies lists in the glue module; the main code calls functions in the glue module that return the current values of those lists. The code that modifies the lists seems to work OK, but the query functions reliably give a crash. I've written some small example programs with a similar structure, and those work just fine. In my real, large program, which pulls in a lot of OCaml libraries, I get segfaults. Any ideas what might be going wrong? My code is not compiled with -nodynlink. -- Paul