Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005344OCamlOCaml generalpublic2011-08-19 15:282012-09-25 20:06
Reporterlpw25 
Assigned Toxclerc 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version3.12.1+dev 
Summary0005344: Confusing exception printing
Description
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 testA.ml
  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 testB.ml
  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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker