Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004978OCamlOCaml generalpublic2010-02-15 22:452013-04-05 00:08
Reportergerd 
Assigned Tomeyer 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version3.11.1 
Target Version4.00.2+devFixed in Version 
Summary0004978: exceptions lose identity after marshalling
DescriptionLooks like exceptions cannot be matched against after marshalling them:

# exception S of int;;
exception S of int
# let mk_s s = S s;;
val mk_s : int -> exn = <fun>
# let dest_s (S s ) = s;;
Warning P: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
*exception*
val dest_s : exn -> int = <fun>
# dest_s (mk_s 42);;
- : int = 42
# dest_s (Marshal.from_string (Marshal.to_string (mk_s 42) []) 0);;
Exception: Match_failure ("", 1, 11).
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005245)
gerd (reporter)
2010-02-17 00:11

I've found a workaround in my code. So far I see it is difficult to fix this problem in Marshal: exceptions do not have a tag of their own, and cannot even recognized by the marshaller.

Maybe just mention this problem in the documentation?
(0005946)
doligez (manager)
2011-05-31 16:51

Definitely mention the problem in the docs.
(0009037)
Boris Yakobowski (reporter)
2013-04-04 23:15

This just bit us (Frama-C) on a real run of analysis, and understanding the problem and its root was quite a challenge. On top of a mention in the documentation, detecting and warning at compile-time that the type of the marshalled value can contain exceptions somewhere would be a great help.
(0009038)
meyer (developer)
2013-04-05 00:08

Commit 13486, fixes the documentation part.

- Issue History
Date Modified Username Field Change
2010-02-15 22:45 gerd New Issue
2010-02-17 00:11 gerd Note Added: 0005245
2011-05-31 16:51 doligez Note Added: 0005946
2011-05-31 16:51 doligez Status new => acknowledged
2012-07-11 13:29 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-10 05:46 meyer Assigned To => meyer
2012-09-10 05:46 meyer Status acknowledged => assigned
2012-09-17 17:45 doligez Target Version 4.00.1+dev => 4.00.2+dev
2013-04-04 23:15 Boris Yakobowski Note Added: 0009037
2013-04-05 00:08 meyer Note Added: 0009038


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker