caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mark Shinwell <mshinwell@janestreet.com>
To: Siraaj Khandkar <siraaj@khandkar.net>
Cc: eliot@colba.net, Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] mysterious cgi problem
Date: Fri, 20 Jun 2014 09:53:25 +0100	[thread overview]
Message-ID: <CAM3Ki76w9MD5BeGrEFyC3nsSK8vAuh5B0hHcbz4fb0y0p+hFAA@mail.gmail.com> (raw)
In-Reply-To: <53A3CB24.3040102@khandkar.net>

Is the OCaml executable compiled to native code?

If so, you may be able to trap this by having the HTTP server execute
gdb with commands to execute your OCaml program, and then give you a
backtrace immediately before it exits.  Ensure your program was
compiled with the -g option to ocamlopt.  Then for example if you
currently run:

/my/executable --foo-bar

you would instead run:

gdb -ex "b exit" -ex "r" -ex "bt" -ex "set confirm 0" -ex "q" --args
/my/executable --foo-bar

Mark

On 20 June 2014 06:48, Siraaj Khandkar <siraaj@khandkar.net> wrote:
> Not_found must be coming from some initialization procedure in module Y,
> so try to trap it from there.
>
>
> On 06/19/2014 11:41 PM, Eliot Handelman wrote:
>> Hi list,
>>
>> We have a demo coming up on Monday of an ocaml based music analysis and
>> generation system with a
>> web component for music notation that, irritatingly, has stopped
>> working. The interface is a CGI
>> with an ocaml 4.01 executable. After several harrowing days I narrowed
>> the problem down to the
>> following situation:
>>
>> X, a basic system, runs fine in firefox/chrome/various linuxen
>>
>> X + module Y  generates "Not_found" exceptions in the CGI merely by
>> linking Y. Y is
>> otherwise not invoked.  Moreover, I'm unable to trap the exception in
>> the CGI itself
>> (ie, a try/with around the main function is somehow bypassed as the
>> apache error long reports).  So
>> it would seem the that the code fails before the main function is executed.
>>
>> We were using ocamlnet, but I rolled my own cgi parser and reproduced
>> the problem.
>>
>> Any suggestions? My next step would be to start rolling back the system,
>> which is
>> not pleasant.
>>
>>
>> thanks,
>>
>> -- eliot
>>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2014-06-20  8:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 16:43 [Caml-list] [ANN] Core Suite 111.17.00 Ben Millwood
2014-06-18  7:35 ` François Bobot
2014-06-18  9:28   ` Yaron Minsky
2014-06-18 12:57     ` François Bobot
2014-06-18 16:23       ` Yaron Minsky
2014-06-20  3:41         ` [Caml-list] mysterious cgi problem Eliot Handelman
2014-06-20  5:48           ` Siraaj Khandkar
2014-06-20  8:53             ` Mark Shinwell [this message]
2014-06-21 19:19           ` Eliot Handelman

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=CAM3Ki76w9MD5BeGrEFyC3nsSK8vAuh5B0hHcbz4fb0y0p+hFAA@mail.gmail.com \
    --to=mshinwell@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=eliot@colba.net \
    --cc=siraaj@khandkar.net \
    /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).