caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yoann Padioleau <padator@wanadoo.fr>
To: Caml List <caml-list@yquem.inria.fr>
Subject: [Caml-list] tips to debug ocaml programs segfaulting
Date: Thu, 3 Mar 2011 09:56:55 -0800	[thread overview]
Message-ID: <CCFEE5A2-7AD6-416C-B7FD-7DD52F371AF1@wanadoo.fr> (raw)

Hi,

I have a quite large program that segfaults. I can reproduce the segfault deterministically but have no idea
how to fix it. The program is a server that given a filename lookup information in a berkley DB database on this file
and then returns some results. For certain files everything is right but for other files the program just segfault.
When I attach with gdb on the server here is what I get:

[pad@unittest002 ~]$ gdb /home/engshare/tools/pfff_server 22436
GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
...
Attaching to program: /home/engshare/tools/pfff_server, process 22436
...
Reading symbols from /lib64/libpcre.so.0...done.
Loaded symbols for /lib64/libpcre.so.0
Reading symbols from /lib64/libdb-4.3.so...done.
Loaded symbols for /lib64/libdb-4.3.so
Reading symbols from /lib64/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 46912496215408 (LWP 22436)]
[New Thread 1176140096 (LWP 23759)]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /usr/lib64/libncurses.so.5...done.
Loaded symbols for /usr/lib64/libncurses.so.5
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x000000358ac0ceab in accept () from /lib64/libpthread.so.0
(gdb) bt
#0  0x000000358ac0ceab in accept () from /lib64/libpthread.so.0
#1  0x000000000040de8f in unix_accept ()
#2  0x0000000000425dd9 in caml_interprete ()
#3  0x000000000041317a in caml_main ()
#4  0x00000000004249cc in main ()
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) n
Program not restarted.
(gdb) 
(gdb) continue
Continuing.
[New Thread 1124940096 (LWP 24691)]
[Thread 1124940096 (LWP 24691) exited]
[New Thread 1124940096 (LWP 24723)]
[Thread 1124940096 (LWP 24723) exited]
[New Thread 1124940096 (LWP 24758)]
[Thread 1124940096 (LWP 24758) exited]
[New Thread 1124940096 (LWP 24796)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1124940096 (LWP 24796)]
0x00000000004258d0 in caml_interprete ()
(gdb) bt
#0  0x00000000004258d0 in caml_interprete ()
#1  0x0000000000421c32 in caml_callbackN_exn ()
#2  0x0000000000421d16 in caml_callback_exn ()
#3  0x00000000004095e9 in caml_thread_start ()
#4  0x000000358ac062f7 in start_thread () from /lib64/libpthread.so.0
#5  0x000000358a0d1e3d in clone () from /lib64/libc.so.6
(gdb) 


At this point I don't know what to do. No idea how from this backtrace to go back to the root cause of the segfault. Any tips ?




             reply	other threads:[~2011-03-03 17:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 17:56 Yoann Padioleau [this message]
2011-03-03 18:10 ` Yoann Padioleau
2011-03-03 18:19   ` Yoann Padioleau
2011-03-03 21:08     ` ygrek
2011-03-03 18:24 ` Guillaume Yziquel

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=CCFEE5A2-7AD6-416C-B7FD-7DD52F371AF1@wanadoo.fr \
    --to=padator@wanadoo.fr \
    --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).