I increased the stack size to 65532, which is apparently the max allowed on a Mac, and it doesn't change the behavior.


On Fri, Sep 5, 2014 at 5:56 PM, Richard W.M. Jones <rich@annexia.org> wrote:
On Fri, Sep 05, 2014 at 05:33:11PM -0400, Ashish Agarwal wrote:
> https://github.com/agarwal/ocaml402_error
>
> The above link contains a simple program that segfaults when compiling with
> ocamlopt 4.02. Byte code doesn't segfault, nor does native code with 4.01.
>
> This is the minimal example I could come up with. It uses atdgen and is
> sensitive to the exact fields in the .atd file. Removing any of the fields
> leads to correctly functioning code.
>
> I've only tested on Mac OS X so far.
>
> In the context of my full code, I observed another behavior also. Instead
> of a segfault, I would get random non-ascii characters printed for the
> value of postgres.host, and it would be different on repeated runs of the
> program (I didn't even recompile in between). I can't seem to reproduce
> this behavior, only getting the segfault now.

I made a best effort to compile that, but I don't have some of
the gazillion dependencies.  So instead I have a suggestion:

What happens if you increase the stack limit?

Rich.

--
Richard Jones
Red Hat