Skip to content

readu and string instead of integer #78

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

Closed
slayoo opened this issue Apr 7, 2018 · 2 comments
Closed

readu and string instead of integer #78

slayoo opened this issue Apr 7, 2018 · 2 comments
Labels
bug Something isn't working segfault

Comments

@slayoo
Copy link
Member

slayoo commented Apr 7, 2018

As reported by @GillesDuvert on SF.net:

READU, 'aaa', something

gives:

% Type conversion error: Unable to convert given STRING: 'aaa' to LONG.
... and GDL is waiting forever (waiting to read on unit 0 = the terminal)

OK, IDL has exactly the very same problem
but I believe GDL should throw an exception on this.

@slayoo slayoo added the segfault label Apr 7, 2018
@slayoo
Copy link
Member Author

slayoo commented Apr 7, 2018

With 0.9.8:

$ gdl -quiet
GDL> READU, 'aaa', something
% Type conversion error: Unable to convert given STRING: 'aaa' to LONG.

^C% Interrupt encountered.

^C% Interrupt encountered.

^C% Interrupt encountered.

Segmentation fault

@slayoo
Copy link
Member Author

slayoo commented Apr 7, 2018

Further comments from SF.net:

@alaingdl on 2013-09-12:

for me, the exact issue is GDL crashes after, not IDL.

@alaingdl on 2013-09-28:

the problem of crash is related to lines 1886/1889 in basic_pro.cpp

1886 int pos = is->tellg();

this value is negative when playing with lun 0

and we also loose the contant when it is legitime to get it, e.g.:

str='abcd'
readu, 0, str

(we input for exemple: qwertyuiop and we should have 'qwer' inside str)

@GillesDuvert GillesDuvert added the bug Something isn't working label Apr 11, 2018
GillesDuvert added a commit that referenced this issue Jul 5, 2020
GillesDuvert added a commit that referenced this issue Aug 27, 2023
adds a boolean to AssureLongScalarPar to enable catching conversion errors at this early level if necessary.
GillesDuvert added a commit that referenced this issue Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working segfault
Projects
None yet
Development

No branches or pull requests

2 participants