caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jamie Brandon <jamie@scattered-thoughts.net>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Causes for segfaults
Date: Fri, 5 Nov 2010 23:14:19 +0000	[thread overview]
Message-ID: <AANLkTikaK_7PYLciiNSpewfkcW+4Jnqefyd_j9RCJH4v@mail.gmail.com> (raw)
In-Reply-To: <AANLkTik3Pryi5+QLyeZeuHPHjQwgy7-vce0KMY+mOvWs@mail.gmail.com>

> 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?


  reply	other threads:[~2010-11-05 23:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 20:19 Jamie Brandon
2010-11-04 20:25 ` [Caml-list] " Raphael Proust
2010-11-04 20:39   ` Jamie Brandon
2010-11-05 15:54     ` David MENTRE
2010-11-05 22:18     ` oliver
2010-11-04 20:41 ` Till Varoquaux
2010-11-05 23:14   ` Jamie Brandon [this message]
     [not found]   ` <384325291.294734.1288998871132.JavaMail.root@zmbs3.inria.fr>
2010-11-06  2:51     ` Daniel de Rauglaudre
2010-11-08 14:26       ` Jamie Brandon
2010-11-08 14:48         ` Till Varoquaux
2010-11-10 15:52           ` Jamie Brandon
2010-11-15 17:58             ` Jamie Brandon
2010-11-15 18:17               ` John Whitington
2010-11-15 18:38                 ` Jamie Brandon
2010-11-15 21:47                   ` Török Edwin
     [not found]                 ` <157788745.568057.1289846305435.JavaMail.root@zmbs3.inria.fr>
2010-11-15 18:50                   ` Daniel de Rauglaudre
2010-11-15 19:00                     ` Anil Madhavapeddy
2010-11-15 19:08                     ` Norman Hardy
     [not found]                     ` <1795362267.568432.1289847605872.JavaMail.root@zmbs3.inria.fr>
2010-11-15 19:21                       ` Daniel de Rauglaudre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikaK_7PYLciiNSpewfkcW+4Jnqefyd_j9RCJH4v@mail.gmail.com \
    --to=jamie@scattered-thoughts.net \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).