Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#119] Conversion from vector of tupple to vector of vector causes a crush

Date:
2013-09-04 10:44
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
David MacQueen (dbm)
Machine Architecture:
All
Operating System:
Other
Component:
Compiler
Resolution:
Fixed
Severity:
Critical
OS Version:
Windows 7
SML/NJ Version:
110.75
Keywords:
URL:
Transcript (of reproduction):
Source (for reproduction):
Standard ML of New Jersey v110.75 [built: Sat Sep 29 12:51:13 2012] - val ss = #[(1,2)]; val ss = #[(1,2)] : (int * int) vector - val ss = Vector.map (fn (a,b) => #[a,b]) ss; [autoloading] [library $SMLNJ-BASIS/basis.cm is stable] [autoloading done] val ss = #[prim?] : int vector vector - Vector.sub(Vector.sub(ss,0),0); C:\Program Files (x86)\SMLNJ\\bin\.run\run.x86-win32.exe: Fatal error -- win32:fault_handler: unexpected fault @0x375a8c0, code = 0xc0000005
Summary:
Conversion from vector of tupple to vector of vector causes a crush

Detailed description
Let us consider converting a vector containing a pair of integers to a vector of length-2 vector
with Vector.map.
Doing this conversion itself does not result in a crush but I guess that the resultant object
is already malformed since sml-compiler prints #[prim?], not integers like
#[#[1,2],#[3,4]].
A crush will occurs when picking up an integer from the converted vector with
Vector.sub.

Though under an older version, 110.72, I have experienced a similar crush occurs in Linux.
Submitted via web form by Masaya Saito saitohm@ism.ac.jp

Comments:

Message  ↓
Date: 2014-08-14 21:10
Sender: John Reppy

The problem turned out to be an overly aggressive optimization in CPS contraction. Fixed for 110.77.

Date: 2013-09-04 14:43
Sender: John Reppy

Here is a different version, which demonstrates that there is some inconsistency in the representations:


fun f (ss : int vector vector) = Vector.sub(Vector.sub(ss,0),0);
f #[ #[ 1, 2 ] ]; (* works *)
f (Vector.tabulate (2, fn i => #[i])); (* works *)
f (Vector.map (fn (a,b) => #[a,b]) #[(1,2)]); (* core dump *)

Date: 2013-09-04 11:04
Sender: John Reppy

Confirmed on 110.76 / Mac OS X.

Date: 2013-09-04 10:56
Sender: Lars Bergstrom

I confirmed that this occurs on OSX as well with 110.75.

Attached Files:

Changes

Field Old Value Date By
status_idOpen2014-08-14 21:10jhr
close_date2014-08-14 21:102014-08-14 21:10jhr
ResolutionNone2014-08-14 21:10jhr
assigned_tonone2013-09-04 11:04jhr
Machine ArchitectureNone2013-09-04 11:04jhr