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

segfault en cas de double close_out #4039

Closed
vicuna opened this Issue Jun 6, 2006 · 4 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Jun 6, 2006

Original bug ID: 4039
Reporter: @alainfrisch
Status: closed (set by @xavierleroy on 2006-06-08T14:59:20Z)
Resolution: fixed
Priority: normal
Severity: crash
OS: Linux
Version: 3.09.2
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #4062 #4105 #4109
Related to: #4059
Monitored by: @alainfrisch @mmottl

Bug description

Le programme suivant provoque un segault avec OCaml 3.09.2:

close_out stdout;;
close_out stdout;;
Gc.major ()

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 6, 2006

Comment author: @alainfrisch

Le coupable est probablement la fonction caml_ml_flush dans io.c.
Lorsque le canal est déjà fermé, elle finit directement, sans passer par la case CAMLreturn.

D'ailleurs le code suivant segfaulte aussi:

close_out stdout;
flush stdout;
Gc.major ()

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 6, 2006

Comment author: @alainfrisch

Confirmation. Le segfault disparait si on remplace return par CAMLreturn.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 8, 2006

Comment author: @mmottl

The same kind of bug is also present in function caml_ml_flush_partial in io.c.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 8, 2006

Comment author: @xavierleroy

Well spotted! Fixed in 3.09 bugfix branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.