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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id ECE5ABC57 for ; Sat, 6 Nov 2010 00:14:20 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoCAFss1EzRVdi0kGdsb2JhbAChHUoIFQEBAQEJCQwHEQMfoQOLcwEFhQeJBwEEhUiKWokj X-IronPort-AV: E=Sophos;i="4.58,306,1286143200"; d="scan'208";a="86400683" Received: from mail-qy0-f180.google.com ([209.85.216.180]) by mail1-smtp-roc.national.inria.fr with ESMTP; 06 Nov 2010 00:14:20 +0100 Received: by qyk1 with SMTP id 1so2732282qyk.18 for ; Fri, 05 Nov 2010 16:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:cc:content-type; bh=CFKZR0EReDC/VN6wcd1JL87HdTi4yfuI2/TxWThTICs=; b=ee5lwt62aYW/Eje83oz8WAkiS4HqLwDvl99A1JgUv7cB3CRNFEl1Nw0dzJUqryywwo vpkRsPggelhpLKQcnBXpLzfacTDdPl6XBcAdIHJtvcU4euHCfGvqjZcEydmMGWJDk2AX mXwg1fOMAmCt/RqWyGqaJeOXVOdRiWsXhzZyI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:cc:content-type; b=hU9GF2kJHaWlpsXGbvRPmNRx4wY1P0p/tG2Xk2Iegm80rZuAxY+vHNH2Zn6qvWF/ig OQ6hESO2HjnZYoA+CYxRDjnyXVxYBNMf57bw5I6olmWeLP3fBcMOaBD/3Ovu1t8lOYmH 7G/BB53i+jGPWgf0LWdGV6PPyGWz28ldV3OYA= MIME-Version: 1.0 Received: by 10.229.240.79 with SMTP id kz15mr2479683qcb.200.1288998859435; Fri, 05 Nov 2010 16:14:19 -0700 (PDT) Sender: jamiiecb@googlemail.com Received: by 10.229.187.133 with HTTP; Fri, 5 Nov 2010 16:14:19 -0700 (PDT) In-Reply-To: References: Date: Fri, 5 Nov 2010 23:14:19 +0000 X-Google-Sender-Auth: _pc4sgBVPF4AV3Fi7NGGxHnPP7E Message-ID: Subject: Re: [Caml-list] Causes for segfaults From: Jamie Brandon Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; segfaults:01 gdb:01 backtrace:01 segfault:01 gdb:01 ocaml:01 ocaml:01 lib:01 lwp:01 lwp:01 ocamlfind:01 ocamlopt:01 -linkpkg:01 -package:01 -package:01 > It might be intersting for you to run your app in gdb and sent the > backtrace of the segfault. Valgrind could also be very useful here but > it is not for the faint of heart. > > very quick guide to gdb (although I am sure you know): Not at all - spent my whole life in HLL land. Learning to use gdb is probably long overdue. > _ 1) Make sure your program is compiled with -g Ocaml 3.9 can't compile native code with -g :( Installing newer versions of ocaml on old installations of centOS is ... entertaining. Despite the delay, I did eventually get this to work. [root@senldogo0183 texsearch-development2]# gdb ./index GNU gdb Red Hat Linux (6.5-25.el5rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"...(no debugging symbols found) Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run Starting program: /data/texsearch-development2/index (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread 46912496271328 (LWP 30551)] (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 46912496271328 (LWP 30551)] 0x00000000004466e5 in camlIndex__run_query_1442 () (gdb) bt #0 0x00000000004466e5 in camlIndex__run_query_1442 () #1 0x0000000000004e21 in ?? () #2 0x000000000056050c in caml_ml_close_channel () #3 0x000000000078d0a0 in camlIndex () #4 0x0000000000000001 in ?? () #5 0x7fffffffffffffff in ?? () #6 0x00002aaaaab04900 in ?? () #7 0x0000000000447e98 in camlIndex__entry () #8 0x00002aaaaab04900 in ?? () #9 0x000000000078d890 in camlIndex__142 () #10 0x000000000078d808 in camlIndex__140 () #11 0x000000000078d928 in camlIndex__144 () #12 0x000000000078d8c0 in camlIndex__143 () #13 0x00002aaaaab03a58 in ?? () #14 0x000000000078d7c0 in camlIndex__123 () #15 0x000000000078d828 in camlIndex__141 () #16 0x000000000078dab0 in camlIndex__146 () #17 0x00002aaaaab03918 in ?? () #18 0x000000000078d7e8 in camlIndex__139 () #19 0x00002aaaaab038e8 in ?? () #20 0x000000000078da78 in camlIndex__145 () #21 0x00002aaaaab038c0 in ?? () #22 0x00002aaaaab03a40 in ?? () #23 0x00002aaaaab03a28 in ?? () #24 0x00002aaaaab03a10 in ?? () #25 0x00002aaaaab039f8 in ?? () #26 0x00002aaaaab039b0 in ?? () #27 0x00002aaaaab03960 in ?? () #28 0x0000000000000201 in ?? () #29 0x000000000043fdc9 in caml_startup__code_begin () #30 0x00000000002c5123 in ?? () #31 0x000000000056996e in caml_start_program () I'm not sure how to interpret this. run_query doesnt *directly* do anything but it calls into other modules (suffix_array etc) that are in the same directory. It looks to me like I screwed up the build process and there are no debugging symbols for suffix_array and co. This is what I did: ocamlfind ocamlopt -linkpkg -g \ -package extlib \ -package netclient \ -package json-wheel \ -package json-static \ -package xml-light \ -package str \ -syntax camlp4o \ -package json-static \ util.mli util.ml \ pid.mli pid.ml \ latex.mli latex.ml \ edit.ml \ suffix_array.mli suffix_array.ml \ query.ml \ index.ml \ -o index Any ideas?