Closed andreevgy closed 3 years ago
Hi, I can't reproduce the issue on OSX, can you uncomment the -ggdb -fsanitize=address
in the Makefile at line 74, make re
the test and run./assets/libtests lstdelone
?
Thanks for your bug report.
There's output
/~~~\/~~\/~~~\/~~~\/~~\/~~~\ /~~~\/~~\/~~~\/~~~\/~~\/~~~\
| /\/ /\/ /\ || /\/ /\/ /\ | | /\ \/\ \/\ || /\ \/\ \/\ |
\ \/ /\/ /\/ /\ \/ /\/ /\/ / Bonus part \ \/\ \/\ \/ /\ \/\ \/\ \/ /
\ \/\ \/\ \/ \ \/\ \/\ \/ \/ /\/ /\/ / \/ /\/ /\/ /
,_/\ \/\ \/\ \__/\ \/\ \/\ \______________________/ /\/ /\/ /\__/ /\/ /\/ /\_,
(__/\__/\__/\____/\__/\__/\________________________/\__/\__/\____/\__/\__/\__)
ft_lstdelone: [OK] AddressSanitizer:DEADLYSIGNAL
=================================================================
==1052==ERROR: AddressSanitizer: SEGV on unknown address 0x7fa900000000 (pc 0x0000005aa6bd bp 0x7fffdccce4d0 sp 0x7fffdccbe0e0 T0)
==1052==The signal is caused by a READ memory access.
#0 0x5aa6bc (/mnt/c/Users/gleba/Projects/libft-unit-test/assets/libtests+0x5aa6bc)
#1 0x513b90 (/mnt/c/Users/gleba/Projects/libft-unit-test/assets/libtests+0x513b90)
#2 0x5149af (/mnt/c/Users/gleba/Projects/libft-unit-test/assets/libtests+0x5149af)
#3 0x7fa9ec9a1b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#4 0x41ac39 (/mnt/c/Users/gleba/Projects/libft-unit-test/assets/libtests+0x41ac39)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/mnt/c/Users/gleba/Projects/libft-unit-test/assets/libtests+0x5aa6bc)
==1052==ABORTING
Okay, so by seeing this stacktrace, i can tell that it's not you lstdelone that causes the segfault but something at the end of the test (probably in the final display). To verify this i'll need a better stacktrace, sorry to bother you again but can you run the ./assets/libtests lstdelone
inside gdb and print the stacktrace as well as the assembly dump when the program is crashed ?
I also have the same crash: Tested this function (most likely it is not correct) on WSL:
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
del(*alst, (*alst)->content_size);
}
Get this error:
ft_lstdel: [FAILED] [SIGSEGV]: segmentation violation
OMG you crashed my program, please report this bug to @alelievr !
thanks
Oh, it should be ft_lstdelone(), not a ft_lstdel() !!!
Hello, I fixed a crash in this commit that was happening near the list test functions: https://github.com/alelievr/libft-unit-test/commit/c760077a99a3dbcfb8b5cfbf4b61e589cd8fa92b
I'll close this issue for now but if the crash is still happening, please re-open it :)
Thank you @alelievr. Pretty sure it will be helpful for the future generation of 42 students.
Was testing this function:
Tests crashed with this message:
However jtoty/Libftest works well with it.
I'm running all of this in WSL (Windows Subsystem for Linux) with Ubuntu 18.04. Can provide more info if you need.