You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;;
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
The text was updated successfully, but these errors were encountered: