From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id 474E02DF5 for ; Tue, 9 Oct 2018 16:23:35 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.54,360,1534802400"; d="scan'208,217";a="350396834" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 09 Oct 2018 18:23:34 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 1EB0982513; Tue, 9 Oct 2018 18:23:34 +0200 (CEST) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 5B20E824E4 for ; Tue, 9 Oct 2018 18:23:30 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=ivanatodvuk@gmail.com; spf=Pass smtp.mailfrom=ivanatodvuk@gmail.com; spf=None smtp.helo=postmaster@mail-ed1-f52.google.com IronPort-PHdr: =?us-ascii?q?9a23=3AcXediBHwhc7ANoBNEdEldp1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ78oMmwAkXT6L1XgUPTWs2DsrQY07WQ6/iocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZr?= =?us-ascii?q?KeTpAI7SiNm82/yv95HJbAhEmDiwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+?= =?us-ascii?q?NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjD?= =?us-ascii?q?QhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VC+85Kl3VhDnlC?= =?us-ascii?q?YHNyY48G7JjMxwkLlbqw+lqxBm3oLYfJ2ZOP94c6jAf90VWHBBU95eWCJBDI2y?= =?us-ascii?q?bJYBAfQdMutDtYbxu0EDoAGiCQWwBu7izCJDiH/s3a091uQsCQLI3BI6ENIIqn?= =?us-ascii?q?vfsdr6NLoRUeCy0KnIzCnMZO5R1Df89ojHaBYhruuQXbJ3bMXR11QvFwDeg1Wf?= =?us-ascii?q?rIzqJTKV1uAXv2eH6OpgUPuihmg6oA9/pTivw90jiojPho8Ny1DE8z95wIcvKt?= =?us-ascii?q?GiRk57e9ipG4ZTuSGCL4Z6XN8uTmVytCs5yrAKo4C3cDQJxZg9xxPTdfqKeJWS?= =?us-ascii?q?7B35TuaeOzJ4iWpleL2hgxay9lCtyujmWcm11FZGtzRKncTRunwU2Rze6taLRu?= =?us-ascii?q?Fy/kem3jaP2ATT5f9eLU8okqrbLoYtwr82lpUNrUTOBjH6lFnygaOMdUgp+vKk?= =?us-ascii?q?5/r7brjlvJORN5F4hhn7Mqs0m8y/Beo4MhIJX2ie4em81aPj8lf/QLpQkv02lb?= =?us-ascii?q?TWsI7HJcQYvaO5DApV3Zwi6xa7FTupzNMYnXwfIFJfZB2Hl5TpO03JIP3gEfiw?= =?us-ascii?q?mVGskDNyy/DCP73hGYnNI2PYkLbheLZ981RTxBAyzdBZ/ZJUC6sOLOj9Wk/r55?= =?us-ascii?q?TkCUoyOgmwhuLmE8lV14UEWGvJDLXKHrnVtAqp+OspKqGyeYwSpDf2Y6wk+ffo?= =?us-ascii?q?hGM+lUEAfoGm2JIWbDazGfEwcBbRWmblntpUSTRChQE5VuG/zQTaCWcCNUb3ZL?= =?us-ascii?q?o143QAMKzjCI7CQo63h7nYhXW0G5RXYiZNDVXeSC60JbXBYO8FbWepGuEkiiYN?= =?us-ascii?q?DOHzRIoo1BXovwj/meI+c7jkvxYAvJem7+Bbou3ekRZoqG5xBsWZlmyBFiR6wz?= =?us-ascii?q?lOSDgx06Ry50d6zwXb3A=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BkCwCg1LxbhzTQVdFjH4F6gikBQH8og?= =?us-ascii?q?3WBHYJckFGLdIdIhzoNBR6ESYQ8GQcBBDUJDAEDAQECAQEBAQETAQEBCA0JCBs?= =?us-ascii?q?OIwyCNiQBgwgdARsSCwEDEgkBBjcCJAERAQUBPYMZAYFoAQMVD5kmPIsLgREFA?= =?us-ascii?q?ReCdgWBOAeCOQoZJw1agW8CAQUSiycXggCHPwOBOXSCNIJXAp12CYIPhECDEoZ?= =?us-ascii?q?pF4FOhGeJSowpiT8PIYE5R4EuMxojUDGCO4I0g0+BPokWPTABigQHgkYBAQ?= X-IPAS-Result: =?us-ascii?q?A0BkCwCg1LxbhzTQVdFjH4F6gikBQH8og3WBHYJckFGLdId?= =?us-ascii?q?IhzoNBR6ESYQ8GQcBBDUJDAEDAQECAQEBAQETAQEBCA0JCBsOIwyCNiQBgwgdA?= =?us-ascii?q?RsSCwEDEgkBBjcCJAERAQUBPYMZAYFoAQMVD5kmPIsLgREFAReCdgWBOAeCOQo?= =?us-ascii?q?ZJw1agW8CAQUSiycXggCHPwOBOXSCNIJXAp12CYIPhECDEoZpF4FOhGeJSowpi?= =?us-ascii?q?T8PIYE5R4EuMxojUDGCO4I0g0+BPokWPTABigQHgkYBAQ?= X-IronPort-AV: E=Sophos;i="5.54,360,1534802400"; d="scan'208,217";a="281580115" Received: from mail-ed1-f52.google.com ([209.85.208.52]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 09 Oct 2018 18:23:29 +0200 Received: by mail-ed1-f52.google.com with SMTP id b7-v6so2256596edd.9 for ; Tue, 09 Oct 2018 09:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=o7G9sQLNQdfqOla3wiqR7DRgDlA+m10PZngCNKlehYM=; b=ZK11bXYzfWchMwLT8MO54TQzVHiXNa1sRpBlNjPiY3xBDW3YMl44i5EQPEOWxnFJAE Z33pkyTjs0V5x+MvmyvZzteaUbO5P/qbemqEmfiXmIw4oDBdV8701usgw1ss0hyhqwZe lRrEtMlEGeecWGTWoC2dfdRmGp/Mp8byHw00OTN3i8jRAY4AlCwOT5CWOoVMX2eVIArk ht6jophLcRSjF/66dzn0Bttm++aLEXTTa/RkDMdUAoQHReURAWnFn4QhjkGUbltUPAd0 QE7LAyGIn/QhxhgDtkfhY2ifD01VBK7Iz1DumQkJCieI07IqR97dctoZmJKATPontyrJ AvHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=o7G9sQLNQdfqOla3wiqR7DRgDlA+m10PZngCNKlehYM=; b=C8LGcoUiP/kuuGelNLYespKP1wBnA7VxUVjnZMV+j5s3woi2V7b3cRnVuakqTfsiRd SrfpNXrb4jidnzYv/EhsyUBtImBlWvFlp9hrllkS2f8YJSryd5QIzOsWT3HabgovZQw4 Z4pG0xED7xBFPQG7N5pwI47R1jg4uCvbwa6tuWxEc8nFvVmWB1QEEmWvpOqnt5V5aHe6 U1NAU0YBbbVzzkO8Vf8/A99PyWROyUivmiBgDHplHqdFartGn0h1Qdj6WPu+B1O/P8AU 1aI31L57os8pdywvIytUMNJOLng+VkeH46xj/byx4CPXTpZuEQfNiqzMu6pV/RnScArQ vdcQ== X-Gm-Message-State: ABuFfog5ehv4Zjn5AetNYwHU7mOhxTD4QnVSpkHiyHXsucY6Wmx8aH5T 25Fm66T7ux1rpoGnz+JwtFxd8fbJwTSs3vdYOFoBge/s X-Google-Smtp-Source: ACcGV60N47ehAa/jGCyg9cmDgTuQ+EXvhOzuPV3AKKYeV8enB9ZT2bfI7mSZXu1Yi7qPSzaqLPQKxWVnFIQg4m3Wb3s= X-Received: by 2002:a50:a384:: with SMTP id s4-v6mr37063805edb.121.1539102208548; Tue, 09 Oct 2018 09:23:28 -0700 (PDT) MIME-Version: 1.0 From: Ivana Vukotic Date: Tue, 9 Oct 2018 18:23:17 +0200 Message-ID: To: caml-list@inria.fr Cc: Vincent Rahli Content-Type: multipart/alternative; boundary="00000000000069e44e0577ce2865" Subject: [Caml-list] OCaml and SGX Reply-To: Ivana Vukotic X-Loop: caml-list@inria.fr X-Sequence: 17097 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --00000000000069e44e0577ce2865 Content-Type: text/plain; charset="UTF-8" Hi, We are trying to run some OCaml code within an Intel SGX enclave. This OCaml code is called by a C wrapper using the method described here: https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html Because Intel SGX doesn't support the entire standard C library, we had to create ocalls for the functions that are used by ocamlrun but not supported by SGX. Using the functionalities provided by Intel SGX, we managed to create an .so library containing our OCaml code along with the C wrapper. This .so library is what is meant to run in an SGX enclave (we so far only implemented the ocalls that we needed, and not all missing functionalities from ocamlrun). Our problem is now that when we call caml_startup from within our C wrapper (in order to start the OCaml code), the code seem to simply call 'exit' and stop there. Does anyone know why this call to caml_startup would call 'exit'? We managed to create a simple example, which I can forward to anyone interested to take a look (unfortunately mailing list has a limited attachment and I can not send it). Please note that we use ocaml 4.06.1 and gcc 7.3.0 Best, Ivana -- Caml-list mailing list. Subscription management and archives: https://sympa.inria.fr/sympa/arc/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs --00000000000069e44e0577ce2865 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

We are trying to run some OCaml code within an Intel SGX enclave.

This OCaml code is called by a C wrapper using the method described
here:  https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html

Because Intel SGX doesn't support the entire standard C library, we had
to create ocalls for the functions that are used by ocamlrun but not
supported by SGX.  Using the functionalities provided by Intel SGX, we
managed to create an .so library containing our OCaml code along with
the C wrapper.  This .so library is what is meant to run in an SGX
enclave (we so far only implemented the ocalls that we needed, and not
all missing functionalities from ocamlrun).

Our problem is now that when we call caml_startup from within our C
wrapper (in order to start the OCaml code), the code seem to simply call
'exit' and stop there.  Does anyone know why this call to caml_star=
tup
would call 'exit'?

We managed to create a simple example, which I can forward to anyone intere=
sted 
to take a look (unfortunately mailing list has a limited attachmen= t and I can not
=C2=A0send it).
Please note that we use ocaml 4.06.1 and gcc 7.3.0

Best,
Ivana
--00000000000069e44e0577ce2865--