From: David House <dhouse@janestreet.com>
To: Lin Hong <lhong@amnh.org>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Segmentation fault from Array.append
Date: Tue, 16 Oct 2012 18:29:33 +0100 [thread overview]
Message-ID: <CAK=fH+gr7oDbJ+1ogUTuH2+vr5h0hnqVO8xVYsOPeMejHs6KvQ@mail.gmail.com> (raw)
In-Reply-To: <C960B6881E802A459A09A7DAD55690053E7C4C5D@MAIL-MBX-004.internal.amnh.org>
I don't know enough about gdb to determine that, sorry.
If it's reproducible, you should be able to get a minimal test case,
and then just read carefully the c functions that remain. Keep in mind
the ocaml manual:
http://caml.inria.fr/pub/docs/manual-ocaml/manual033.html#toc146
On Tue, Oct 16, 2012 at 4:50 PM, Lin Hong <lhong@amnh.org> wrote:
>
> oh yes, we have c functions called from ocaml.
>
> if any of them screw heap up, why gdb debug didn't say anything. is there some debug option that we can get a closer look at heap?
>
>
> Thanks,
>
>
> Lin Hong
> American Museum of Natural History
> POY website :
> https://code.google.com/p/poy/
> http://research.amnh.org/scicomp/scripts/download.php
>
> ________________________________________
> From: David House [dhouse@janestreet.com]
> Sent: Tuesday, October 16, 2012 11:42 AM
> To: Lin Hong
> Cc: caml-list@inria.fr
> Subject: Re: [Caml-list] Segmentation fault from Array.append
>
> By "c stubs" I really mean c functions that you're calling from ocaml.
> It's very easy to get such things wrong and stamp all over your heap.
>
> On Tue, Oct 16, 2012 at 4:41 PM, Lin Hong <lhong@amnh.org> wrote:
>>
>>
>> if by "c stubs" you mean some function that holding up place but does nothing, we are not doing any of that.
>>
>> and yes it's reproducible on one mac, I will test it on other machine with Ocaml4.X.X
>>
>>
>> Thanks,
>> Lin Hong
>> American Museum of Natural History
>> POY website :
>> https://code.google.com/p/poy/
>> http://research.amnh.org/scicomp/scripts/download.php
>>
>> ________________________________________
>> From: David House [dhouse@janestreet.com]
>> Sent: Tuesday, October 16, 2012 11:10 AM
>> To: Lin Hong
>> Cc: caml-list@inria.fr
>> Subject: Re: [Caml-list] Segmentation fault from Array.append
>>
>> Segfaults in the GC are often the fault of random heap corruption. Are
>> you using any C stubs that might be at fault here?
>>
>> Is the fault reproducable?
>>
>> On Tue, Oct 16, 2012 at 4:08 PM, Lin Hong <lhong@amnh.org> wrote:
>>> Hi, all
>>>
>>> we got a Segmentation fault with Ocaml 4.0.0 and 4.0.1 from append function
>>> of Array. gdb traceback give us this:
>>>
>>> Program received signal EXC_BAD_ACCESS, Could not access memory.
>>> Reason: KERN_INVALID_ADDRESS at address: 0x0000000107b65000
>>> 0x0000000100488840 in mark_slice ()
>>> (gdb) backtrace
>>> #0 0x0000000100488840 in mark_slice ()
>>> #1 0x0000000100489216 in caml_major_collection_slice ()
>>> #2 0x000000010048984c in caml_check_urgent_gc ()
>>> #3 0x000000010048f26d in caml_array_gather ()
>>> #4 0x000000010048f42e in caml_array_append ()
>>> #5 0x00000001003ef216 in .L363 ()
>>> Previous frame inner to this frame (gdb could not unwind past this frame)
>>> (gdb)
>>>
>>> looks like the error is from array.c
>>>
>>> we don't see this problem with Ocaml3.X.X, they have different array
>>> function in the cside anyway.
>>>
>>> Does anyone else have similar problem like this?
>>>
>>>
>>> Thanks in advance for any suggestions.
>>>
>>> Cheers,
>>> Lin Hong
>>> American Museum of Natural History
>>> POY website :
>>> https://code.google.com/p/poy/
>>> http://research.amnh.org/scicomp/scripts/download.php
next prev parent reply other threads:[~2012-10-16 17:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 15:08 Lin Hong
2012-10-16 15:10 ` David House
2012-10-16 15:41 ` Lin Hong
2012-10-16 15:42 ` David House
2012-10-16 15:50 ` Lin Hong
2012-10-16 17:29 ` David House [this message]
2012-10-16 18:02 ` Daniel Bünzli
2012-10-16 19:08 ` Lin Hong
2012-10-17 13:33 ` Damien Doligez
2012-11-19 17:04 ` Lin Hong
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='CAK=fH+gr7oDbJ+1ogUTuH2+vr5h0hnqVO8xVYsOPeMejHs6KvQ@mail.gmail.com' \
--to=dhouse@janestreet.com \
--cc=caml-list@inria.fr \
--cc=lhong@amnh.org \
/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