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

String variables limited to 2000 strings #1938

Open
karlmsmith opened this issue Jun 3, 2019 · 0 comments
Open

String variables limited to 2000 strings #1938

karlmsmith opened this issue Jun 3, 2019 · 0 comments

Comments

@karlmsmith
Copy link
Contributor

Martin Schmidt reported on the users list that

yes? let file_list = SPAWN("ls -1 wind_*nc")

works fine until there are more than 2000 strings in the list. If more than 2000 strings, the program (PyFerret in his case) crashes.

In examining possible causes, I noticed a suspicious comment in fer/utl/store_sys_strings.f

        old_len = cx_hi_ss(cx, x_dim) 
! note: the "2000" in this line matches the same in COUNT_NUMBER_LIST.F 
        cx_hi_ss(cx, x_dim) = cx_hi_ss(cx, x_dim) + nlines - 2000 
        cx_hi_ww(x_dim, cx) = cx_hi_ss(cx, x_dim) 

And in fer/utl/count_number_list.F

      n = n + 2000 - 1   ! allow default memory for 2000 strings

It appears there is a limit of 2000 strings per string variable. Or maybe the mechanism to expand the number of strings in a string variable is not working properly. (Is it trying to save more string pointers before the number of strings are expanded? Or is there no mechanism to expand the number of strings?)

With dynamic memory allocation there should not be any limitations as long as memory limitations are satisfied. (There should also be no need to provide a huge default number of string pointers for each string variable.) If there has to be a limit for some reason, then this limit should be expanded and proper error handling added.

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

No branches or pull requests

1 participant