Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003921OCamlstandard librarypublic2005-12-13 05:092017-05-02 12:07
Assigned To 
PlatformOSOS Version
Product Version3.09.0 
Target VersionFixed in Version 
Summary0003921: structural equality for cyclic data structure cannot be interrupted
DescriptionIn the interactive toplevel of ocaml, the "infinite loop"

  let rec x = 1 :: x in x = x

cannot be interrupted by Ctrl-C _despite_ the following paragraph in
Chapter 9 of the manual:

> At any point, the parsing, compilation or evaluation of the current
> phrase can be interrupted by pressing ctrl-C (or, more precisely, by
> sending the INTR signal to the ocaml process). The toplevel then
> immediately returns to the # prompt.

The problem reproduces on any UNIX system to which I have access.

See also: [^]

By the way, the behavior of *not* checking == first in = seems to have been adopted in recent versions of ocaml, but its implications are not quite well-documented in the "Changes" file (though the manual seems to be up to date).
TagsNo tags attached.
Attached Files

- Relationships
related to 0007502resolvedfrisch (=) does not use physical equality unlike compare 
related to 0007524acknowledged Add warning when using '=' in for none immediate values 

-  Notes
doligez (administrator)
2005-12-15 13:20

Maybe we could poll for signals, but there are subtleties.
stedolan (developer)
2017-03-08 15:23

I think a reasonable way to implement polling would be to abort the comparison if a signal is detected (i.e. return from compare_val and free the compare stack if necessary), then handle the signal and restart the comparison from the beginning. Trying to keep the compare stack alive across a signal handler sounds like much more trouble than it's worth.

We'll probably need to fix this for multicore, at least: a single thread diverging shouldn't prevent others from making progress, and we rely on the signal-polling mechanism to synchronise GC.

- Issue History
Date Modified Username Field Change
2005-12-13 05:09 sumii New Issue
2005-12-15 13:20 doligez Note Added: 0003439
2005-12-15 13:20 doligez Priority normal => low
2005-12-15 13:20 doligez Severity minor => feature
2005-12-15 13:20 doligez Status new => acknowledged
2016-12-09 08:34 shinwell Category Incoming => OCaml general
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:15 doligez Category -OCaml general => standard library
2017-03-08 15:23 stedolan Note Added: 0017601
2017-03-09 10:40 octachron Relationship added related to 0007502
2017-05-02 12:07 dra Relationship added related to 0007524

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker