stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

fixed bug in stringlist

Open aman-godara opened this issue 2 years ago • 9 comments

If the inserted slist has length 0, then insert_at can give seg-fault error in this code:

do i = work_idxn + post_length - pre_length, post_length
         list%stringarray(inew) = slist%stringarray(i)
         inew = inew + 1
end do

Resolved by: adding an if-else statement to check for length of slist

aman-godara avatar Oct 10 '21 16:10 aman-godara

I think there's a need to re run the workflow. Error: says couldn't find stdlib_optval.

aman-godara avatar Oct 10 '21 16:10 aman-godara

I think even after re-running the workflow, it gave the same error.

aman-godara avatar Oct 10 '21 16:10 aman-godara

Any reason why test cases won't pass specifically for macos compiler. I rechecked everything many times but couldn't find any error in logic, I wanted to know if I am making some mistake by making some assumption which is invalid for macos's compiler.

PS: all test cases pass for my gfortran 10.2.0 windows, ran cmake --build build --target clean as well.

aman-godara avatar Oct 15 '21 20:10 aman-godara

As per my analysis:

call number 14 to function compare_list is failing because:

work_list <- ["-100", "-99", ..., "99", "100"] (201 items)

I am trying to insert work_list at the head of work_list, expecting an output: ["-100", "-99", ..., "99", "100", "-100", "-99", ..., "99", "100"] (402 items).

This is what I am getting as the output from macos compiler: ["", "", ..., "", "", "-100", "-99", ..., "99", "100"] (402 items)

aman-godara avatar Oct 17 '21 11:10 aman-godara

What is the status of this PR? How can we help to move forward?

jvdp1 avatar Dec 22 '21 19:12 jvdp1

@jvdp1 Thanks for contacting. PR is stuck here, I tried many different things. I have mentioned the details of the problem here.

I am planning to make these test cases readable for others (I should have thought to do that earlier). But I don't understand why all test cases passes on my GCC compiler but not here on GitHub. This is also preventing me from diving deep into the issue because I have to make a commit everytime and push it to GitHub to see if it works or not. That's why you will see those "temp commits" in the logs.

aman-godara avatar Dec 23 '21 14:12 aman-godara

Strange... I also tested this commit bb30a55a53b3728232727a3afdce168900b0be66 using Fedora with GCC 11.2.0, and all tests passed. I'll try to look further in the next days...

jvdp1 avatar Dec 26 '21 09:12 jvdp1

Any luck? @jvdp1

aman-godara avatar Jan 11 '22 12:01 aman-godara

Any luck? @jvdp1

No :( And then the holidays arrived. It is also difficult to run tests as I don't have a MacOS computer. Anyone with a MaCOS to test this issue?

jvdp1 avatar Jan 11 '22 17:01 jvdp1