Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

structural equality for cyclic data structure cannot be interrupted #3921

Open
vicuna opened this issue Dec 13, 2005 · 6 comments
Open

structural equality for cyclic data structure cannot be interrupted #3921

vicuna opened this issue Dec 13, 2005 · 6 comments

Comments

@vicuna
Copy link

vicuna commented Dec 13, 2005

Original bug ID: 3921
Reporter: sumii
Status: acknowledged (set by @damiendoligez on 2005-12-15T12:20:27Z)
Resolution: open
Priority: low
Severity: feature
Version: 3.09.0
Category: standard library
Related to: #7502 #7524

Bug description

In 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: http://caml.inria.fr/pub/ml-archives/caml-list/2005/12/c270081cc11641447bc76557d0f1dabe.en.html

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).

@vicuna
Copy link
Author

vicuna commented Dec 15, 2005

Comment author: @damiendoligez

Maybe we could poll for signals, but there are subtleties.

@vicuna
Copy link
Author

vicuna commented Mar 8, 2017

Comment author: @stedolan

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.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 18, 2020
@stedolan stedolan self-assigned this Jun 2, 2020
@stedolan stedolan removed the Stale label Jun 2, 2020
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Jul 21, 2021
@stedolan stedolan removed the Stale label Jul 21, 2021
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@damiendoligez
Copy link
Member

Reopening this, now that we have a PR that will close it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants