caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] C++ Stack Frames
@ 2004-08-28  4:40 David McClain
  2004-08-28  9:04 ` skaller
  0 siblings, 1 reply; 2+ messages in thread
From: David McClain @ 2004-08-28  4:40 UTC (permalink / raw)
  To: caml

Note, I am not implying that OCaml does the conversion of an unhandled
exception to a call to abort(). Rather, I can show you that this happens
down in the throw handler in libstdc++. I can produce this error in a pure
C++ program without any OCaml around to do anything.

What puzzles me, and at the same time, inspires admiration for the OCaml
team, is that they somehow manage to neutralize these ascending escapes.
Were it not for that, there might be a lot of unhandled cleanup in the OCaml
code that gets bypassed.

No the correct way to handle this situation is down close to the calls into
the throwing C++ code, and not far up the dynamic stack chain.

It appears from reading the runtime sources on OCaml that they are doing
some signal magic. I just was taken by surprise that this happened in a
foreign function call as well. That seems like unnecessary overhead most of
the time, but probably keeps dummies from getting burned to badly....

David McClain
Senior Corporate Scientist
Avisere, Inc.

+1.520.390.7738 (USA)
david.mcclain@avisere.com



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] C++ Stack Frames
  2004-08-28  4:40 [Caml-list] C++ Stack Frames David McClain
@ 2004-08-28  9:04 ` skaller
  0 siblings, 0 replies; 2+ messages in thread
From: skaller @ 2004-08-28  9:04 UTC (permalink / raw)
  To: David McClain; +Cc: caml-list

On Sat, 2004-08-28 at 14:40, David McClain wrote:

> What puzzles me, and at the same time, inspires admiration for the OCaml
> team, is that they somehow manage to neutralize these ascending escapes.

They don't. Its pure luck that C++ fails to find the handler.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2004-08-28  9:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-28  4:40 [Caml-list] C++ Stack Frames David McClain
2004-08-28  9:04 ` skaller

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