caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Török Edwin" <edwin@etorok.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] segfault in simple program with 4.02 native
Date: Sat, 06 Sep 2014 00:36:20 +0200	[thread overview]
Message-ID: <1409956580.2434.2.camel@thunder.home.lan> (raw)
In-Reply-To: <20140905221813.GC3416@annexia.org>

On Fri, 2014-09-05 at 23:18 +0100, Richard W.M. Jones wrote:
> On Fri, Sep 05, 2014 at 11:13:02PM +0100, Richard W.M. Jones wrote:
> > On Fri, Sep 05, 2014 at 06:06:55PM -0400, Ashish Agarwal wrote:
> > > I increased the stack size to 65532, which is apparently the max allowed on
> > > a Mac, and it doesn't change the behavior.
> > 
> > Yup.  I was able to reproduce this on the non-core version, and indeed
> > increasing the stack to unlimited on Linux does not help.
> > 
> > The stack trace is simple:
> > 
> > #0  0x00000000004543f4 in camlPervasives__output_string_1198 ()
> > #1  0x0000000000472093 in camlCamlinternalFormat__output_acc_60624 ()
> > #2  0x0000000000473a32 in camlPrintf__fun_1062 ()
> > #3  0x000000000041e776 in camlApp__entry ()
> > #4  0x000000000041c5f9 in caml_program ()
> > #5  0x0000000000497f7e in caml_start_program ()
> > #6  0x000000000049813d in __libc_csu_init ()
> > #7  0x00007ffff7317d65 in __libc_start_main () from /lib64/libc.so.6
> > #8  0x000000000041c2e9 in _start ()
> > 
> > I'm just installing debuginfo so I can get more symbols ..
> 
> .. although I guess the fact that the generated code in config_j.ml is
> doing a lot of Obj.magic would be the first place to be suspicious.
> 
> eg:
> 
>     let (x : postgres) =
>       {
>         host = Obj.magic 0.0;
> ...
> 
> where the host field has declared type string.  Really?

There's also this, and a lot of Obj.set_field too
  postgres = Obj.magic 0.0;

FWIW it triggers an assertion failure with -runtime-variant d even
before it starts parsing:

./app.native 
### OCaml runtime: debug mode ###
Initial minor heap size: 2048k bytes
Initial major heap size: 3840k bytes
Initial space overhead: 80%
Initial max overhead: 500%
Initial heap increment: 15%
Initial allocation policy: 0
file memory.d.c; line 548 ### Assertion failed: Is_in_heap(fp)

Best regards,
--Edwin


  reply	other threads:[~2014-09-05 22:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 21:33 Ashish Agarwal
2014-09-05 21:50 ` Andy Ray
2014-09-05 21:56 ` Richard W.M. Jones
2014-09-05 22:01   ` Sebastien Mondet
2014-09-05 22:06   ` Ashish Agarwal
2014-09-05 22:13     ` Richard W.M. Jones
2014-09-05 22:18       ` Richard W.M. Jones
2014-09-05 22:36         ` Török Edwin [this message]
2014-09-05 22:39         ` Martin Jambon
2014-09-05 23:39           ` Ashish Agarwal
2014-09-05 23:59             ` Martin Jambon
2014-09-06  0:12           ` Jeremy Yallop
2014-09-06  5:51             ` Martin Jambon
2014-09-06  6:00               ` Milan Stanojević
2014-09-06  7:46                 ` Frédéric Bour
2014-09-06 19:15                   ` Martin Jambon
2014-09-06 19:08                 ` Martin Jambon
2014-09-06 20:31                   ` David MENTRÉ
2014-09-06 21:57                     ` Martin Jambon
2014-09-07  7:34                       ` David MENTRÉ
2014-09-07 18:47               ` Alain Frisch
2014-09-08  1:28                 ` Martin Jambon
2014-09-13 10:26                   ` Martin Jambon
2014-09-14  7:41                     ` Martin Jambon
2014-09-05 22:18       ` Christoph Höger

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=1409956580.2434.2.camel@thunder.home.lan \
    --to=edwin@etorok.net \
    --cc=caml-list@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).