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

input_line raise Sys_error("Invalid argument") #7986

Closed
vicuna opened this issue Jan 5, 2003 · 2 comments
Closed

input_line raise Sys_error("Invalid argument") #7986

vicuna opened this issue Jan 5, 2003 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 5, 2003

Original bug ID: 1513
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Nicolas Cannasse
Version: OCaml 3.06
OS: Win2K
Submission from: abordeaux-103-1-20-136.abo.wanadoo.fr (81.50.41.136)

En utilisant input_line sur un socket avec la bibliothèque Unix,
il m'arrive d'obtenir un Sys_error("Invalid argument") lors d'une lecture sur un
socket déjà fermé coté client ( nous sommes ici coté serveur ).

Ce comportement :

  1. n'est pas documenté
  2. devrais plutot aboutir à un End_of_file

Nicolas

@vicuna
Copy link
Author

vicuna commented Jan 6, 2003

Comment author: administrator

En utilisant input_line sur un socket avec la bibliothèque Unix, il
m'arrive d'obtenir un Sys_error("Invalid argument") lors d'une
lecture sur un socket déjà fermé coté client ( nous sommes ici coté
serveur ).

Ce comportement :

  1. n'est pas documenté

Les entrées-sorties de Caml lèvent Sys_error lorsque les appels
systèmes sous-jacents (ici, read() en Unix, et ReadFromFile() ou recv()
en Windows) signalent une erreur. La doc de Caml ne peut pas inclure
l'intégralité de la spec Unix ou Windows. Et ce d'autant plus que
ladite spec est partielle, et pas forcément respectée par l'OS.

  1. devrais plutot aboutir à un End_of_file

C'est ce qui me semble (condition "fin de fichier" lors de la
lecture), en effet. Avant de crier au bug de Windows, j'aimerais
quand même plus de contexte sur l'erreur, e.g. un programme qui la
reproduise.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jan 10, 2003

Comment author: administrator

Windows detects an error ECONNABORTED while Linux returns an end-of-file
condition. Hard to say who is right. ECONNABORTED is mapped to EINVAL by the
MS C runtime system. At any rate, there's not much we can do in Caml about
this.

@vicuna vicuna closed this as completed Jan 10, 2003
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant