Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005344OCaml~DO NOT USE (was: OCaml general)public2011-08-19 15:282012-09-25 20:06
Assigned Toxclerc 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version3.12.1+dev 
Summary0005344: Confusing exception printing
Fatal exceptions are sometimes printed in an unexpected way.

For example compiling the following:

  type test = A of int * string
            | B of int * string

  exception TestExc of test

  let _ = raise (TestExc (A(3, "HelloWorld")))

and running it produces:

  bash-3.2$ ocamlc
  bash-3.2$ ocamlrun a.out
  Fatal error: exception TestA.TestExc(3, "HelloWorld")

Whereas this program:

  type test = A of int * string
            | B of int * string

  exception TestExc of test

  let _ = raise (TestExc(B(3, "HelloWorld")))

produces this:

  bash-3.2$ ocamlc
  bash-3.2$ ocamlrun a.out
  Fatal error: exception TestB.TestExc(_)

The second example is probably the correct behaviour. The problem seems to be caused by lines 60-66 in caml_format_exception in byterun/printexc.c, which are supposed to handle printing exceptions like Match_Failure and Assert_Failure.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-08-19 15:28 lpw25 New Issue
2011-09-08 10:35 xclerc Status new => resolved
2011-09-08 10:35 xclerc Fixed in Version => 3.12.1+dev
2011-09-08 10:35 xclerc Resolution open => fixed
2011-09-08 10:35 xclerc Assigned To => xclerc
2012-09-25 20:06 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker