From: Raj Bandyopadhyay <rajb@rice.edu>
To: caml-list@yquem.inria.fr
Subject: Segfault in Garbage collector code: any ideas?
Date: Thu, 19 Jun 2008 16:45:27 -0500 [thread overview]
Message-ID: <D94E4621-B7D4-43A3-BD08-0352A32F2122@rice.edu> (raw)
Dear all
I am running a large OCaml application with a C interface, and I get
a segfault for larger inputs. Since it seemed to be occurring in
OCaml's garbage collector code, I recompiled OCaml with a '-g'
option and used gdb to track the source of the segfault. Here's
what I see in gdb:
<
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0075a000
caml_oldify_mopup () at minor_gc.c:201
201 Field (new_v, i) = f;
(gdb) bt
#0 caml_oldify_mopup () at minor_gc.c:201
#1 0x0011dd14 in caml_empty_minor_heap () at minor_gc.c:221
#2 0x0011de80 in caml_minor_collection () at minor_gc.c:260
#3 0x00122908 in caml_interprete (prog=0x168f0c, prog_size=7708608)
at interp.c:538
#4 0x001171e8 in caml_callbackN_exn (closure=7602900, narg=1,
args=0x71d004) at callback.c:82
#5 0x0011723c in caml_callback_exn (closure=7602900, arg1=7708608)
at callback.c:109
... functions from my C code
1) From past experience, this sort of thing seems to occur when
I forget to use a CAMLparam/local/return macro somewhere. However, I
have looked over my C code several times and can't find any such
problem. Is there any other scenario where this sort of segfault can
occur?
2) Can those macros be misused, somehow? I have used them in every
function which is passed or returns or creates a 'value'.
Any suggestions on how I'd go about finding the source of this
problem would be welcome.
I apologize in advance for lack of specific information about the
application, I'm not sure what information would be useful. Please
feel free to email me with any questions or suggestions.
Thank you
Raj
next reply other threads:[~2008-06-19 21:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-19 21:45 Raj Bandyopadhyay [this message]
2008-06-19 21:51 ` [Caml-list] " Mark Shinwell
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=D94E4621-B7D4-43A3-BD08-0352A32F2122@rice.edu \
--to=rajb@rice.edu \
--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