CPU: x86_64
Just KO because of the free(): invalid pointer error.
Additional information
2023-10-21 09:37:19,196 [fsoares][INFO]: copying sanitized libft.a from /nfs/homes//francinette/temp/libft/fsoares/../__my_srcs to /nfs/homes//francinette/temp/libft/fsoares
2023-10-21 09:37:19,204 [fsoares][INFO]: On directory /nfs/homes//francinette/temp/libft/fsoares
2023-10-21 09:37:19,204 [fsoares][INFO]: executing gcc -g -D TIMEOUT=2 -Wall -Wextra -Werror -Wno-deprecated-declarations my_utils.c list_utils.c test_lstmap.c utils/malloc_mock.c utils/utils.c -L. -lft -o test_lstmap.out -ldl
2023-10-21 09:37:19,498 [fsoares][INFO]: CompletedProcess(args='gcc -g -D TIMEOUT=2 -Wall -Wextra -Werror -Wno-deprecated-declarations my_utils.c list_utils.c test_lstmap.c utils/malloc_mock.c utils/utils.c -L. -lft -o test_lstmap.out -ldl', returncode=0, stdout='', stderr='')
free(): invalid pointer
2.KO Abort
2023-10-21 09:37:19,730 [base][ERROR]: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
File "/nfs/homes//francinette/testers/BaseTester.py", line 183, in test_using
return (tester.name, tx.execute())
File "/nfs/homes//francinette/testers/libft/Fsoares.py", line 45, in execute
result = self.execute_tests()
File "/nfs/homes//francinette/testers/libft/Fsoares.py", line 139, in execute_tests
result = [execute_test(func) for func in self.to_execute]
File "/nfs/homes//francinette/testers/libft/Fsoares.py", line 139, in <listcomp>
result = [execute_test(func) for func in self.to_execute]
File "/nfs/homes//francinette/testers/libft/Fsoares.py", line 137, in execute_test
return parse_output(remove_ansi_colors(output), func)
File "/nfs/homes//francinette/testers/libft/Fsoares.py", line 109, in parse_output
return (match.group(1), match.group(2), lines)
AttributeError: 'NoneType' object has no attribute 'group'
I think I know why it does this. In the /nfs/homes//francinette/tests/libft/fsoares/test_lstmap.c file, line 19, the contents are freed.
So you'd think that's fine, but if we take a closer look at the code, we see how tests are generated line 60. We can see that you're passing a freshly created string to the create_list function, so for the moment, the string is store on the stack. Then, it goes to the create_list function, and to the lstnew function.
But I didn't see any strdup or anything to duplicate the string in the heap. So, as far as I'm concerned, the string is still in the heap and can't be moved from there.
After that, you're trying to free something you can't, so we get an error.
Describe the bug
free(): invalid pointer
error.Additional information
I think I know why it does this. In the
/nfs/homes//francinette/tests/libft/fsoares/test_lstmap.c file
, line 19, the contents are freed. So you'd think that's fine, but if we take a closer look at the code, we see how tests are generated line 60. We can see that you're passing a freshly created string to thecreate_list
function, so for the moment, the string is store on the stack. Then, it goes to thecreate_list
function, and to thelstnew
function. But I didn't see anystrdup
or anything to duplicate the string in the heap. So, as far as I'm concerned, the string is still in the heap and can't be moved from there. After that, you're trying to free something you can't, so we get an error.