caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Segmentation fault
@ 2008-06-03  3:09 Jacques Le Normand
  2008-06-03 14:08 ` [Caml-list] " Berke Durak
  0 siblings, 1 reply; 2+ messages in thread
From: Jacques Le Normand @ 2008-06-03  3:09 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 2040 bytes --]

Hello caml-list,

I'm encountering a segfault on ocaml 3.09

The test case seems long, but if I remove any line from it it stops
segfaulting. The strangest thing is that get_right_sibling_specific is
called, though it appears nowhere. If you change it's name, the segfault
dissapears. Any help would be appreciated!
here's the code:

class virtual bottle_environment =
object
  method virtual gladiators : string list
  method virtual bottles : bottle list
end
and virtual bottle =
object
  method virtual action : (unit -> bottle_environment option)
end

type outer_space = {
    foo : int list
}
let empty_outer_space =
  {

    foo = [];

  }

class virtual  expression =
object
  method virtual get_silly_bottle : bottle
end
class virtual  expression_skel =
object(self)
  inherit  expression
  method bambam = empty_outer_space
  method get_silly_bottle =
  (object
     inherit bottle
     method action () =
       Some (object
           method gladiators =
         print_endline "entering bottles";
         ignore (self#bambam.foo);
         ["enter "]
           method bottles =

         []
         end)
   end)
end


class virtual baggy_expression_skel =
object(self)
  inherit expression_skel
  method get_bottle_environment =
  object
    method gladiators = ([]:string list)
    method bottles =       [self#get_silly_bottle]
  end
end

class virtual  papa_expression_skel =
object(self)
  method get_right_sibling_specific = print_endline "im being called, though
I shouldn't" ; (None:expression option)
  inherit  expression
end

class papa_baggy_expression =
object(self)
  inherit baggy_expression_skel
  inherit papa_expression_skel
end

class top_baggy_expression =
object(self)
  inherit baggy_expression_skel
end

let _ =
  let body_expression  = new top_baggy_expression   in
  let e = new papa_baggy_expression   in
    ignore ((body_expression#get_bottle_environment)#bottles);
    let sugg = e#get_silly_bottle in
      match sugg#action () with
    | None -> ()
    | Some y ->
        ignore (y#gladiators)

[-- Attachment #2: Type: text/html, Size: 3356 bytes --]

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

* Re: [Caml-list] Segmentation fault
  2008-06-03  3:09 Segmentation fault Jacques Le Normand
@ 2008-06-03 14:08 ` Berke Durak
  0 siblings, 0 replies; 2+ messages in thread
From: Berke Durak @ 2008-06-03 14:08 UTC (permalink / raw)
  To: Jacques Le Normand; +Cc: caml-list

Jacques Le Normand wrote:
> Hello caml-list,
> 
> I'm encountering a segfault on ocaml 3.09
> 
> The test case seems long, but if I remove any line from it it stops 
> segfaulting. The strangest thing is that get_right_sibling_specific is 
> called, though it appears nowhere. If you change it's name, the segfault 
> dissapears. Any help would be appreciated!
> here's the code:

I confirm that it segfaults with ocamlc and ocamlopt 3.11+dev12 on amd64.

Stepping with ocamldebug, I find that it segfaults somewhere near this:

Time : 3045 - pc : 58100 - module CamlinternalOO
323     if top then super cla env else <|b|>Obj.repr (super cla) in

So this indeed looks like a bug in the object system.
-- 
Berke DURAK


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

end of thread, other threads:[~2008-06-03 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-03  3:09 Segmentation fault Jacques Le Normand
2008-06-03 14:08 ` [Caml-list] " Berke Durak

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