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

[#37] print() crashes with large strings on Win32 build

Date:
2009-10-24 18:25
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
Nobody (None)
Machine Architecture:
Other
Operating System:
Other
Component:
Basis Library
Resolution:
Fixed
Severity:
Major
OS Version:
Windows 7 - 6.1.7100
SML/NJ Version:
110.71
Keywords:
IO print
URL:
Transcript (of reproduction):
Standard ML of New Jersey v110.71 [built: Thu Sep 17 08:50:14 2009] [opening bug.sml] val bigString = fn : int -> string C:\\Program Files (x86)\\SMLNJ\\\\bin\\.run\\run.x86-win32.exe: Fatal error -- Uncaught exception Io with <unknown> raised at Basis/Implementation/IO/text-io-fn.sml:443.14-443.56 or if I uncomment the working print line: uncaught exception Io [Io: output failed on \"<stdOut>\", <win32 error code 8>] raised at: Basis/Implementation/IO/text-io-fn.sml:443.14-443.56
Source (for reproduction):
(* repro code for Win32 SML output(stdOut, s) bug *) fun bigString(0) = \"\" | bigString(n) = let fun buildString(0) = [] | buildString(n) = #\"*\"::buildString(n-1) in implode(buildString(n)) end; (* this works *) (* print(bigString(62733)); *) (* this fails *) print(bigString(62734));
Summary:
print() crashes with large strings on Win32 build

Detailed description
When calling print() with a string of size >= 62734 the runtime
crashes with the message:

C:\\Program Files (x86)\\SMLNJ\\\\bin\\.run\\run.x86-win32.exe: Fatal error -- Uncaught exception Io with <unknown> raised at Basis/Implementation/IO/text-io-fn.sml:443.14-443.56

This error does not occur on an older Unix build.
Additional comments:
I thought this might be a buffering issue but I tried setting
stdOut to IO.NO_BUF, IO.LINE_BUF, and IO.BLOCK_BUF and it still
occurs. I suspect an issue in low-level IO routines.

Fix:
I tried but SML is too hard to debug. This will require
someone with experience in the code.

Submitted via web form by Jason Mackay <jmackay@u.washington.edu>

Comments:

Message  ↓
Date: 2009-12-12 03:07
Sender: Lars Bergstrom

Fixed. Changelist #3468, should be in 110.72.

Attached Files:

Changes

Field Old Value Date By
status_idOpen2009-12-12 03:07larsberg
close_date2009-12-12 03:072009-12-12 03:07larsberg
ResolutionNone2009-12-12 03:07larsberg