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

"dangling" exception in native code. #7977

Closed
vicuna opened this issue Dec 23, 2002 · 1 comment
Closed

"dangling" exception in native code. #7977

vicuna opened this issue Dec 23, 2002 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 23, 2002

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

Bug description

Hello,

Next small example produce segfault for native code, but work ok in byte
code.

I use OCaml 3.06. I compile and run this example on Linux, Win98, and Cygwin
systems, result is same.

type s = { mutable exc : exn };;

let run max = begin
let rec loop n acc =
if n > 0
then
let s = { exc = Not_found } in
let f () =
s.exc <- Failure (string_of_int n);
raise Not_found
in
loop ( n - 1 ) ( (s, f) :: acc )
else acc in
print_endline "Make list"; flush_all ();
let lst = loop max [] in
print_endline "Iter 1"; flush_all ();
List.iter
(fun (s,f) -> try f () with Not_found -> () )
lst;
print_endline "Iter 2"; flush_all ();
List.iter
(fun (s,_) -> ignore(Printexc.to_string s.exc) )
lst;
print_endline "The End"; flush_all ()
end;;

let _ = run 3000 ;;

--
Best Regards,
Artem Prisyanuk
tema@sit.kiev.ua

@vicuna
Copy link
Author

vicuna commented Mar 12, 2003

Comment author: administrator

Fixed 2003-03-12 by XL

@vicuna vicuna closed this as completed Mar 12, 2003
@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