caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Romain Beauxis <toots@rastageeks.org>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Tips to find the cause of a seg fault
Date: Wed, 1 Dec 2010 10:15:33 -0600	[thread overview]
Message-ID: <201012011015.34879.toots@rastageeks.org> (raw)
In-Reply-To: <AANLkTikedG6DHZNQDrgG3uGaWGxwh4zkaSGeS=4R99z5@mail.gmail.com>

Le mercredi 1 décembre 2010 09:17:15, Philippe Veber a écrit :
> > The function that triggers the segfault may be confusing, in particular
> > in case of a memory corruption, which I suspect here.
> > The pattern matching can cause a crash because it is using a value that
> > is already corrupted and because the third case is one that, for some
> > random conditions, touches the part in memory that is corrupted.
> 
> How is this possible if it is never reached (no left click) ?

Well, I was giving a general reply which may or may not apply here..
The fact that the problem goes away when you uncomment the unused case could 
be unrelated, though. It could also be that the issue is not related to this 
exact function but that the compiled binary has a different execution flow when 
you uncomment the third case..

> > In this case, I would try to unroll the code and see where the value that
> > is
> > used in this function was instanciated.
> 
> What do you mean by "unrolling the code" ?

Looking backward where the value used in the function was instanciated.

> > Finally, the best approach could be to actually look closely to the
> > binding's
> > code and try to spot anything fishy there related to your issue. This
> > generaly
> > worked better for me than trying to get information from gdb and the
> > like..
> 
> Many thanks for the clarification. Maybe I could (partially) "unplug" the
> GC by setting space_overhead to 100 ? That could give an indication on the
> moment the problem occurs ?

I've never tried this. What you can try also for instance is to comment the 
code that finalizes a value that you suspect causes the segfault..

However, I do not think your issue is related to the Gc. The backtrace does 
not seem to indicate that it occurs in C code with global lock removed so 
maybe what I said was irrelevant.

I have tried your minimal example and it does not segfault here too. As for 
Olivier, maybe this means that this is also related to the driver you are 
using. However, the segfault definitely seem to occur in ocaml part of the code 
so it seems that the problem is entangled, at least.


Romain
Romain


  parent reply	other threads:[~2010-12-01 16:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 23:08 Philippe Veber
2010-11-30 23:18 ` [Caml-list] " oliver
2010-12-01  8:32   ` Philippe Veber
2010-12-01  9:15     ` oliver
2010-12-01 10:26       ` Philippe Veber
2010-12-01 10:51         ` oliver
2010-12-01 15:08           ` Philippe Veber
2010-12-01  1:59 ` Romain Beauxis
2010-12-01 15:17   ` Philippe Veber
2010-12-01 15:27     ` oliver
2010-12-01 16:15     ` Romain Beauxis [this message]
2010-12-01  5:51 ` Ilya Seleznev
2010-12-01 15:21   ` Philippe Veber
     [not found] <1182061596.483210.1291158525016.JavaMail.root@zmbs1.inria.fr>
2010-12-03 15:43 ` Damien Doligez
2010-12-05 14:50   ` Philippe Veber

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=201012011015.34879.toots@rastageeks.org \
    --to=toots@rastageeks.org \
    --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).