Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault instead of exception with ocamlopt on BSD #2725

Closed
vicuna opened this issue Jun 15, 2004 · 2 comments
Closed

segfault instead of exception with ocamlopt on BSD #2725

vicuna opened this issue Jun 15, 2004 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jun 15, 2004

Original bug ID: 2725
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Andreas Hauser
Version: 3.07+2 and 3.07+19
OS: DragonFly BSD and FreeBSD
Submission from: pd9e96782.dip.t-dialin.net (217.233.103.130)

(* This segfaults on DragonFly and FreeBSD with ocamlopt )
(
on Linux or with ocamlc it throws an exception *)
class node =
object
val mutable parent:node option = None
method set_parent p = parent <- p
method path =
match parent with
| Some(p) -> "x" ^ p#path
| None -> ""
end
;;
let n = new node in
n#set_parent (Some(n));
n#path
;;

@vicuna
Copy link
Author

vicuna commented Jun 17, 2004

Comment author: administrator

This is the expected behaviour

@vicuna vicuna closed this as completed Jun 17, 2004
@vicuna
Copy link
Author

vicuna commented Jun 17, 2004

Comment author: administrator

Full_Name: Andreas Hauser

(* This segfaults on DragonFly and FreeBSD with ocamlopt )
(
on Linux or with ocamlc it throws an exception *)

As the error message says, your code triggers an infinite recursion,
causing a stack overflow.
IIRC, stack overflow detection is disabled under FreeBSD, becauses it
has other side-effects. So the segfault is the expected behaviour.

I wonder if this might be made to work under freebsd 5.2.

Jacques

@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant