From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q3AGPehK010127 for ; Tue, 10 Apr 2012 18:25:40 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgsBAL1ehE9KfVM2kGdsb2JhbABEFrkNCCIBAQEBCQkNBxQEI4IKAQEEEgIsARseAwwGBQs7IgERAQUBHAY1h10BAwucIQqMGYJxhUwKGScNV4h2AQULkFYEjgaHZoERjUU9hAyBWg X-IronPort-AV: E=Sophos;i="4.75,399,1330902000"; d="scan'208";a="153434843" Received: from mail-ee0-f54.google.com ([74.125.83.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Apr 2012 18:25:07 +0200 Received: by eekd17 with SMTP id d17so1669052eek.27 for ; Tue, 10 Apr 2012 09:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SzbXa/9xKkgy5mMmRltLzFGfyPzFADKvCvit5JNRtwE=; b=sO4PCd37bp4908yGtEWwSj0zL3l5Mdq71XWand3pulSWluJd84Bohow0Cy74ZyqDzr Ge8+x3Myhm9wB5Zr96vVHTb/b8jnav29+WiF6sX2TdRpFBedVvBpIIT0k+A4Z4FrupzA 8eDemSFUHiRHlpLl9x5yXd4kzoiteuM6PEZpBgrvpCObQX+RxH5me0Gddediv5iLibq3 0u8qI8zRZ4CpPzJvSi8SGZSzJA9S48VqiIVG8JlL4wuFtJ3xJ+L6WdvDcWr/w7s+GN1T ZpxLRFtaEtE4koAeOWbzHCFU7ZPfGmQG6NxyX0taxFE5M5OTmzdFY9/IZXc2Y6pGDeUD n6Ug== MIME-Version: 1.0 Received: by 10.213.9.7 with SMTP id j7mr725627ebj.155.1334075105908; Tue, 10 Apr 2012 09:25:05 -0700 (PDT) Received: by 10.213.19.138 with HTTP; Tue, 10 Apr 2012 09:25:05 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Apr 2012 18:25:05 +0200 Message-ID: From: Adrien To: caml users Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Timing module initializations (working but crashy) Hi, Kaustuv Chaudhuri mentionned a few things about this issue on IRC. First, one thing I had forgotten in my previous email: I've tried making the functions usual ocaml-callable C functions (with CAML{param,local,return}*) but that didn't change anything. The segfaults still occurs in the exact same place. I've also removed the intermediate function. It generates ten times more C code but removing the indirection should reduce the number of possible issues. However the issue still happens at the same place. Finally, by printing the addresses of the entry functions, we got the following output: [...] (* this is GtkMain disabling auto-compaction *) New max overhead: 1000000% [...] Initialiazing OgtkFileProps through 0x50d170. Done initialiazing OgtkFileProps through 0x50d3bc. 23.016000 microseconds spent initializing OgtkFileProps. Initialiazing GContainer through 0x50e8b0. Done initialiazing GContainer through 0x1. 483.846000 microseconds spent initializing GContainer. Initialiazing GPack through 0x511fa0. Done initialiazing GPack through 0x1. 1931.545000 microseconds spent initializing GPack. Initialiazing GButton through 0x5165c0. < Program received signal SIGSEGV, Segmentation fault. 0x0000000000581176 in caml_oldify_local_roots () I don't really understand why (and, to be honest, how) the function pointer would change but maybe there's something I don't fully know with function pointers and printf's %p format. I've put a new file online with the aforementionned changes: http://notk.org/~adrien/link2.ml Any input is particularly appreciated. :-) By the way, a few reasons I've started this: startup speed, potential very slow initializations for which there was no instrumentation, detecting useless code that impacts runtime, and the fact that I want to make an application "not get start slower" but I had no hard numbers on how how fast it currently starts. -- Adrien Nader