caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* segfault in 3.10
@ 2007-06-28 21:38 micha
  2007-06-28 22:35 ` [Caml-list] " Olivier Andrieu
  2007-06-29  0:22 ` Jon Harrop
  0 siblings, 2 replies; 3+ messages in thread
From: micha @ 2007-06-28 21:38 UTC (permalink / raw)
  To: caml-list

I get a segfault when compiling the program below with ocamlopt 3.10 on
linux (athlon xp) and running it without an argument (it should throw
an exception). The code below is the smallest part of my program
, without much sense now :-) which produces the segfault; changing
something gives you the normal exception:
  Fatal error: exception Invalid_argument("index out of bounds")

for accessing a non existing array field.

I comiled it with ocamlopt -o seg seg.ml

Is this on my system only or can someone reproduce this?

thanks
 Michael

---------------------------------
open Printf;;
module ISet = Set.Make (struct type t=int let compare = (-) end);;

let gen_hash keys maxlen = (fun i -> 0);;

let test_hash hash keys =
        let set = Queue.fold(fun set k -> ISet.remove 0 set)
(ISet.empty) keys in () ;;

let _ =
        printf "%s keys...\n" Sys.argv.(1);
        let k = Queue.create() in
        let h = gen_hash k 20 in
        print_endline "ready";
        test_hash h k


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] segfault in 3.10
  2007-06-28 21:38 segfault in 3.10 micha
@ 2007-06-28 22:35 ` Olivier Andrieu
  2007-06-29  0:22 ` Jon Harrop
  1 sibling, 0 replies; 3+ messages in thread
From: Olivier Andrieu @ 2007-06-28 22:35 UTC (permalink / raw)
  To: micha; +Cc: caml-list

On 6/28/07, micha <micha-1@fantasymail.de> wrote:
> I comiled it with ocamlopt -o seg seg.ml
>
> Is this on my system only or can someone reproduce this?

I get this when I request exception backtrace (via OCAMLRUNPARAM)
_and_ when the program is compiled without -g.

It seems to be the same bug as this one:
http://caml.inria.fr/mantis/view.php?id=4300

-- 
  Olivier


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] segfault in 3.10
  2007-06-28 21:38 segfault in 3.10 micha
  2007-06-28 22:35 ` [Caml-list] " Olivier Andrieu
@ 2007-06-29  0:22 ` Jon Harrop
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Harrop @ 2007-06-29  0:22 UTC (permalink / raw)
  To: caml-list

On Thursday 28 June 2007 22:38:30 micha wrote:
> I get a segfault when compiling the program below with ocamlopt 3.10 on
> linux (athlon xp) and running it without an argument (it should throw
> an exception). The code below is the smallest part of my program...

Here's an implementation that's both shorter and faster: ;-)

  print_endline Sys.argv.(-1)

Run with:

$ ocamlopt test.ml -o test
$ export CAMLRUNPARAM=b
$ ./test
Segmentation fault

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The OCaml Journal
http://www.ffconsultancy.com/products/ocaml_journal/?e


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-29  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-28 21:38 segfault in 3.10 micha
2007-06-28 22:35 ` [Caml-list] " Olivier Andrieu
2007-06-29  0:22 ` Jon Harrop

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).